aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/inputs/switch.yue5
-rwxr-xr-xsrc/yuescript/yue_compiler.cpp4
2 files changed, 7 insertions, 2 deletions
diff --git a/spec/inputs/switch.yue b/spec/inputs/switch.yue
index 04bb02e..9e7ecfd 100644
--- a/spec/inputs/switch.yue
+++ b/spec/inputs/switch.yue
@@ -144,5 +144,10 @@ do
144 else 144 else
145 "should not reach here unless it is not a table" 145 "should not reach here unless it is not a table"
146 146
147do
148 switch y
149 when {x: #:mt}
150 print mt
151
147nil 152nil
148 153
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp
index 2565878..21764fe 100755
--- a/src/yuescript/yue_compiler.cpp
+++ b/src/yuescript/yue_compiler.cpp
@@ -56,7 +56,7 @@ using namespace parserlib;
56 56
57typedef std::list<std::string> str_list; 57typedef std::list<std::string> str_list;
58 58
59const std::string_view version = "0.13.4"sv; 59const std::string_view version = "0.13.5"sv;
60const std::string_view extension = "yue"sv; 60const std::string_view extension = "yue"sv;
61 61
62class YueCompilerImpl { 62class YueCompilerImpl {
@@ -2012,7 +2012,7 @@ private:
2012 pairs.push_back({ 2012 pairs.push_back({
2013 p.target, 2013 p.target,
2014 p.targetVar, 2014 p.targetVar,
2015 ".#"s + sep + p.structure, 2015 ".#"s + (p.structure.empty() ? Empty : sep + p.structure),
2016 p.defVal 2016 p.defVal
2017 }); 2017 });
2018 } 2018 }