Python 3 interpreter in Go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

24 lines
356 B

package token
import "fmt"
type Token struct {
End int
ID TokenID
Literal string
Start int
}
func (token *Token) String() string {
return TokenNames[token.ID]
}
func (token *Token) Repr() string {
return fmt.Sprintf(
"Token{ID: %#v, Literal: %#v, Start: %#v, End: %#v}",
token.ID,
token.Literal,
token.Start,
token.End,
)
}