From 6402a8896c78440aee03cc4b7bb315fc236e6ff8 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Sat, 2 May 2020 14:41:40 +0800 Subject: fix Moonscript issue 416: ambiguous Lua output in some cases. --- spec/inputs/ambiguous.moon | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 spec/inputs/ambiguous.moon (limited to 'spec/inputs') diff --git a/spec/inputs/ambiguous.moon b/spec/inputs/ambiguous.moon new file mode 100644 index 0000000..a5980db --- /dev/null +++ b/spec/inputs/ambiguous.moon @@ -0,0 +1,26 @@ +import bind from grasp +(bind stmt) color: "Red" + +a = 'b' +c = d +(a b) c d +import c from d +(a b) c d +(c d) a b +a, b = c, d +(d a) c + +macro block f = (func,arg)-> "(#{func}) #{arg}" +for i = 1, 10 + a = -> + $f print, 1 + a = f + $f print, 2 + if cond + $f print, 3 + ::abc:: + (print) 4 + goto abc + (print) 5 +nil + -- cgit v1.2.3-55-g6feb