handle node position in file

This commit is contained in:
vadim
2018-01-05 13:01:14 +02:00
parent dac789d601
commit c99f15a646
6 changed files with 419 additions and 339 deletions

View File

@@ -10,10 +10,12 @@ type Token struct {
Value string
StartLine int
EndLine int
StartPos int
EndPos int
}
func NewToken(value []byte, startLine int, endLine int) Token {
return Token{string(value), startLine, endLine}
func NewToken(value []byte, startLine int, endLine int, startPos int, endPos int) Token {
return Token{string(value), startLine, endLine, startPos, endPos}
}
func (t Token) String() string {