diff --git a/printer/printer.go b/printer/printer.go index fcd4690..231c855 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -30,6 +30,27 @@ func NewPrinter(w io.Writer, indentStr string) *Printer { } } +func (p *Printer) PrintFile(n *stmt.StmtList) { + if len(n.Stmts) > 0 { + firstStmt := n.Stmts[0] + n.Stmts = n.Stmts[1:] + + switch fs := firstStmt.(type) { + case *stmt.InlineHtml: + io.WriteString(p.w, fs.Value) + io.WriteString(p.w, "HTML"}, + &stmt.Expression{ + Expr: &scalar.Heredoc{ + Label: "\"LBL\"", + Parts: []node.Node{ + &scalar.EncapsedStringPart{Value: "hello world\n"}, + }, + }, + }, + }, + }) + + expected := `
HTML