diff --git a/README.md b/README.md index 0d3e482..a6dc150 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ nodes := &stmt.StmtList{ file := os.Stdout p := printer.NewPrinter(file, " ") -p.PrintFile(nodes) +p.Print(nodes) ``` It prints to stdout: diff --git a/node/expr/t_array_test.go b/node/expr/t_array_test.go index 7b509e2..1c9bcf2 100644 --- a/node/expr/t_array_test.go +++ b/node/expr/t_array_test.go @@ -202,6 +202,7 @@ func TestArrayItems(t *testing.T) { }, }, }, + nil, }, }, }, diff --git a/node/expr/t_list_test.go b/node/expr/t_list_test.go index 87f9d04..f03ac79 100644 --- a/node/expr/t_list_test.go +++ b/node/expr/t_list_test.go @@ -386,3 +386,193 @@ func TestListList(t *testing.T) { actual = php5parser.GetRootNode() assertEqual(t, expected, actual) } + +func TestListEmptyItem(t *testing.T) { + src := `