aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/funcs.moon
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2020-01-25 17:48:03 +0800
committerLi Jin <dragon-fly@qq.com>2020-01-25 17:48:03 +0800
commited317e62eb1cf98fde4461fc90c6cb1045ebc7e8 (patch)
tree427e365939da39f31dbfa755675fb60bb141583d /spec/inputs/funcs.moon
parent4827d200604a086e2ad94edb4257c3abc7a3c4fc (diff)
downloadyuescript-ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8.tar.gz
yuescript-ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8.tar.bz2
yuescript-ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8.zip
fix Moonscript issue 375.
Diffstat (limited to 'spec/inputs/funcs.moon')
-rw-r--r--spec/inputs/funcs.moon104
1 files changed, 52 insertions, 52 deletions
diff --git a/spec/inputs/funcs.moon b/spec/inputs/funcs.moon
index da42db6..4176e33 100644
--- a/spec/inputs/funcs.moon
+++ b/spec/inputs/funcs.moon
@@ -11,9 +11,9 @@ go to the barn
11open -> the -> door 11open -> the -> door
12 12
13open -> 13open ->
14 the door 14 the door
15 hello = -> 15 hello = ->
16 my func 16 my func
17 17
18h = -> hi 18h = -> hi
19 19
@@ -35,7 +35,7 @@ what! the! heck!
35_ = (a,b,c,d,e) -> 35_ = (a,b,c,d,e) ->
36 36
37_ = (a,a,a,a,a) -> 37_ = (a,a,a,a,a) ->
38 print a 38 print a
39 39
40_ = (x=23023) -> 40_ = (x=23023) ->
41 41
@@ -44,7 +44,7 @@ _ = (x=(y=()->) ->) ->
44_ = (x = if something then yeah else no) -> 44_ = (x = if something then yeah else no) ->
45 45
46something = (hello=100, world=(x=[[yeah cool]])-> print "eat rice") -> 46something = (hello=100, world=(x=[[yeah cool]])-> print "eat rice") ->
47 print hello 47 print hello
48 48
49_ = (x, y) => 49_ = (x, y) =>
50_ = (@x, @y) => 50_ = (@x, @y) =>
@@ -62,99 +62,99 @@ _ = -> real_name if something
62-- 62--
63 63
64d( 64d(
65 -> 65 ->
66 print "hello world" 66 print "hello world"
67 10 67 10
68) 68)
69 69
70 70
71 71
72d( 72d(
73 1,2,3 73 1,2,3
74 4 74 4
75 5 75 5
76 6 76 6
77 77
78 if something 78 if something
79 print "okay" 79 print "okay"
80 10 80 10
81 81
82 10,20 82 10,20
83) 83)
84 84
85 85
86f( 86f(
87 87
88 )( 88 )(
89 89
90 )( 90 )(
91 what 91 what
92 )(-> 92 )(->
93 print "srue" 93 print "srue"
94 123) 94 123)
95 95
96-- 96--
97 97
98x = (a, 98x = (a,
99 b) -> 99 b) ->
100 print "what" 100 print "what"
101 101
102 102
103y = (a="hi", 103y = (a="hi",
104 b=23) -> 104 b=23) ->
105 print "what" 105 print "what"
106 106
107z = ( 107z = (
108 a="hi", 108 a="hi",
109 b=23) -> 109 b=23) ->
110 print "what" 110 print "what"
111 111
112 112
113j = (f,g,m, 113j = (f,g,m,
114 a="hi", 114 a="hi",
115 b=23 115 b=23
116) -> 116) ->
117 print "what" 117 print "what"
118 118
119 119
120y = (a="hi", 120y = (a="hi",
121 b=23, 121 b=23,
122 ...) -> 122 ...) ->
123 print "what" 123 print "what"
124 124
125 125
126y = (a="hi", 126y = (a="hi",
127 b=23, 127 b=23,
128 ... 128 ...
129) -> 129) ->
130 print "what" 130 print "what"
131 131
132-- 132--
133 133
134args = (a 134args = (a
135 b) -> 135 b) ->
136 print "what" 136 print "what"
137 137
138 138
139args = (a="hi" 139args = (a="hi"
140 b=23) -> 140 b=23) ->
141 print "what" 141 print "what"
142 142
143args = ( 143args = (
144 a="hi" 144 a="hi"
145 b=23) -> 145 b=23) ->
146 print "what" 146 print "what"
147 147
148 148
149args = (f,g,m 149args = (f,g,m
150 a="hi" 150 a="hi"
151 b=23 151 b=23
152) -> 152) ->
153 print "what" 153 print "what"
154 154
155 155
156@ = (n)-> 156@ = (n)->
157 return 1 if n == 0 157 return 1 if n == 0
158 n * @(n-1) 158 n * @(n-1)
159 159
160nil 160nil