Documentation ¶
Overview ¶
Package token defines data structures representing Neugram tokens.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Keywords = map[string]Token{ "package": Package, "import": Import, "func": Func, "return": Return, "switch": Switch, "case": Case, "default": Default, "fallthrough": Fallthrough, "const": Const, "if": If, "else": Else, "for": For, "range": Range, "continue": Continue, "break": Break, "goto": Goto, "go": Go, "chan": Chan, "map": Map, "struct": Struct, "methodik": Methodik, "interface": Interface, "type": Type, }
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token int
Token is a neugram lexical token.
const ( Unknown Token = iota Comment Ident // E.g. funcName Int // E.g. 1001 TODO: rename to Integer? Float // E.g. 10.01 Imaginary // E.g. 10.01i String // E.g. "a string" Rune // E.g. '\u1f4a9' Add // + Sub // - Mul // * Div // / Rem // % Pow // ^ Ref // & LogicalAnd // && LogicalOr // || Equal // == Less // < Greater // > Assign // = Not // ! NotEqual // != LessEqual // <= GreaterEqual // >= Shell // $$ ShellWord // [^\s|&;<>()]+ ShellPipe // | ShellNewline // \n GreaterAnd // >& AndGreater // &> TwoGreater // >> ChanOp // <- Ellipsis // ... Inc // ++ Dec // -- AddAssign // += SubAssign // -= MulAssign // *= DivAssign // /= RemAssign // %= PowAssign // ^= Define // := LeftParen // ( LeftBracket // [ LeftBrace // { RightParen // ) RightBracket // ] RightBrace // } Comma // , Period // . Semicolon // ; Colon // : Pipe // | Package Import Func Return Switch Case Default Fallthrough Const If Else For Range Continue Break Goto Go Chan Map Struct Methodik Interface Type )
func (Token) Precedence ¶
Click to show internal directories.
Click to hide internal directories.