diff options
| author | Li Jin <dragon-fly@qq.com> | 2020-02-03 11:25:11 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2020-02-03 11:25:11 +0800 |
| commit | d8901102a1e39e651b08b66257c176b5803b9bc0 (patch) | |
| tree | 8df65bfdcae6a65e5f6d0189b0745df521ca1bf9 /spec/inputs | |
| parent | 6eb2c2a58f36196d162433b5412b15aea1e6ba9e (diff) | |
| download | yuescript-d8901102a1e39e651b08b66257c176b5803b9bc0.tar.gz yuescript-d8901102a1e39e651b08b66257c176b5803b9bc0.tar.bz2 yuescript-d8901102a1e39e651b08b66257c176b5803b9bc0.zip | |
enable explist to be multi-line without backslash. confirmed there is no similar issue like Moonscript issue 202 or issue 391.
Diffstat (limited to 'spec/inputs')
| -rw-r--r-- | spec/inputs/assign.moon | 3 | ||||
| -rw-r--r-- | spec/inputs/destructure.moon | 9 | ||||
| -rw-r--r-- | spec/inputs/syntax.moon | 9 |
3 files changed, 17 insertions, 4 deletions
diff --git a/spec/inputs/assign.moon b/spec/inputs/assign.moon index 4e50147..e8fcbfd 100644 --- a/spec/inputs/assign.moon +++ b/spec/inputs/assign.moon | |||
| @@ -26,5 +26,4 @@ else | |||
| 26 | print "the other" | 26 | print "the other" |
| 27 | "nothing", "yeah" | 27 | "nothing", "yeah" |
| 28 | 28 | ||
| 29 | 29 | c, d = 1, 2 if true | |
| 30 | |||
diff --git a/spec/inputs/destructure.moon b/spec/inputs/destructure.moon index e0f2198..d61b6ae 100644 --- a/spec/inputs/destructure.moon +++ b/spec/inputs/destructure.moon | |||
| @@ -103,3 +103,12 @@ do | |||
| 103 | 103 | ||
| 104 | do | 104 | do |
| 105 | {if:{a,b,c}} = thing | 105 | {if:{a,b,c}} = thing |
| 106 | |||
| 107 | do | ||
| 108 | {:a, :b} = {a: "Hello", b: "World"} if true | ||
| 109 | |||
| 110 | {days, hours, mins, secs} = [tonumber a for a in *{ | ||
| 111 | string.match "1 2 3 4", "(.+)%s(.+)%s(.+)%s(.+)" | ||
| 112 | }] | ||
| 113 | |||
| 114 | {:one, :two, :three} = {w,true for w in foo\gmatch("%S+")} | ||
diff --git a/spec/inputs/syntax.moon b/spec/inputs/syntax.moon index abee3e3..ae3fc0c 100644 --- a/spec/inputs/syntax.moon +++ b/spec/inputs/syntax.moon | |||
| @@ -281,10 +281,15 @@ It's OK. | |||
| 281 | func --[[port]] 3000, --[[ip]] "192.168.1.1" | 281 | func --[[port]] 3000, --[[ip]] "192.168.1.1" |
| 282 | 282 | ||
| 283 | f = -> | 283 | f = -> |
| 284 | a,b, \ | 284 | a,b, |
| 285 | c,d, \ | 285 | c,d, |
| 286 | e,f | 286 | e,f |
| 287 | 287 | ||
| 288 | f = -> | ||
| 289 | a,b \ | ||
| 290 | ,c,d \ | ||
| 291 | ,e,f | ||
| 292 | |||
| 288 | with obj | 293 | with obj |
| 289 | invoke \ | 294 | invoke \ |
| 290 | --[[arg1]] \func!, | 295 | --[[arg1]] \func!, |
