1 | echo $'one\ntwo'
|
2 |
|
3 | # This ignores whitespace. Gah.
|
4 |
|
5 | #var x = {a: 1}
|
6 |
|
7 | #setvar x += 1
|
8 |
|
9 | var a Int = 1 + 2*3
|
10 | echo a=$a
|
11 |
|
12 | var b Float = 5 / 6
|
13 | echo b=$b
|
14 |
|
15 | echo hi
|
16 |
|
17 | setvar a = b; echo hi
|
18 | # not allowed -- has to be Semi or Newline.
|
19 | #setvar x = 4 && echo hi
|
20 | setvar x = 4
|
21 |
|
22 | setvar d = 1 # comment
|
23 |
|
24 | var y =a
|
25 | var z=b
|
26 |
|
27 | echo hi
|
28 |
|
29 | # Doesn't work yet
|
30 | #var myregex = $/ any [c h] /
|
31 | #var myarray = %[ foo bar *.[c h] ]
|
32 |
|
33 | var mycmd = $(echo cmd) + "$(echo cmd)"
|
34 | echo mycmd=$mycmd
|
35 |
|
36 | var mybrace = ${b} + "${b}"
|
37 | echo mybrace=$mybrace
|
38 |
|
39 | # parenthesized
|
40 | var paren = (1 + 2) * 3
|
41 | echo paren=$paren
|
42 |
|
43 | # line continuation
|
44 | var line_cont = 4 + \
|
45 | 5
|
46 | echo line_cont=$line_cont
|
47 |
|
48 | # another way of writing multiline expressions
|
49 | var multiline = ( 6 +
|
50 | 7)
|
51 | echo multiline=$multiline
|
52 |
|
53 | # Augmented assignment
|
54 | var aug = 8
|
55 | setvar aug += 9
|
56 | echo aug=$aug
|
57 | #setvar aug -= 2
|
58 |
|
59 | #var a[i] = c
|
60 |
|
61 | # We don't have a type that supports this?
|
62 | #setvar a[i, j] = 1
|
63 |
|
64 | # TODO:
|
65 | # - comments
|
66 | # - multiline
|
67 |
|