diff options
| author | Li Jin <dragon-fly@qq.com> | 2020-01-25 17:48:03 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2020-01-25 17:48:03 +0800 |
| commit | ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8 (patch) | |
| tree | 427e365939da39f31dbfa755675fb60bb141583d /spec/inputs/funcs.moon | |
| parent | 4827d200604a086e2ad94edb4257c3abc7a3c4fc (diff) | |
| download | yuescript-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.moon | 104 |
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 | |||
| 11 | open -> the -> door | 11 | open -> the -> door |
| 12 | 12 | ||
| 13 | open -> | 13 | open -> |
| 14 | the door | 14 | the door |
| 15 | hello = -> | 15 | hello = -> |
| 16 | my func | 16 | my func |
| 17 | 17 | ||
| 18 | h = -> hi | 18 | h = -> 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 | ||
| 46 | something = (hello=100, world=(x=[[yeah cool]])-> print "eat rice") -> | 46 | something = (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 | ||
| 64 | d( | 64 | d( |
| 65 | -> | 65 | -> |
| 66 | print "hello world" | 66 | print "hello world" |
| 67 | 10 | 67 | 10 |
| 68 | ) | 68 | ) |
| 69 | 69 | ||
| 70 | 70 | ||
| 71 | 71 | ||
| 72 | d( | 72 | d( |
| 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 | ||
| 86 | f( | 86 | f( |
| 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 | ||
| 98 | x = (a, | 98 | x = (a, |
| 99 | b) -> | 99 | b) -> |
| 100 | print "what" | 100 | print "what" |
| 101 | 101 | ||
| 102 | 102 | ||
| 103 | y = (a="hi", | 103 | y = (a="hi", |
| 104 | b=23) -> | 104 | b=23) -> |
| 105 | print "what" | 105 | print "what" |
| 106 | 106 | ||
| 107 | z = ( | 107 | z = ( |
| 108 | a="hi", | 108 | a="hi", |
| 109 | b=23) -> | 109 | b=23) -> |
| 110 | print "what" | 110 | print "what" |
| 111 | 111 | ||
| 112 | 112 | ||
| 113 | j = (f,g,m, | 113 | j = (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 | ||
| 120 | y = (a="hi", | 120 | y = (a="hi", |
| 121 | b=23, | 121 | b=23, |
| 122 | ...) -> | 122 | ...) -> |
| 123 | print "what" | 123 | print "what" |
| 124 | 124 | ||
| 125 | 125 | ||
| 126 | y = (a="hi", | 126 | y = (a="hi", |
| 127 | b=23, | 127 | b=23, |
| 128 | ... | 128 | ... |
| 129 | ) -> | 129 | ) -> |
| 130 | print "what" | 130 | print "what" |
| 131 | 131 | ||
| 132 | -- | 132 | -- |
| 133 | 133 | ||
| 134 | args = (a | 134 | args = (a |
| 135 | b) -> | 135 | b) -> |
| 136 | print "what" | 136 | print "what" |
| 137 | 137 | ||
| 138 | 138 | ||
| 139 | args = (a="hi" | 139 | args = (a="hi" |
| 140 | b=23) -> | 140 | b=23) -> |
| 141 | print "what" | 141 | print "what" |
| 142 | 142 | ||
| 143 | args = ( | 143 | args = ( |
| 144 | a="hi" | 144 | a="hi" |
| 145 | b=23) -> | 145 | b=23) -> |
| 146 | print "what" | 146 | print "what" |
| 147 | 147 | ||
| 148 | 148 | ||
| 149 | args = (f,g,m | 149 | args = (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 | ||
| 160 | nil | 160 | nil |
