diff options
| author | Li Jin <dragon-fly@qq.com> | 2020-05-02 14:41:40 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2020-05-02 14:41:40 +0800 |
| commit | 6402a8896c78440aee03cc4b7bb315fc236e6ff8 (patch) | |
| tree | a5c23153a2285ae4ae79d9b1ff5b64f39f7c379f /spec/inputs | |
| parent | 5eac89411f056e4e6ad56c9a41944a341780d68b (diff) | |
| download | yuescript-6402a8896c78440aee03cc4b7bb315fc236e6ff8.tar.gz yuescript-6402a8896c78440aee03cc4b7bb315fc236e6ff8.tar.bz2 yuescript-6402a8896c78440aee03cc4b7bb315fc236e6ff8.zip | |
fix Moonscript issue 416: ambiguous Lua output in some cases.
Diffstat (limited to 'spec/inputs')
| -rw-r--r-- | spec/inputs/ambiguous.moon | 26 |
1 files changed, 26 insertions, 0 deletions
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 @@ | |||
| 1 | import bind from grasp | ||
| 2 | (bind stmt) color: "Red" | ||
| 3 | |||
| 4 | a = 'b' | ||
| 5 | c = d | ||
| 6 | (a b) c d | ||
| 7 | import c from d | ||
| 8 | (a b) c d | ||
| 9 | (c d) a b | ||
| 10 | a, b = c, d | ||
| 11 | (d a) c | ||
| 12 | |||
| 13 | macro block f = (func,arg)-> "(#{func}) #{arg}" | ||
| 14 | for i = 1, 10 | ||
| 15 | a = -> | ||
| 16 | $f print, 1 | ||
| 17 | a = f | ||
| 18 | $f print, 2 | ||
| 19 | if cond | ||
| 20 | $f print, 3 | ||
| 21 | ::abc:: | ||
| 22 | (print) 4 | ||
| 23 | goto abc | ||
| 24 | (print) 5 | ||
| 25 | nil | ||
| 26 | |||
