Documentation
¶
Index ¶
Constants ¶
View Source
const ( BpLowest = iota // 0 — expression terminator BpAssign // 1 — = BpOr // 2 — || BpAnd // 3 — && BpEqual // 4 — == != BpCompare // 5 — < <= > >= BpAdd // 6 — + - BpMul // 7 — * / % BpUnary // 8 — prefix ! and - (not in BindingPower, used directly) BpCall // 9 — fn() expr[] )
Binding power is the "gravitational pull" of an infix operator. The higher the value, the more tightly the operator binds its operands.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Token ¶
type TokenType ¶
type TokenType int
const ( EOF TokenType = -1 + iota WHITESPACE COMMENT KW_IF KW_ELSE KW_TRUE KW_FALSE KW_NULL KW_ABORT KW_DEL KW_FOR KW_IN IDENT LIT_FLOAT LIT_INTEGER LIT_STRING // "double quoted" LIT_STRING_RAW // s'\n\n' LIT_REGEX // r'\d+' LIT_TIMESTAMP // t'2024-01-01T00:00:00Z' OP_AND // && OP_OR // || OP_EQ // == OP_NEQ // != OP_LTE // <= OP_GTE // >= OP_ASSIGN // = OP_LT // < OP_GT // > LPAREN // ( RPAREN // ) LBRACE // { RBRACE // } LBRACKET // [ RBRACKET // ] PLUS // + MINUS // - STAR // * SLASH // / PERCENT // % BANG // ! COMMA // , COLON // : SEMICOLON // ; DOT // . )
func (TokenType) BindingPower ¶
Click to show internal directories.
Click to hide internal directories.