aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/syntax.moon
diff options
context:
space:
mode:
Diffstat (limited to 'spec/inputs/syntax.moon')
-rw-r--r--spec/inputs/syntax.moon78
1 files changed, 39 insertions, 39 deletions
diff --git a/spec/inputs/syntax.moon b/spec/inputs/syntax.moon
index 351b22c..bf0cf04 100644
--- a/spec/inputs/syntax.moon
+++ b/spec/inputs/syntax.moon
@@ -29,7 +29,7 @@ hairy[hands][are](gross) okay okay[world]
29 29
30_ = (get[something] + 5)[years] 30_ = (get[something] + 5)[years]
31 31
32i,x = 200, 300 32i,x = 200, 300
33 33
34yeah = (1 + 5) * 3 34yeah = (1 + 5) * 3
35yeah = ((1+5)*3)/2 35yeah = ((1+5)*3)/2
@@ -38,16 +38,16 @@ yeah = ((1+5)*3)/2 + i % 100
38whoa = (1+2) * (3+4) * (4+5) 38whoa = (1+2) * (3+4) * (4+5)
39 39
40_ = -> 40_ = ->
41 if something 41 if something
42 return 1,2,4 42 return 1,2,4
43 43
44 print "hello" 44 print "hello"
45 45
46_ = -> 46_ = ->
47 if hello 47 if hello
48 "heloo", "world" 48 "heloo", "world"
49 else 49 else
50 no, way 50 no, way
51 51
52 52
53_ = -> 1,2,34 53_ = -> 1,2,34
@@ -82,23 +82,23 @@ _ = here(we)"go"[12123]
82 82
83-- this runs 83-- this runs
84something = 84something =
85 test: 12323 85 test: 12323
86 what: -> print "hello world" 86 what: -> print "hello world"
87 87
88print something.test 88print something.test
89 89
90frick = hello: "world" 90frick = hello: "world"
91 91
92argon = 92argon =
93 num: 100 93 num: 100
94 world: (self) -> 94 world: (self) ->
95 print self.num 95 print self.num
96 return { 96 return {
97 something: -> print "hi from something" 97 something: -> print "hi from something"
98 } 98 }
99 somethin: (self, str) -> 99 somethin: (self, str) ->
100 print "string is", str 100 print "string is", str
101 return world: (a,b) -> print "sum", a + b 101 return world: (a,b) -> print "sum", a + b
102 102
103something.what() 103something.what()
104argon\world().something() 104argon\world().something()
@@ -127,7 +127,7 @@ print "what" if cool else whack!
127arg = {...} 127arg = {...}
128 128
129x = (...) -> 129x = (...) ->
130 dump {...} 130 dump {...}
131 131
132 132
133x = not true 133x = not true
@@ -167,11 +167,11 @@ _ = (if ntype(v) == "fndef" then x += 1) for v in *values
167 167
168 168
169hello = 169hello =
170 something: world 170 something: world
171 if: "hello" 171 if: "hello"
172 else: 3434 172 else: 3434
173 function: "okay" 173 function: "okay"
174 good: 230203 174 good: 230203
175 175
176 176
177div class: "cool" 177div class: "cool"
@@ -185,29 +185,29 @@ what whack - 5
185x = hello - world - something 185x = hello - world - something
186 186
187((something = with what 187((something = with what
188 \cool 100) -> 188 \cool 100) ->
189 print something)! 189 print something)!
190 190
191if something 191if something
192 _ = 03589 192 _ = 03589
193 193
194-- okay what about this 194-- okay what about this
195 195
196else 196else
197 _ = 3434 197 _ = 3434
198 198
199 199
200if something 200if something
201 _ = yeah 201 _ = yeah
202 202
203 203
204elseif "ymmm" 204elseif "ymmm"
205 205
206 print "cool" 206 print "cool"
207 207
208else 208else
209 209
210 _ = okay 210 _ = okay
211 211
212 212
213-- test names containing keywords 213-- test names containing keywords
@@ -220,15 +220,15 @@ z = x andb
220-- undelimited tables 220-- undelimited tables
221 221
222while 10 > something 222while 10 > something
223 something: "world" 223 something: "world"
224 print "yeah" 224 print "yeah"
225 225
226x = 226x =
227 okay: sure 227 okay: sure
228 228
229yeah 229yeah
230 okay: man 230 okay: man
231 sure: sir 231 sure: sir
232 232
233hello "no comma" 233hello "no comma"
234 yeah: dada 234 yeah: dada
@@ -240,8 +240,8 @@ hello "comma",
240 240
241-- creates two tables 241-- creates two tables
242another hello, one, 242another hello, one,
243 two, three, four, yeah: man 243 two, three, four, yeah: man
244 okay: yeah 244 okay: yeah
245 245
246-- 246--
247a += 3 - 5 247a += 3 - 5