diff options
| author | Li Jin <dragon-fly@qq.com> | 2022-07-13 00:31:26 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2022-07-13 00:31:26 +0800 |
| commit | aa194667c7cb7bb70f2a58477555d1419ae33eb0 (patch) | |
| tree | 292178acd6346f28c241d4ad660bfa03431bec9d | |
| parent | 9beb7e00e8b030fdd7c3ecbad3f7ebe8ca14fda6 (diff) | |
| download | yuescript-aa194667c7cb7bb70f2a58477555d1419ae33eb0.tar.gz yuescript-aa194667c7cb7bb70f2a58477555d1419ae33eb0.tar.bz2 yuescript-aa194667c7cb7bb70f2a58477555d1419ae33eb0.zip | |
report syntax error when mix destructures and other expressions in switch when branches.
Diffstat (limited to '')
| -rwxr-xr-x | src/yuescript/yue_compiler.cpp | 2 | ||||
| -rwxr-xr-x | src/yuescript/yue_parser.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 83bad2e..c7ceeb4 100755 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
| @@ -56,7 +56,7 @@ using namespace parserlib; | |||
| 56 | 56 | ||
| 57 | typedef std::list<std::string> str_list; | 57 | typedef std::list<std::string> str_list; |
| 58 | 58 | ||
| 59 | const std::string_view version = "0.13.1"sv; | 59 | const std::string_view version = "0.13.2"sv; |
| 60 | const std::string_view extension = "yue"sv; | 60 | const std::string_view extension = "yue"sv; |
| 61 | 61 | ||
| 62 | class YueCompilerImpl { | 62 | class YueCompilerImpl { |
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp index 199c0bd..66043d3 100755 --- a/src/yuescript/yue_parser.cpp +++ b/src/yuescript/yue_parser.cpp | |||
| @@ -237,7 +237,7 @@ YueParser::YueParser() { | |||
| 237 | 237 | ||
| 238 | exp_not_tab = not_(simple_table | TableLit) >> Exp; | 238 | exp_not_tab = not_(simple_table | TableLit) >> Exp; |
| 239 | 239 | ||
| 240 | SwitchList = Seperator >> Exp >> *(sym(',') >> exp_not_tab); | 240 | SwitchList = Seperator >> (and_(simple_table | TableLit) >> Exp | exp_not_tab >> *(sym(',') >> exp_not_tab)); |
| 241 | Switch = Space >> key("switch") >> disable_do(Exp) >> -(Space >> key("do")) | 241 | Switch = Space >> key("switch") >> disable_do(Exp) >> -(Space >> key("do")) |
| 242 | >> -Space >> Break >> SwitchBlock; | 242 | >> -Space >> Break >> SwitchBlock; |
| 243 | 243 | ||
