(g *Globals)
| 20 | } |
| 21 | |
| 22 | func (self *pbtPrinter) Run(g *Globals) *Stream { |
| 23 | |
| 24 | bf := NewStream() |
| 25 | bf.Printf("# Generated by github.com/davyxu/tabtoy\n") |
| 26 | bf.Printf("# Version: %s\n", g.Version) |
| 27 | |
| 28 | for _, tab := range g.Tables { |
| 29 | |
| 30 | if !tab.LocalFD.MatchTag(".pbt") { |
| 31 | log.Infof("%s: %s", i18n.String(i18n.Printer_IgnoredByOutputTag), tab.Name()) |
| 32 | continue |
| 33 | } |
| 34 | |
| 35 | if !printTablePBT(bf, tab) { |
| 36 | return nil |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | return bf |
| 41 | } |
| 42 | |
| 43 | func printTablePBT(bf *Stream, tab *model.Table) bool { |
| 44 |