Documentation ¶
Overview ¶
Package token declares a number of constants that represent lexical tokens in spok as well as basic operations on those tokens e.g. printing
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token struct { Value string // Value, e.g. "(" Type Type // Type, e.g. LPAREN Pos int // Starting position of this token in the input string Line int // Line number at the start of this token }
Token represents a spok lexical token.
type Type ¶
type Type int
Type is the set of lexical tokens in spok.
const ( EOF Type = iota // EOF ERROR // ERROR COMMENT // COMMENT HASH // # LPAREN // ( RPAREN // ) LBRACE // { RBRACE // } QUOTE // " COMMA // , TASK // task STRING // STRING COMMAND // COMMAND OUTPUT // -> IDENT // IDENT DECLARE // := LINTERP // {{ RINTERP // }} )
Note: EOF is the zero value such that when the parser reads from a closed channel the read value will be token.EOF.
Click to show internal directories.
Click to hide internal directories.