diff options
| author | Li Jin <dragon-fly@qq.com> | 2023-06-25 17:46:32 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2023-06-25 17:46:32 +0800 |
| commit | cd618f934b0e4a30bd6cd4e98f8c1005bf3d6193 (patch) | |
| tree | 5bc8bc55f80fe74a3b73101b55eabc60ae1d75c3 /spec/inputs | |
| parent | 5d246757285a437401347dd6a1a1f8d3cf61e08c (diff) | |
| download | yuescript-cd618f934b0e4a30bd6cd4e98f8c1005bf3d6193.tar.gz yuescript-cd618f934b0e4a30bd6cd4e98f8c1005bf3d6193.tar.bz2 yuescript-cd618f934b0e4a30bd6cd4e98f8c1005bf3d6193.zip | |
fix more ambiguous Lua codes generation cases.
Diffstat (limited to 'spec/inputs')
| -rw-r--r-- | spec/inputs/ambiguous.yue | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/inputs/ambiguous.yue b/spec/inputs/ambiguous.yue index 3ae0bfc..37857fe 100644 --- a/spec/inputs/ambiguous.yue +++ b/spec/inputs/ambiguous.yue | |||
| @@ -23,6 +23,27 @@ for i = 1, 10 | |||
| 23 | goto abc | 23 | goto abc |
| 24 | (print) 5 | 24 | (print) 5 |
| 25 | 25 | ||
| 26 | macro lua = (code)-> { | ||
| 27 | :code | ||
| 28 | type: "lua" | ||
| 29 | } | ||
| 30 | |||
| 31 | do | ||
| 32 | print() | ||
| 33 | 1 |> b |> (a) | ||
| 34 | print() | ||
| 35 | <- (fn) | ||
| 36 | |||
| 37 | do | ||
| 38 | print() | ||
| 39 | () <- async_fn() | ||
| 40 | print() | ||
| 41 | $lua[==[ | ||
| 42 | --[[a comment to insert]] | ||
| 43 | (haha)() | ||
| 44 | ]==] | ||
| 45 | nil | ||
| 46 | |||
| 26 | macro v = -> 'print 123' | 47 | macro v = -> 'print 123' |
| 27 | do | 48 | do |
| 28 | global * | 49 | global * |
