mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
syntax for tblcmp
This commit is contained in:
parent
e32f0752b8
commit
652e59c96c
@ -311,6 +311,8 @@ local build_grammar = wrap_env(function()
|
||||
|
||||
Comprehension = sym"[" * Exp * CompInner * sym"]" / mark"comprehension",
|
||||
|
||||
TblComprehension = sym"{" * Exp * (sym"," * Exp)^-1 * CompInner * sym"}" / mark"tblcomprehension",
|
||||
|
||||
CompInner = Ct(CompFor * CompClause^0),
|
||||
CompFor = key"for" * Ct(NameList) * key"in" * (sym"*" * Exp / mark"unpack" + Exp) / mark"for",
|
||||
CompClause = CompFor + key"when" * Exp / mark"when",
|
||||
@ -337,6 +339,7 @@ local build_grammar = wrap_env(function()
|
||||
sym"-" * -SomeSpace * Exp / mark"minus" +
|
||||
sym"#" * Exp / mark"length" +
|
||||
key"not" * Exp / mark"not" +
|
||||
TblComprehension +
|
||||
TableLit +
|
||||
Comprehension +
|
||||
Assign + Update + FunLit + String +
|
||||
|
Loading…
Reference in New Issue
Block a user