issue #2 - fix single line comment

fix handling end of file
add handling php close tag
This commit is contained in:
z7zmey
2018-03-30 17:15:26 +03:00
parent d31819db30
commit 148cf59e9d
4 changed files with 2525 additions and 2379 deletions

View File

@@ -346,3 +346,17 @@ func TestPhp5ParameterNode(t *testing.T) {
actual, _, _ := php5.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual)
}
func TestCommentEndFile(t *testing.T) {
src := `<? //comment at the end)`
expected := &stmt.StmtList{
Stmts: []node.Node{},
}
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual)
actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual)
}