save comment position

This commit is contained in:
z7zmey
2018-04-15 21:39:26 +03:00
parent c2f938e55c
commit 781a55659b
10 changed files with 114 additions and 61 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/errors"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/parser"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/scanner"
)
@@ -19,7 +20,7 @@ type Parser struct {
*scanner.Lexer
path string
lastToken *scanner.Token
positionBuilder *position.Builder
positionBuilder *parser.Builder
errors []*errors.Error
rootNode node.Node
comments comment.Comments
@@ -63,7 +64,7 @@ func (l *Parser) Parse() int {
l.rootNode = nil
l.comments = comment.Comments{}
l.positions = position.Positions{}
l.positionBuilder = &position.Builder{
l.positionBuilder = &parser.Builder{
Positions: &l.positions,
}