create Root node

This commit is contained in:
z7zmey
2018-05-02 12:14:24 +03:00
parent d1b0cebf9a
commit 2abe1dfb84
82 changed files with 363 additions and 309 deletions

View File

@@ -31,7 +31,7 @@ func assertEqual(t *testing.T, expected interface{}, actual interface{}) {
func TestName(t *testing.T) {
src := `<? foo();`
expected := &stmt.StmtList{
expected := &node.Root{
Stmts: []node.Node{
&stmt.Expression{
Expr: &expr.FunctionCall{
@@ -58,7 +58,7 @@ func TestName(t *testing.T) {
func TestFullyQualified(t *testing.T) {
src := `<? \foo();`
expected := &stmt.StmtList{
expected := &node.Root{
Stmts: []node.Node{
&stmt.Expression{
Expr: &expr.FunctionCall{
@@ -85,7 +85,7 @@ func TestFullyQualified(t *testing.T) {
func TestRelative(t *testing.T) {
src := `<? namespace\foo();`
expected := &stmt.StmtList{
expected := &node.Root{
Stmts: []node.Node{
&stmt.Expression{
Expr: &expr.FunctionCall{