[refactoring] parsing error handler

This commit is contained in:
Vadym Slizov
2020-06-29 23:00:56 +03:00
parent 424f7a132c
commit d7652b1c7f
12 changed files with 1191 additions and 631 deletions
+5 -2
View File
@@ -2,15 +2,18 @@ package printer_test
import (
"bytes"
"github.com/z7zmey/php-parser/pkg/ast"
"testing"
"github.com/z7zmey/php-parser/pkg/ast"
"github.com/z7zmey/php-parser/internal/php5"
"github.com/z7zmey/php-parser/internal/scanner"
"github.com/z7zmey/php-parser/pkg/printer"
)
func parsePhp5(src string) ast.Vertex {
php5parser := php5.NewParser([]byte(src), "5.6", true)
lexer := scanner.NewLexer([]byte(src), "5.6", true, nil)
php5parser := php5.NewParser(lexer, true, nil)
php5parser.Parse()
return php5parser.GetRootNode()