2011-08-13 02:51:50 +00:00
|
|
|
#!/this/is/ignored
|
2011-05-21 22:26:46 +00:00
|
|
|
|
|
|
|
a = 1 + 2* 3 / 6
|
|
|
|
|
|
|
|
a, bunch, go, here = another, world
|
|
|
|
|
|
|
|
func arg1, arg2, another, arg3
|
|
|
|
|
|
|
|
here, we = () ->, yeah
|
2011-05-30 05:38:47 +00:00
|
|
|
the, different = () -> approach; yeah
|
2011-05-21 22:26:46 +00:00
|
|
|
|
|
|
|
dad()
|
|
|
|
dad(lord)
|
|
|
|
hello(one,two)()
|
|
|
|
(5 + 5)(world)
|
|
|
|
|
|
|
|
fun(a)(b)
|
|
|
|
|
|
|
|
fun(a) b
|
|
|
|
|
|
|
|
fun(a) b, bad hello
|
|
|
|
|
|
|
|
hello world what are you doing here
|
|
|
|
|
|
|
|
|
|
|
|
what(the)[3243] world, yeck heck
|
|
|
|
|
|
|
|
hairy[hands][are](gross) okay okay[world]
|
|
|
|
|
|
|
|
(get[something] + 5)[years]
|
|
|
|
|
2011-05-22 19:19:13 +00:00
|
|
|
i,x = 200, 300
|
|
|
|
|
|
|
|
yeah = (1 + 5) * 3
|
|
|
|
yeah = ((1+5)*3)/2
|
|
|
|
yeah = ((1+5)*3)/2 + i % 100
|
|
|
|
|
|
|
|
whoa = (1+2) * (3+4) * (4+5)
|
|
|
|
|
2011-07-16 19:35:43 +00:00
|
|
|
->
|
|
|
|
if something
|
|
|
|
return 1,2,4
|
|
|
|
|
|
|
|
print "hello"
|
|
|
|
|
|
|
|
->
|
|
|
|
if hello
|
|
|
|
"heloo", "world"
|
|
|
|
else
|
|
|
|
no, way
|
|
|
|
|
|
|
|
|
|
|
|
-> 1,2,34
|
|
|
|
|
2011-05-22 19:19:13 +00:00
|
|
|
return 5 + () -> 4 + 2
|
|
|
|
|
|
|
|
return 5 + (() -> 4) + 2
|
|
|
|
|
|
|
|
print 5 + () ->
|
|
|
|
34
|
|
|
|
good nads
|
|
|
|
|
|
|
|
|
2011-05-23 02:28:25 +00:00
|
|
|
something 'else', "ya"
|
|
|
|
|
|
|
|
something'else'
|
|
|
|
something"else"
|
|
|
|
|
|
|
|
here(we)"go"[12123]
|
|
|
|
|
2011-05-24 06:58:10 +00:00
|
|
|
-- this runs
|
|
|
|
something =
|
|
|
|
test: 12323
|
|
|
|
what: -> print "hello world"
|
|
|
|
|
|
|
|
print something.test
|
|
|
|
|
|
|
|
frick = hello: "world"
|
|
|
|
|
|
|
|
argon =
|
|
|
|
num: 100
|
|
|
|
world: (self) ->
|
|
|
|
print self.num
|
|
|
|
return {
|
|
|
|
something: -> print "hi from something"
|
|
|
|
}
|
|
|
|
somethin: (self, str) ->
|
|
|
|
print "string is", str
|
|
|
|
return world: (a,b) -> print "sum", a + b
|
|
|
|
|
|
|
|
something.what()
|
2011-06-23 06:45:03 +00:00
|
|
|
argon\world().something()
|
2011-05-24 06:58:10 +00:00
|
|
|
|
2011-06-23 06:45:03 +00:00
|
|
|
argon\somethin"200".world(1,2)
|
2011-05-24 06:58:10 +00:00
|
|
|
|
2011-05-28 07:21:25 +00:00
|
|
|
x = -434
|
2011-05-24 06:58:10 +00:00
|
|
|
|
2011-05-28 07:21:25 +00:00
|
|
|
x = -hello world one two
|
2011-05-24 06:58:10 +00:00
|
|
|
|
2011-05-28 07:21:25 +00:00
|
|
|
hi = -"herfef"
|
2011-05-24 06:58:10 +00:00
|
|
|
|
2011-05-28 07:21:25 +00:00
|
|
|
x = -[x for x in x]
|
2011-05-24 06:58:10 +00:00
|
|
|
|
2011-05-28 07:21:25 +00:00
|
|
|
print "hello" if cool
|
2011-05-24 06:58:10 +00:00
|
|
|
|
2011-05-28 07:21:25 +00:00
|
|
|
print "nutjob"
|
|
|
|
|
|
|
|
if hello then 343
|
|
|
|
|
|
|
|
print "what" if cool else whack
|
|
|
|
|
|
|
|
arg = {...}
|
|
|
|
|
|
|
|
x = (...) ->
|
|
|
|
dump {...}
|
|
|
|
|
|
|
|
|
|
|
|
x = not true
|
|
|
|
|
|
|
|
y = not(5+5)
|
|
|
|
|
|
|
|
|
|
|
|
y = #"hello"
|
|
|
|
|
|
|
|
x = #{#{},#{1},#{1,2}}
|
2011-05-29 21:40:40 +00:00
|
|
|
|
2011-05-30 05:38:47 +00:00
|
|
|
hello, world
|
|
|
|
|
2011-06-23 06:45:03 +00:00
|
|
|
something\hello(what) a,b
|
|
|
|
something\hello what
|
|
|
|
something.hello\world a,b
|
|
|
|
something.hello\world(1,2,3) a,b
|
|
|
|
|
2011-05-29 21:40:40 +00:00
|
|
|
|
2011-06-13 15:23:09 +00:00
|
|
|
x = 1232
|
|
|
|
x += 10 + 3
|
|
|
|
j -= "hello"
|
|
|
|
y *= 2
|
|
|
|
y /= 100
|
|
|
|
m %= 2
|
2011-08-20 17:44:08 +00:00
|
|
|
hello ..= "world"
|
2011-06-13 15:23:09 +00:00
|
|
|
|
2011-06-13 15:42:46 +00:00
|
|
|
x = 0
|
|
|
|
(if ntype(v) == "fndef" then x += 1) for v in *values
|
|
|
|
|
2011-06-19 20:00:27 +00:00
|
|
|
|
|
|
|
hello =
|
|
|
|
something: world
|
|
|
|
if: "hello"
|
|
|
|
else: 3434
|
|
|
|
function: "okay"
|
|
|
|
good: 230203
|
|
|
|
|
|
|
|
|
2011-06-20 15:28:25 +00:00
|
|
|
5 + what wack
|
|
|
|
what whack + 5
|
|
|
|
|
|
|
|
5 - what wack
|
|
|
|
what whack - 5
|
|
|
|
|
|
|
|
x = hello - world - something
|
|
|
|
|
2011-07-17 00:14:57 +00:00
|
|
|
((something = with what
|
|
|
|
\cool 100) ->
|
|
|
|
print something)!
|
2011-06-21 03:35:05 +00:00
|
|
|
|
2011-07-23 02:21:12 +00:00
|
|
|
if something
|
|
|
|
03589
|
|
|
|
|
|
|
|
-- okay what about this
|
|
|
|
|
|
|
|
else
|
|
|
|
3434
|
|
|
|
|
|
|
|
|
|
|
|
if something
|
|
|
|
yeah
|
|
|
|
|
|
|
|
|
|
|
|
elseif "ymmm"
|
|
|
|
|
|
|
|
print "cool"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
okay
|
2011-06-20 15:28:25 +00:00
|
|
|
|
2011-10-01 03:20:36 +00:00
|
|
|
|
|
|
|
-- test names containing keywords
|
|
|
|
x = notsomething
|
|
|
|
y = ifsomething
|
|
|
|
z = x and b
|
|
|
|
z = x andb
|
|
|
|
|
2011-12-09 06:44:07 +00:00
|
|
|
|
|
|
|
-- undelimited tables
|
|
|
|
|
|
|
|
while 10 > something
|
|
|
|
something: "world"
|
|
|
|
print "yeah"
|
|
|
|
|
|
|
|
x =
|
|
|
|
okay: sure
|
|
|
|
|
|
|
|
yeah
|
|
|
|
okay: man
|
|
|
|
sure: sir
|
|
|
|
|
|
|
|
hello "no comma"
|
|
|
|
yeah: dada
|
|
|
|
another: world
|
|
|
|
|
|
|
|
hello "comma",
|
|
|
|
something: hello_world
|
|
|
|
frick: you
|
|
|
|
|
|
|
|
-- creates two tables
|
|
|
|
another hello, one,
|
|
|
|
two, three, four, yeah: man
|
|
|
|
okay: yeah
|
|
|
|
|
|
|
|
|
2011-11-05 01:58:01 +00:00
|
|
|
-- cooool
|