php-parser/token/token.go

34 lines
593 B
Go
Raw Normal View History

2017-12-03 18:49:18 +00:00
package token
2017-12-08 09:37:32 +00:00
type TokenInterface interface {
GetValue() string
GetStartLine() int
GetEndLine() int
}
2017-12-03 18:49:18 +00:00
type Token struct {
Value string
StartLine int
EndLine int
2018-01-05 11:01:14 +00:00
StartPos int
EndPos int
2017-12-03 18:49:18 +00:00
}
2018-01-05 11:01:14 +00:00
func NewToken(value []byte, startLine int, endLine int, startPos int, endPos int) Token {
return Token{string(value), startLine, endLine, startPos, endPos}
2017-12-03 18:49:18 +00:00
}
func (t Token) String() string {
return string(t.Value)
}
2017-12-08 09:37:32 +00:00
func (t Token) GetValue() string {
return t.Value
}
func (t Token) GetStartLine() int {
return t.StartLine
}
func (t Token) GetEndLine() int {
return t.EndLine
}