| /** |
| * John Rose Example test cases. |
| */ |
| class Nifty { |
| def stuff() { |
| ([a,b,c] = n) |
| System.'in'.read |
| println """hello, world!""" |
| def l = [foo, bar, *baz, ] |
| l.forEach{println it} |
| while (def String it = asa) { println it } |
| with (html) { head{}; body{ *"hello" } } |
| //foo() bar() //@fail:parse |
| for (i in 0--a.length) println a[i] |
| } |
| //interface def {}; |
| |
| def foo(x) { 1+x } |
| def bar() { |
| def int v = 0 |
| def x = (1 |
| +2); def y = 3 |
| def |
| z = |
| y + |
| x |
| } |
| def cat = {x,y| "$x$y"} |
| def fun() { |
| def id1 = {it} |
| def id2 = {x|x} |
| def id3 = {{id1}} |
| } |
| |
| } |