diff options
| author | Li Jin <dragon-fly@qq.com> | 2020-01-10 16:30:34 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2020-01-10 16:30:34 +0800 |
| commit | 52a6536103f46c26a3ba9b149b0fe7b40d524d8c (patch) | |
| tree | 67e4759f8e1ea922079d0e162d84ecba5e558261 /spec/inputs/operators.moon | |
| parent | 975167856ed0b11c2ede03c6eb750ca4e4a6a7fc (diff) | |
| download | yuescript-52a6536103f46c26a3ba9b149b0fe7b40d524d8c.tar.gz yuescript-52a6536103f46c26a3ba9b149b0fe7b40d524d8c.tar.bz2 yuescript-52a6536103f46c26a3ba9b149b0fe7b40d524d8c.zip | |
update.
Diffstat (limited to '')
| -rw-r--r-- | spec/inputs/operators.moon | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/spec/inputs/operators.moon b/spec/inputs/operators.moon new file mode 100644 index 0000000..142ef62 --- /dev/null +++ b/spec/inputs/operators.moon | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | |||
| 2 | -- binary ops | ||
| 3 | x = 1 + 3 | ||
| 4 | |||
| 5 | y = 1 + | ||
| 6 | 3 | ||
| 7 | |||
| 8 | z = 1 + | ||
| 9 | 3 + | ||
| 10 | 4 | ||
| 11 | |||
| 12 | -- | ||
| 13 | |||
| 14 | k = b and c and | ||
| 15 | g | ||
| 16 | |||
| 17 | |||
| 18 | h = thing and | ||
| 19 | -> | ||
| 20 | print "hello world" | ||
| 21 | |||
| 22 | -- TODO: should fail, indent still set to previous line so it thinks body is | ||
| 23 | -- indented | ||
| 24 | i = thing or | ||
| 25 | -> | ||
| 26 | print "hello world" | ||
| 27 | |||
| 28 | p = thing and | ||
| 29 | -> | ||
| 30 | print "hello world" | ||
| 31 | |||
| 32 | s = thing or | ||
| 33 | -> and 234 | ||
| 34 | |||
| 35 | |||
| 36 | -- | ||
| 37 | u = { | ||
| 38 | color: 1 and 2 and | ||
| 39 | 3 | ||
| 40 | 4 | ||
| 41 | 4 | ||
| 42 | } | ||
| 43 | |||
| 44 | v = { | ||
| 45 | color: 1 and | ||
| 46 | -> | ||
| 47 | "yeah" | ||
| 48 | "great" | ||
| 49 | oksy: 3 ^ | ||
| 50 | 2 | ||
| 51 | } | ||
| 52 | |||
| 53 | -- parens | ||
| 54 | |||
| 55 | nno = ( | ||
| 56 | yeah + 2 ) | ||
| 57 | |||
| 58 | nn = ( | ||
| 59 | yeah + 2 | ||
| 60 | ) | ||
| 61 | |||
| 62 | n = hello( | ||
| 63 | b | ||
| 64 | ) -> | ||
| 65 | |||
| 66 | hello a, | ||
| 67 | ( | ||
| 68 | yeah + | ||
| 69 | 2 | ||
| 70 | ) - | ||
| 71 | okay | ||
| 72 | |||
