Lines Matching defs:Token
65 // Token represents a single lexed token.
66 type Token struct {
71 func (t Token) String() string { return fmt.Sprintf("{%v %v}", t.Type, t.Range) }
74 func (t Token) Text(lines []string) string { return t.Range.Text(lines) }
173 toks []*Token // all the lexed tokens
178 func (l *lexer) err(tok *Token, msg string, args ...interface{}) {
225 tok := &Token{Type: PIdent, Range: Range{Start: l.pos, End: l.pos}}
246 tok := &Token{Type: Unknown, Range: Range{Start: l.pos, End: l.pos}}
285 tok := &Token{Type: String, Range: Range{Start: l.pos, End: l.pos}}
310 tok := &Token{Type: Operator, Range: Range{Start: l.pos, End: l.pos}}
324 tok := &Token{Type: Comment, Range: Range{Start: l.pos, End: l.pos}}
344 tok := &Token{Type: Newline, Range: Range{Start: l.pos, End: l.pos}}
354 func lex(source string) ([]*Token, []Diagnostic, error) {
400 toks []*Token // all tokens
403 mappings map[*Token]interface{} // tokens to semantic map
431 inst.Tokens = []*Token{p.tok(i)}
440 inst.Tokens = []*Token{p.tok(i), p.tok(i + 1), p.tok(i + 2)}
550 Tokens: []*Token{tok},
628 func (p *parser) tok(i int) *Token {
657 func (p *parser) ident(i int) *Token {
665 func (p *parser) pident(i int) *Token {
695 func (p *parser) addIdentDef(id string, inst *Instruction, def *Token) {
709 func (p *parser) addIdentRef(ref *Token) {
720 func (p *parser) err(tok *Token, msg string, args ...interface{}) {
743 mappings: map[*Token]interface{}{},
772 Tokens []*Token
775 Mappings map[*Token]interface{} // tokens to semantic map
780 Tokens []*Token // all the tokens that make up the instruction
781 Result *Token // the token that represents the result of the instruction, or nil
791 Tokens []*Token // all the tokens that make up the operand
798 References []*Token // all the places the identifier was referenced