Documentation
¶
Index ¶
- Constants
- Variables
- type Parser
- func (p *Parser) AddExpr() (r []int32)
- func (p *Parser) AndExpr() (r []int32)
- func (p *Parser) ArgList() (r []int32)
- func (p *Parser) ArrayLit() (r []int32)
- func (p *Parser) AssignOrExpr() (r []int32)
- func (p *Parser) BenchDef() (r []int32)
- func (p *Parser) Body() (r []int32)
- func (p *Parser) BreakStmt() (r []int32)
- func (p *Parser) CaseExpr() (r []int32)
- func (p *Parser) CompExpr() (r []int32)
- func (p *Parser) EOF() bool
- func (p *Parser) Expr() (r []int32)
- func (p *Parser) ExprList() (r []int32)
- func (p *Parser) FnExpr() (r []int32)
- func (p *Parser) ForStmt() (r []int32)
- func (p *Parser) FuncDef() (r []int32)
- func (p *Parser) HashEntry() (r []int32)
- func (p *Parser) HashLit() (r []int32)
- func (p *Parser) IfStmt() (r []int32)
- func (p *Parser) ImportStmt() (r []int32)
- func (p *Parser) MulExpr() (r []int32)
- func (p *Parser) NextStmt() (r []int32)
- func (p *Parser) OrExpr() (r []int32)
- func (p *Parser) ParallelExpr() (r []int32)
- func (p *Parser) Param() (r []int32)
- func (p *Parser) ParamList() (r []int32)
- func (p *Parser) Parse(name string, src []byte) (ast []int32, err error)
- func (p *Parser) Postfix() (r []int32)
- func (p *Parser) Primary() (r []int32)
- func (p *Parser) Program() (r []int32)
- func (p *Parser) RequireStmt() (r []int32)
- func (p *Parser) ReturnStmt() (r []int32)
- func (p *Parser) SandboxList() (r []int32)
- func (p *Parser) SandboxPerm() (r []int32)
- func (p *Parser) SandboxStmt() (r []int32)
- func (p *Parser) Scan() (r scanner.Token)
- func (p *Parser) SpawnExpr() (r []int32)
- func (p *Parser) Statement() (r []int32)
- func (p *Parser) Suffix() (r []int32)
- func (p *Parser) TestDef() (r []int32)
- func (p *Parser) Token(n int32) (r scanner.Token)
- func (p *Parser) TryExpr() (r []int32)
- func (p *Parser) UnaryExpr() (r []int32)
- func (p *Parser) UseStmt() (r []int32)
- func (p *Parser) WhileStmt() (r []int32)
- type Symbol
Constants ¶
const ( RugoTOK_EOF = Symbol(0) // EOF RugoTOK_00260026 = Symbol(1) // "&&" RugoTOK_002d003e = Symbol(2) // "->" RugoTOK_003d003e = Symbol(3) // "=>" RugoTOK_as = Symbol(4) // "as" RugoTOK_bench = Symbol(5) // "bench" RugoTOK_break = Symbol(6) // "break" RugoTOK_case = Symbol(7) // "case" RugoTOK_def = Symbol(8) // "def" RugoTOK_else = Symbol(9) // "else" RugoTOK_elsif = Symbol(10) // "elsif" RugoTOK_end = Symbol(11) // "end" RugoTOK_false = Symbol(12) // "false" RugoTOK_fn = Symbol(13) // "fn" RugoTOK_for = Symbol(14) // "for" RugoTOK_if = Symbol(15) // "if" RugoTOK_import = Symbol(16) // "import" RugoTOK_in = Symbol(17) // "in" RugoTOK_next = Symbol(18) // "next" RugoTOK_nil = Symbol(19) // "nil" RugoTOK_of = Symbol(20) // "of" RugoTOK_or = Symbol(21) // "or" RugoTOK_parallel = Symbol(22) // "parallel" RugoTOK_rats = Symbol(23) // "rats" RugoTOK_require = Symbol(24) // "require" RugoTOK_return = Symbol(25) // "return" RugoTOK_sandbox = Symbol(26) // "sandbox" RugoTOK_spawn = Symbol(27) // "spawn" RugoTOK_true = Symbol(28) // "true" RugoTOK_try = Symbol(29) // "try" RugoTOK_use = Symbol(30) // "use" RugoTOK_while = Symbol(31) // "while" RugoTOK_with = Symbol(32) // "with" RugoTOK_007c007c = Symbol(33) // "||" RugoTOK_0021 = Symbol(34) // '!' RugoTOK_0025 = Symbol(35) // '%' RugoTOK_0028 = Symbol(36) // '(' RugoTOK_0029 = Symbol(37) // ')' RugoTOK_002a = Symbol(38) // '*' RugoTOK_002b = Symbol(39) // '+' RugoTOK_002c = Symbol(40) // ',' RugoTOK_002d = Symbol(41) // '-' RugoTOK_002e = Symbol(42) // '.' RugoTOK_002f = Symbol(43) // '/' RugoTOK_003a = Symbol(44) // ':' RugoTOK_003b = Symbol(45) // ';' RugoTOK_003d = Symbol(46) // '=' RugoTOK_005b = Symbol(47) // '[' RugoTOK_005d = Symbol(48) // ']' RugoTOK_007b = Symbol(49) // '{' RugoTOK_007d = Symbol(50) // '}' Rugocomp_op = Symbol(51) // comp_op Rugofloat_lit = Symbol(52) // float_lit Rugoident = Symbol(53) // ident Rugointeger = Symbol(54) // integer Rugoraw_str_lit = Symbol(55) // raw_str_lit Rugostr_lit = Symbol(56) // str_lit Rugowhite_space = Symbol(57) // white_space RugoProgram = Symbol(58) // Program RugoStatement = Symbol(59) // Statement RugoUseStmt = Symbol(60) // UseStmt RugoImportStmt = Symbol(61) // ImportStmt RugoRequireStmt = Symbol(62) // RequireStmt RugoSandboxStmt = Symbol(63) // SandboxStmt RugoSandboxPerm = Symbol(64) // SandboxPerm RugoSandboxList = Symbol(65) // SandboxList RugoFuncDef = Symbol(66) // FuncDef RugoTestDef = Symbol(67) // TestDef RugoBenchDef = Symbol(68) // BenchDef RugoParamList = Symbol(69) // ParamList RugoParam = Symbol(70) // Param RugoBody = Symbol(71) // Body RugoIfStmt = Symbol(72) // IfStmt RugoCaseExpr = Symbol(73) // CaseExpr RugoExprList = Symbol(74) // ExprList RugoWhileStmt = Symbol(75) // WhileStmt RugoForStmt = Symbol(76) // ForStmt RugoBreakStmt = Symbol(77) // BreakStmt RugoNextStmt = Symbol(78) // NextStmt RugoReturnStmt = Symbol(79) // ReturnStmt RugoAssignOrExpr = Symbol(80) // AssignOrExpr RugoExpr = Symbol(81) // Expr RugoOrExpr = Symbol(82) // OrExpr RugoAndExpr = Symbol(83) // AndExpr RugoCompExpr = Symbol(84) // CompExpr RugoAddExpr = Symbol(85) // AddExpr RugoMulExpr = Symbol(86) // MulExpr RugoUnaryExpr = Symbol(87) // UnaryExpr RugoPostfix = Symbol(88) // Postfix RugoSuffix = Symbol(89) // Suffix RugoArgList = Symbol(90) // ArgList RugoPrimary = Symbol(91) // Primary RugoTryExpr = Symbol(92) // TryExpr RugoSpawnExpr = Symbol(93) // SpawnExpr RugoParallelExpr = Symbol(94) // ParallelExpr RugoFnExpr = Symbol(95) // FnExpr RugoArrayLit = Symbol(96) // ArrayLit RugoHashLit = Symbol(97) // HashLit RugoHashEntry = Symbol(98) // HashEntry )
Symbols
const RugoSymbolNames = "" /* 696-byte string literal not displayed */
Variables ¶
var Source []byte
Source contains the parser source code for embedding into the AST cache.
var SymbolIndex = [...]uint16{0, 3, 7, 11, 15, 19, 26, 33, 39, 44, 50, 57, 62, 69, 73, 78, 82, 90, 94, 100, 105, 109, 113, 123, 129, 138, 146, 155, 162, 168, 173, 178, 185, 191, 195, 198, 201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, 234, 237, 240, 243, 246, 253, 262, 267, 274, 285, 292, 303, 310, 319, 326, 336, 347, 358, 369, 380, 387, 394, 402, 411, 416, 420, 426, 434, 442, 451, 458, 467, 475, 485, 497, 501, 507, 514, 522, 529, 536, 545, 552, 558, 565, 572, 579, 588, 600, 606, 614, 621, 630}
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) AddExpr ¶
AddExpr grammar:
AddExpr = MulExpr { ('+' | '-') MulExpr } .
State 0
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call MulExpr and goto state 1
State 1
Accept
on '+', '-'
shift and goto state 0
AddExpr is used internally from Parse.
func (*Parser) AndExpr ¶
AndExpr grammar:
AndExpr = CompExpr { "&&" CompExpr } .
State 0
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call CompExpr and goto state 1
State 1
Accept
on "&&"
shift and goto state 0
AndExpr is used internally from Parse.
func (*Parser) ArgList ¶
ArgList grammar:
ArgList = Expr { ',' Expr } .
State 0
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 1
State 1
Accept
on ','
shift and goto state 0
ArgList is used internally from Parse.
func (*Parser) ArrayLit ¶
ArrayLit grammar:
ArrayLit = '[' [ Expr { ',' Expr } ] ']' .
State 0
on '['
shift and goto state 1
State 1
on ']'
shift and goto state 2
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 3
State 2
Accept
State 3
on ']'
shift and goto state 2
on ','
shift and goto state 4
State 4
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 3
ArrayLit is used internally from Parse.
func (*Parser) AssignOrExpr ¶
AssignOrExpr grammar:
AssignOrExpr = Expr [ '=' Expr ] .
State 0
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 1
State 1
Accept
on '='
shift and goto state 2
State 2
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 3
State 3
Accept
AssignOrExpr is used internally from Parse.
func (*Parser) BenchDef ¶
BenchDef grammar:
BenchDef = "bench" str_lit Body "end" .
State 0
on "bench"
shift and goto state 1
State 1
on str_lit
shift and goto state 2
State 2
on "end"
shift and goto state 3
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 4
State 3
Accept
State 4
on "end"
shift and goto state 3
BenchDef is used internally from Parse.
func (*Parser) Body ¶
Body grammar:
Body = { Statement | ';' } .
State 0
Accept
on ';'
shift and goto state 1
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Statement and goto state 1
State 1
Accept
on ';'
shift and goto state 1
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Statement and goto state 1
Body is used internally from Parse.
func (*Parser) BreakStmt ¶
BreakStmt grammar:
BreakStmt = "break" . State 0 on "break" shift and goto state 1 State 1 Accept
BreakStmt is used internally from Parse.
func (*Parser) CaseExpr ¶ added in v0.27.0
CaseExpr grammar:
CaseExpr = "case" Expr { "of" ExprList ( "->" Expr | Body ) } { "elsif" Expr ( "->" Expr | Body ) } [ "else" ( "->" Expr | Body ) ] "end" .
State 0
on "case"
shift and goto state 1
State 1
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 2
State 2
on "of"
shift and goto state 11
on "else"
shift and goto state 3
on "end"
shift and goto state 6
on "elsif"
shift and goto state 7
State 3
on "->"
shift and goto state 4
on "end"
shift and goto state 6
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 5
State 4
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 5
State 5
on "end"
shift and goto state 6
State 6
Accept
State 7
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 8
State 8
on "else"
shift and goto state 3
on "end"
shift and goto state 6
on "elsif"
shift and goto state 7
on "->"
shift and goto state 9
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 10
State 9
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 10
State 10
on "else"
shift and goto state 3
on "end"
shift and goto state 6
on "elsif"
shift and goto state 7
State 11
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call ExprList and goto state 12
State 12
on "of"
shift and goto state 11
on "->"
shift and goto state 1
on "else"
shift and goto state 3
on "end"
shift and goto state 6
on "elsif"
shift and goto state 7
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 2
CaseExpr is used internally from Parse.
func (*Parser) CompExpr ¶
CompExpr grammar:
CompExpr = AddExpr [ comp_op AddExpr ] .
State 0
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call AddExpr and goto state 1
State 1
Accept
on comp_op
shift and goto state 2
State 2
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call AddExpr and goto state 3
State 3
Accept
CompExpr is used internally from Parse.
func (*Parser) Expr ¶
Expr grammar:
# Expressions (lowest to highest precedence)
Expr = OrExpr .
State 0
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call OrExpr and goto state 1
State 1
Accept
Expr is used internally from Parse.
func (*Parser) ExprList ¶ added in v0.27.0
ExprList grammar:
ExprList = Expr { ',' Expr } .
State 0
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 1
State 1
Accept
on ','
shift and goto state 0
ExprList is used internally from Parse.
func (*Parser) FnExpr ¶
FnExpr grammar:
FnExpr = "fn" '(' [ ParamList ] ')' Body "end" .
State 0
on "fn"
shift and goto state 1
State 1
on '('
shift and goto state 2
State 2
on ')'
shift and goto state 3
on ident, Param
call ParamList and goto state 6
State 3
on "end"
shift and goto state 4
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 5
State 4
Accept
State 5
on "end"
shift and goto state 4
State 6
on ')'
shift and goto state 3
FnExpr is used internally from Parse.
func (*Parser) ForStmt ¶
ForStmt grammar:
ForStmt = "for" ident [ ',' ident ] "in" Expr Body "end" .
State 0
on "for"
shift and goto state 1
State 1
on ident
shift and goto state 2
State 2
on "in"
shift and goto state 3
on ','
shift and goto state 7
State 3
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 4
State 4
on "end"
shift and goto state 5
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 6
State 5
Accept
State 6
on "end"
shift and goto state 5
State 7
on ident
shift and goto state 8
State 8
on "in"
shift and goto state 3
ForStmt is used internally from Parse.
func (*Parser) FuncDef ¶
FuncDef grammar:
FuncDef = "def" ident '(' [ ParamList ] ')' Body "end" .
State 0
on "def"
shift and goto state 1
State 1
on ident
shift and goto state 2
State 2
on '('
shift and goto state 3
State 3
on ')'
shift and goto state 4
on ident, Param
call ParamList and goto state 7
State 4
on "end"
shift and goto state 5
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 6
State 5
Accept
State 6
on "end"
shift and goto state 5
State 7
on ')'
shift and goto state 4
FuncDef is used internally from Parse.
func (*Parser) HashEntry ¶
HashEntry grammar:
HashEntry = Expr "=>" Expr .
State 0
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 1
State 1
on "=>"
shift and goto state 2
State 2
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 3
State 3
Accept
HashEntry is used internally from Parse.
func (*Parser) HashLit ¶
HashLit grammar:
HashLit = '{' [ HashEntry { ',' HashEntry } ] '}' .
State 0
on '{'
shift and goto state 1
State 1
on '}'
shift and goto state 2
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call HashEntry and goto state 3
State 2
Accept
State 3
on '}'
shift and goto state 2
on ','
shift and goto state 4
State 4
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call HashEntry and goto state 3
HashLit is used internally from Parse.
func (*Parser) IfStmt ¶
IfStmt grammar:
IfStmt = "if" Expr Body { "elsif" Expr Body } [ "else" Body ] "end" .
State 0
on "if"
shift and goto state 1
State 1
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 2
State 2
on "elsif"
shift and goto state 1
on "else"
shift and goto state 3
on "end"
shift and goto state 4
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 6
State 3
on "end"
shift and goto state 4
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 5
State 4
Accept
State 5
on "end"
shift and goto state 4
State 6
on "elsif"
shift and goto state 1
on "else"
shift and goto state 3
on "end"
shift and goto state 4
IfStmt is used internally from Parse.
func (*Parser) ImportStmt ¶
ImportStmt grammar:
ImportStmt = "import" str_lit [ "as" ident ] . State 0 on "import" shift and goto state 1 State 1 on str_lit shift and goto state 2 State 2 Accept on "as" shift and goto state 3 State 3 on ident shift and goto state 4 State 4 Accept
ImportStmt is used internally from Parse.
func (*Parser) MulExpr ¶
MulExpr grammar:
MulExpr = UnaryExpr { ('*' | '/' | '%') UnaryExpr } .
State 0
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call UnaryExpr and goto state 1
State 1
Accept
on '%', '*', '/'
shift and goto state 0
MulExpr is used internally from Parse.
func (*Parser) NextStmt ¶
NextStmt grammar:
NextStmt = "next" . State 0 on "next" shift and goto state 1 State 1 Accept
NextStmt is used internally from Parse.
func (*Parser) OrExpr ¶
OrExpr grammar:
OrExpr = AndExpr { "||" AndExpr } .
State 0
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call AndExpr and goto state 1
State 1
Accept
on "||"
shift and goto state 0
OrExpr is used internally from Parse.
func (*Parser) ParallelExpr ¶
ParallelExpr grammar:
ParallelExpr = "parallel" Body "end" .
State 0
on "parallel"
shift and goto state 1
State 1
on "end"
shift and goto state 2
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 3
State 2
Accept
State 3
on "end"
shift and goto state 2
ParallelExpr is used internally from Parse.
func (*Parser) Param ¶ added in v0.24.0
Param grammar:
Param = ident [ '=' Expr ] .
State 0
on ident
shift and goto state 1
State 1
Accept
on '='
shift and goto state 2
State 2
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 3
State 3
Accept
Param is used internally from Parse.
func (*Parser) ParamList ¶
ParamList grammar:
ParamList = Param { ',' Param } .
State 0
on ident
call Param and goto state 1
State 1
Accept
on ','
shift and goto state 0
ParamList is used internally from Parse.
func (*Parser) Parse ¶
Parse parses 'src'. 'src' becomes "owned" by the parser and must not be mutated afterwards.
func (*Parser) Postfix ¶
Postfix grammar:
Postfix = Primary { Suffix } .
State 0
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '(', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Primary and goto state 1
State 1
Accept
on '(', '.', '['
call Suffix and goto state 1
Postfix is used internally from Parse.
func (*Parser) Primary ¶
Primary grammar:
# Primary expressions
Primary = ident
| integer
| float_lit
| str_lit
| raw_str_lit
| "true"
| "false"
| "nil"
| ArrayLit
| HashLit
| CaseExpr
| TryExpr
| SpawnExpr
| ParallelExpr
| FnExpr
| '(' Expr ')' .
State 0
on "false", "nil", "true", float_lit, ident, integer, raw_str_lit, str_lit
shift and goto state 1
on '('
shift and goto state 2
on "case"
call CaseExpr and goto state 1
on "try"
call TryExpr and goto state 1
on "spawn"
call SpawnExpr and goto state 1
on "parallel"
call ParallelExpr and goto state 1
on "fn"
call FnExpr and goto state 1
on '['
call ArrayLit and goto state 1
on '{'
call HashLit and goto state 1
State 1
Accept
State 2
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 3
State 3
on ')'
shift and goto state 1
Primary is used internally from Parse.
func (*Parser) Program ¶
Program grammar:
# Rugo Language Grammar (LL(1))
# A minimal Ruby-inspired language that transpiles to Go.
# Entry point
# ';' is a statement separator injected by the preprocessor to disambiguate
# array literals on new lines from index suffix operations (e.g. expr\n[1,2,3]).
# Users should not write ';' directly — the preprocessor rejects it.
Program = { Statement | ';' } .
State 0
Accept
on ';'
shift and goto state 1
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Statement and goto state 1
State 1
Accept
on ';'
shift and goto state 1
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Statement and goto state 1
Program is used internally from Parse.
func (*Parser) RequireStmt ¶
RequireStmt grammar:
RequireStmt = "require" str_lit [ "as" ( str_lit | ident ) | "with" ident { ',' ident } ] .
State 0
on "require"
shift and goto state 1
State 1
on str_lit
shift and goto state 2
State 2
Accept
on "as"
shift and goto state 3
on "with"
shift and goto state 5
State 3
on ident, str_lit
shift and goto state 4
State 4
Accept
State 5
on ident
shift and goto state 6
State 6
Accept
on ','
shift and goto state 5
RequireStmt is used internally from Parse.
func (*Parser) ReturnStmt ¶
ReturnStmt grammar:
ReturnStmt = "return" [ Expr ] .
State 0
on "return"
shift and goto state 1
State 1
Accept
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 2
State 2
Accept
ReturnStmt is used internally from Parse.
func (*Parser) SandboxList ¶ added in v0.18.0
SandboxList grammar:
SandboxList = '[' ( str_lit | integer ) { ',' ( str_lit | integer ) } ']' .
State 0
on '['
shift and goto state 1
State 1
on integer, str_lit
shift and goto state 2
State 2
on ','
shift and goto state 1
on ']'
shift and goto state 3
State 3
Accept
SandboxList is used internally from Parse.
func (*Parser) SandboxPerm ¶ added in v0.18.0
SandboxPerm grammar:
SandboxPerm = ident ':' ( str_lit | integer | SandboxList ) . State 0 on ident shift and goto state 1 State 1 on ':' shift and goto state 2 State 2 on integer, str_lit shift and goto state 3 on '[' call SandboxList and goto state 3 State 3 Accept
SandboxPerm is used internally from Parse.
func (*Parser) SandboxStmt ¶ added in v0.18.0
SandboxStmt grammar:
SandboxStmt = "sandbox" [ SandboxPerm { ',' SandboxPerm } ] .
State 0
on "sandbox"
shift and goto state 1
State 1
Accept
on ident
call SandboxPerm and goto state 2
State 2
Accept
on ','
shift and goto state 3
State 3
on ident
call SandboxPerm and goto state 2
SandboxStmt is used internally from Parse.
func (*Parser) SpawnExpr ¶
SpawnExpr grammar:
SpawnExpr = "spawn" Body "end" .
State 0
on "spawn"
shift and goto state 1
State 1
on "end"
shift and goto state 2
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 3
State 2
Accept
State 3
on "end"
shift and goto state 2
SpawnExpr is used internally from Parse.
func (*Parser) Statement ¶
Statement grammar:
# Statements
Statement = UseStmt
| ImportStmt
| RequireStmt
| SandboxStmt
| FuncDef
| TestDef
| BenchDef
| IfStmt
| WhileStmt
| ForStmt
| BreakStmt
| NextStmt
| ReturnStmt
| AssignOrExpr .
State 0
on "use"
call UseStmt and goto state 1
on "import"
call ImportStmt and goto state 1
on "require"
call RequireStmt and goto state 1
on "sandbox"
call SandboxStmt and goto state 1
on "def"
call FuncDef and goto state 1
on "rats"
call TestDef and goto state 1
on "bench"
call BenchDef and goto state 1
on "if"
call IfStmt and goto state 1
on "while"
call WhileStmt and goto state 1
on "for"
call ForStmt and goto state 1
on "break"
call BreakStmt and goto state 1
on "next"
call NextStmt and goto state 1
on "return"
call ReturnStmt and goto state 1
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call AssignOrExpr and goto state 1
State 1
Accept
Statement is used internally from Parse.
func (*Parser) Suffix ¶
Suffix grammar:
Suffix = '(' [ ArgList ] ')' | '[' Expr [ ',' Expr ] ']' | '.' ident .
State 0
on '('
shift and goto state 1
on '.'
shift and goto state 4
on '['
shift and goto state 5
State 1
on ')'
shift and goto state 2
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call ArgList and goto state 3
State 2
Accept
State 3
on ')'
shift and goto state 2
State 4
on ident
shift and goto state 2
State 5
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 6
State 6
on ']'
shift and goto state 2
on ','
shift and goto state 7
State 7
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 8
State 8
on ']'
shift and goto state 2
Suffix is used internally from Parse.
func (*Parser) TestDef ¶
TestDef grammar:
TestDef = "rats" str_lit Body "end" .
State 0
on "rats"
shift and goto state 1
State 1
on str_lit
shift and goto state 2
State 2
on "end"
shift and goto state 3
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 4
State 3
Accept
State 4
on "end"
shift and goto state 3
TestDef is used internally from Parse.
func (*Parser) TryExpr ¶
TryExpr grammar:
TryExpr = "try" Expr "or" ident Body "end" .
State 0
on "try"
shift and goto state 1
State 1
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 2
State 2
on "or"
shift and goto state 3
State 3
on ident
shift and goto state 4
State 4
on "end"
shift and goto state 5
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 6
State 5
Accept
State 6
on "end"
shift and goto state 5
TryExpr is used internally from Parse.
func (*Parser) UnaryExpr ¶
UnaryExpr grammar:
UnaryExpr = '!' Postfix | '-' Postfix | Postfix .
State 0
on '!', '-'
shift and goto state 1
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '(', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Postfix and goto state 2
State 1
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '(', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Postfix and goto state 2
State 2
Accept
UnaryExpr is used internally from Parse.
func (*Parser) UseStmt ¶
UseStmt grammar:
UseStmt = "use" str_lit . State 0 on "use" shift and goto state 1 State 1 on str_lit shift and goto state 2 State 2 Accept
UseStmt is used internally from Parse.
func (*Parser) WhileStmt ¶
WhileStmt grammar:
WhileStmt = "while" Expr Body "end" .
State 0
on "while"
shift and goto state 1
State 1
on "case", "false", "fn", "nil", "parallel", "spawn", "true", "try", '!', '(', '-', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, CaseExpr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Expr and goto state 2
State 2
on "end"
shift and goto state 3
on "bench", "break", "case", "def", "false", "fn", "for", "if", "import", "next", "nil", "parallel", "rats", "require", "return", "sandbox", "spawn", "true", "try", "use", "while", '!', '(', '-', ';', '[', '{', float_lit, ident, integer, raw_str_lit, str_lit, Statement, UseStmt, ImportStmt, RequireStmt, SandboxStmt, FuncDef, TestDef, BenchDef, IfStmt, CaseExpr, WhileStmt, ForStmt, BreakStmt, NextStmt, ReturnStmt, AssignOrExpr, Expr, OrExpr, AndExpr, CompExpr, AddExpr, MulExpr, UnaryExpr, Postfix, Primary, TryExpr, SpawnExpr, ParallelExpr, FnExpr, ArrayLit, HashLit
call Body and goto state 4
State 3
Accept
State 4
on "end"
shift and goto state 3
WhileStmt is used internally from Parse.