github.com/dfcfw/lua@v0.0.0-20230325031207-0cc7ffb7b8b9/ast/token.go (about)

     1  package ast
     2  
     3  import "fmt"
     4  
     5  type Position struct {
     6  	Source string
     7  	Line   int
     8  	Column int
     9  }
    10  
    11  type Token struct {
    12  	Type int
    13  	Name string
    14  	Str  string
    15  	Pos  Position
    16  }
    17  
    18  func (t *Token) String() string {
    19  	return fmt.Sprintf("<type:%v, str:%v>", t.Name, t.Str)
    20  }