diff options
author | Li Jin <dragon-fly@qq.com> | 2023-12-11 09:40:29 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-12-11 09:40:29 +0800 |
commit | a6dc9009035113858acac32cd083983c42bc9de6 (patch) | |
tree | eeaeac744046a3e07c0ff0d6bb6f6ffc79374f36 /spec | |
parent | 514b9f97febe8920a78d6078b092fe84b859a963 (diff) | |
download | yuescript-a6dc9009035113858acac32cd083983c42bc9de6.tar.gz yuescript-a6dc9009035113858acac32cd083983c42bc9de6.tar.bz2 yuescript-a6dc9009035113858acac32cd083983c42bc9de6.zip |
fix empty block ends with eof issue.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/inputs/syntax.yue | 18 | ||||
-rw-r--r-- | spec/outputs/syntax.lua | 16 |
2 files changed, 34 insertions, 0 deletions
diff --git a/spec/inputs/syntax.yue b/spec/inputs/syntax.yue index d60a145..271f43f 100644 --- a/spec/inputs/syntax.yue +++ b/spec/inputs/syntax.yue | |||
@@ -460,5 +460,23 @@ do | |||
460 | ) | 460 | ) |
461 | f ! | 461 | f ! |
462 | 462 | ||
463 | do | ||
464 | if cond | ||
465 | -- | ||
466 | else | ||
467 | -- | ||
468 | |||
469 | switch cond | ||
470 | when 1 | ||
471 | -- | ||
472 | when 2 | ||
473 | -- | ||
474 | else | ||
475 | -- | ||
476 | |||
477 | f1 = -> -- | ||
478 | f2 = -> | ||
479 | -- | ||
480 | |||
463 | nil | 481 | nil |
464 | 482 | ||
diff --git a/spec/outputs/syntax.lua b/spec/outputs/syntax.lua index 2afadbb..20b8469 100644 --- a/spec/outputs/syntax.lua +++ b/spec/outputs/syntax.lua | |||
@@ -412,4 +412,20 @@ do | |||
412 | f(a, b) | 412 | f(a, b) |
413 | f() | 413 | f() |
414 | end | 414 | end |
415 | do | ||
416 | if cond then | ||
417 | else | ||
418 | end | ||
419 | do | ||
420 | local _exp_0 = cond | ||
421 | if 1 == _exp_0 then | ||
422 | elseif 2 == _exp_0 then | ||
423 | else | ||
424 | end | ||
425 | end | ||
426 | local f1 | ||
427 | f1 = function() end | ||
428 | local f2 | ||
429 | f2 = function() end | ||
430 | end | ||
415 | return nil | 431 | return nil |