diff options
author | Li Jin <dragon-fly@qq.com> | 2022-02-14 15:35:54 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-02-14 15:35:54 +0800 |
commit | ddb0b9deb720368a425d00bce0c0352469b55911 (patch) | |
tree | 8924f0a6e4d851c2f8545efba2d42c43581fd090 /spec/inputs | |
parent | 2c2cad4b4d3680bb30474b38ebed0f938e82636e (diff) | |
download | yuescript-ddb0b9deb720368a425d00bce0c0352469b55911.tar.gz yuescript-ddb0b9deb720368a425d00bce0c0352469b55911.tar.bz2 yuescript-ddb0b9deb720368a425d00bce0c0352469b55911.zip |
fixing issue #77. change table appending syntax to: tb[] = 1
Diffstat (limited to 'spec/inputs')
-rw-r--r-- | spec/inputs/syntax.yue | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/spec/inputs/syntax.yue b/spec/inputs/syntax.yue index 67d3a27..e7f0a8d 100644 --- a/spec/inputs/syntax.yue +++ b/spec/inputs/syntax.yue | |||
@@ -188,16 +188,25 @@ a.b[1].c[2 + 3] += 1 | |||
188 | with tb | 188 | with tb |
189 | .a.c += 1 | 189 | .a.c += 1 |
190 | 190 | ||
191 | tb #= 10 | 191 | tb[] = 10 |
192 | a.b.c #= 1 | 192 | a.b.c[] = 1 |
193 | x #= if v | 193 | x[] = if v |
194 | 1 | 194 | 1 |
195 | else | 195 | else |
196 | 2 | 196 | 2 |
197 | with tb | 197 | with tb |
198 | .b.c #= with vec | 198 | .b.c[] = with vec |
199 | .x = 1 | 199 | .x = 1 |
200 | .y = 2 | 200 | .y = 2 |
201 | a | ||
202 | .b.c | ||
203 | .d\f! | ||
204 | .g[] = 1 | ||
205 | |||
206 | tb = {} | ||
207 | tb[] = 1 | ||
208 | tb[] = 2 | ||
209 | tb[] = 3 | ||
201 | 210 | ||
202 | x = 0 | 211 | x = 0 |
203 | _ = (if ntype(v) == "fndef" then x += 1) for v in *values | 212 | _ = (if ntype(v) == "fndef" then x += 1) for v in *values |