mirror of
https://github.com/leafo/moonscript.git
synced 2025-01-09 00:04:22 +00:00
don't treat assignment/update as expression (#26)
This commit is contained in:
parent
1bedf81ca8
commit
3a2b92e5d3
@ -279,7 +279,7 @@ local build_grammar = wrap_env(function()
|
|||||||
Line = (CheckIndent * Statement + Space * #Stop),
|
Line = (CheckIndent * Statement + Space * #Stop),
|
||||||
|
|
||||||
Statement = (Import + While + With + For + ForEach + Switch + Return
|
Statement = (Import + While + With + For + ForEach + Switch + Return
|
||||||
+ ClassDecl + Export + BreakLoop + Ct(ExpList) / flatten_or_mark"explist" * Space) * ((
|
+ ClassDecl + Export + BreakLoop + Assign + Update + Ct(ExpList) / flatten_or_mark"explist" * Space) * ((
|
||||||
-- statement decorators
|
-- statement decorators
|
||||||
key"if" * Exp * (key"else" * Exp)^-1 * Space / mark"if" +
|
key"if" * Exp * (key"else" * Exp)^-1 * Space / mark"if" +
|
||||||
CompInner / mark"comprehension"
|
CompInner / mark"comprehension"
|
||||||
@ -356,7 +356,7 @@ local build_grammar = wrap_env(function()
|
|||||||
TblComprehension +
|
TblComprehension +
|
||||||
TableLit +
|
TableLit +
|
||||||
Comprehension +
|
Comprehension +
|
||||||
Assign + Update + FunLit + String +
|
FunLit + String +
|
||||||
Num,
|
Num,
|
||||||
|
|
||||||
ChainValue = -- a function call or an object access
|
ChainValue = -- a function call or an object access
|
||||||
|
Loading…
Reference in New Issue
Block a user