diff --git a/moonscript/parse.lua b/moonscript/parse.lua index b6f7d7c..47b09dd 100644 --- a/moonscript/parse.lua +++ b/moonscript/parse.lua @@ -306,7 +306,7 @@ local build_grammar = wrap(function() Callable = Name + Parens / mark"parens", Parens = sym"(" * Exp * sym")", - FnArgs = symx"(" * Ct(ExpList^-1) * sym")", + FnArgs = symx"(" * Ct(ExpList^-1) * sym")" + sym"!" * -P"=" * Ct"", -- chain that starts with colon expression (for precedence over table literal) ColonChain = diff --git a/tests/inputs/syntax.moon b/tests/inputs/syntax.moon index d99cfc0..0c4cdc6 100644 --- a/tests/inputs/syntax.moon +++ b/tests/inputs/syntax.moon @@ -167,4 +167,14 @@ what whack - 5 x = hello - world - something +hello! +hello.world! + +hello!.something +what!["ofefe"] + +what! the! heck! + + + diff --git a/tests/outputs/syntax.lua b/tests/outputs/syntax.lua index 23e472d..af8a14a 100644 --- a/tests/outputs/syntax.lua +++ b/tests/outputs/syntax.lua @@ -123,4 +123,9 @@ _ = 5 + what(wack) what(whack + 5) _ = 5 - what(wack) what(whack - 5) -x = hello - world - something \ No newline at end of file +x = hello - world - something +hello() +hello.world() +_ = hello().something +_ = what()["ofefe"] +what()(the()(heck())) \ No newline at end of file