aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/funcs.mp
diff options
context:
space:
mode:
Diffstat (limited to 'spec/inputs/funcs.mp')
-rw-r--r--spec/inputs/funcs.mp160
1 files changed, 160 insertions, 0 deletions
diff --git a/spec/inputs/funcs.mp b/spec/inputs/funcs.mp
new file mode 100644
index 0000000..4176e33
--- /dev/null
+++ b/spec/inputs/funcs.mp
@@ -0,0 +1,160 @@
1
2
3x = -> print what
4
5_ = ->
6
7_ = -> -> ->
8
9go to the barn
10
11open -> the -> door
12
13open ->
14 the door
15 hello = ->
16 my func
17
18h = -> hi
19
20eat ->, world
21
22
23(->)()
24
25x = (...) ->
26
27hello!
28hello.world!
29
30_ = hello!.something
31_ = what!["ofefe"]
32
33what! the! heck!
34
35_ = (a,b,c,d,e) ->
36
37_ = (a,a,a,a,a) ->
38 print a
39
40_ = (x=23023) ->
41
42_ = (x=(y=()->) ->) ->
43
44_ = (x = if something then yeah else no) ->
45
46something = (hello=100, world=(x=[[yeah cool]])-> print "eat rice") ->
47 print hello
48
49_ = (x, y) =>
50_ = (@x, @y) =>
51_ = (x=1) =>
52_ = (@x=1,y,@z="hello world") =>
53
54
55x -> return
56y -> return 1
57z -> return 1, "hello", "world"
58k -> if yes then return else return
59
60_ = -> real_name if something
61
62--
63
64d(
65 ->
66 print "hello world"
67 10
68)
69
70
71
72d(
73 1,2,3
74 4
75 5
76 6
77
78 if something
79 print "okay"
80 10
81
82 10,20
83)
84
85
86f(
87
88 )(
89
90 )(
91 what
92 )(->
93 print "srue"
94 123)
95
96--
97
98x = (a,
99 b) ->
100 print "what"
101
102
103y = (a="hi",
104 b=23) ->
105 print "what"
106
107z = (
108 a="hi",
109 b=23) ->
110 print "what"
111
112
113j = (f,g,m,
114 a="hi",
115 b=23
116) ->
117 print "what"
118
119
120y = (a="hi",
121 b=23,
122 ...) ->
123 print "what"
124
125
126y = (a="hi",
127 b=23,
128 ...
129) ->
130 print "what"
131
132--
133
134args = (a
135 b) ->
136 print "what"
137
138
139args = (a="hi"
140 b=23) ->
141 print "what"
142
143args = (
144 a="hi"
145 b=23) ->
146 print "what"
147
148
149args = (f,g,m
150 a="hi"
151 b=23
152) ->
153 print "what"
154
155
156@ = (n)->
157 return 1 if n == 0
158 n * @(n-1)
159
160nil