(layout *layout, pfile projectFile, source string)
| 63 | } |
| 64 | |
| 65 | func newLayoutCodeGen(layout *layout, pfile projectFile, source string) *layoutCodeGen { |
| 66 | l := &layoutCodeGen{ |
| 67 | layout: layout, |
| 68 | pfile: pfile, |
| 69 | source: source, |
| 70 | imports: make(map[importDecl]bool), |
| 71 | ioWriterVar: "w", |
| 72 | lineDirectivesEnabled: true, |
| 73 | } |
| 74 | for _, im := range layout.imports { |
| 75 | l.imports[im] = true |
| 76 | } |
| 77 | return l |
| 78 | } |
| 79 | |
| 80 | func lineCount(s string) int { |
| 81 | return strings.Count(s, "\n") + 1 |