aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/inputs/backcall.moon8
-rw-r--r--spec/inputs/syntax.moon41
2 files changed, 26 insertions, 23 deletions
diff --git a/spec/inputs/backcall.moon b/spec/inputs/backcall.moon
index 86b0ba3..a648b16 100644
--- a/spec/inputs/backcall.moon
+++ b/spec/inputs/backcall.moon
@@ -1,10 +1,10 @@
1 1
2{"abc", 123, 998} |> foreach print 2{"abc", 123, 998} |> foreach print
3 3
4{1,2,3} \ 4{1,2,3}
5 |> map((x)-> x * 2) \ 5 |> map((x)-> x * 2)
6 |> filter((x)-> x > 4) \ 6 |> filter((x)-> x > 4)
7 |> reduce(0, (a,b)-> a + b) \ 7 |> reduce(0, (a,b)-> a + b)
8 |> print 8 |> print
9 9
10[i |> tostring for i = 0,10] |> table.concat(",") |> print 10[i |> tostring for i = 0,10] |> table.concat(",") |> print
diff --git a/spec/inputs/syntax.moon b/spec/inputs/syntax.moon
index ccee5f2..a781aa3 100644
--- a/spec/inputs/syntax.moon
+++ b/spec/inputs/syntax.moon
@@ -284,8 +284,8 @@ z = a- b
284str = --[[ 284str = --[[
285This is a multi line comment. 285This is a multi line comment.
286It's OK. 286It's OK.
287]] strA \ -- comment 1 287]] strA -- comment 1
288 .. strB \ -- comment 2 288 .. strB -- comment 2
289 .. strC 289 .. strC
290 290
291func --[[port]] 3000, --[[ip]] "192.168.1.1" 291func --[[port]] 3000, --[[ip]] "192.168.1.1"
@@ -296,51 +296,54 @@ f = ->
296 e,f 296 e,f
297 297
298f = -> 298f = ->
299 a,b \ 299 a,b
300 ,c,d \ 300 ,c,d
301 ,e,f 301 ,e,f
302 302
303with obj 303with obj
304 invoke \ 304 invoke(
305 --[[arg1]] \func!, 305 --[[arg1]] \func!,
306 --[[arg2]] 123, 306 --[[arg2]] 123,
307 --[[arg3]] "abc" 307 --[[arg3]] "abc"
308 )
308 309
309invokeA \ 310invokeA(
310 invokeB \ 311 invokeB(
311 invokeC 123 312 invokeC 123
313 )
314)
312 315
313123 \ 316123
314 |> invokeC \ 317 |> invokeC
315 |> invokeB \ 318 |> invokeB
316 |> invokeA 319 |> invokeA
317 320
318v = { 321v = {
319 a -1 322 a -1
320 a\ 323 a(
321-1 324-1)
322 a\ 325 a
323- 1 326- 1
324 a-1 327 a-1
325 a - 1 328 a - 1
326 a - 329 a -
3271 3301
328 a -\ 331 a-
3291 3321
330 a - --[[123]]1 333 a - --[[123]]1
331 334
332 a ~1 335 a ~1
333 a\ 336 a(
334~1 337~1)
335 a\ 338 a
336~ 1 339~ 1
337 a~1 340 a~1
338 a ~ 1 341 a ~ 1
339 a ~ 342 a ~
3401 3431
341 a ~\ 344 a~
3421 3451
343 a ~--[[123]]1 346 a ~ --[[123]]1
344} 347}
345 348
346nil 349nil