token interface

This commit is contained in:
vadim 2017-12-08 11:37:32 +02:00
parent 514630174f
commit 3584676e43

View File

@ -1,5 +1,11 @@
package token
type TokenInterface interface {
GetValue() string
GetStartLine() int
GetEndLine() int
}
type Token struct {
Value string
StartLine int
@ -13,3 +19,13 @@ func NewToken(value []byte, startLine int, endLine int) Token {
func (t Token) String() string {
return string(t.Value)
}
func (t Token) GetValue() string {
return t.Value
}
func (t Token) GetStartLine() int {
return t.StartLine
}
func (t Token) GetEndLine() int {
return t.EndLine
}