diff --git a/fixtures/0003-leave-php-context.php b/fixtures/0003-leave-php-context.php new file mode 100644 index 0000000..be8cb8b --- /dev/null +++ b/fixtures/0003-leave-php-context.php @@ -0,0 +1,14 @@ + + + +

+ + diff --git a/node.go b/node.go index a3030ac..49d1ac4 100644 --- a/node.go +++ b/node.go @@ -3,6 +3,7 @@ package main import ( "fmt" "reflect" + "strconv" //"strconv" "strings" @@ -376,6 +377,15 @@ func convert(n_ node.Node) (string, error) { } return "fmt.Print(" + strings.Join(args, ", ") + ")\n", nil // newline - standalone statement + case *stmt.InlineHtml: + // Convert into fmt.Print + // TODO the result from strconv.Quote is not that nice to maintain if there are multiple newlines + // Should convert it into a backtick-delimeted multiline string instead + return "fmt.Print(" + strconv.Quote(n.Value) + ")\n", nil // newline - standalone statement + + case *stmt.Nop: + return "", nil + // // assign //