aboutsummaryrefslogtreecommitdiff
path: root/src/yuescript/yue_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuescript/yue_parser.cpp')
-rw-r--r--src/yuescript/yue_parser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp
index 66ef373..f9dc33a 100644
--- a/src/yuescript/yue_parser.cpp
+++ b/src/yuescript/yue_parser.cpp
@@ -103,6 +103,11 @@ YueParser::YueParser() {
103 return false; 103 return false;
104 }); 104 });
105 105
106 confusing_unary_not_error = pl::user(true_(), [](const item_t& item) {
107 throw ParserError("deprecated unary operator not"sv, item.begin);
108 return false;
109 });
110
106 #define ensure(patt, finally) ((patt) >> (finally) | (finally) >> cut) 111 #define ensure(patt, finally) ((patt) >> (finally) | (finally) >> cut)
107 112
108 #define key(str) (expr(str) >> not_alpha_num) 113 #define key(str) (expr(str) >> not_alpha_num)
@@ -464,7 +469,7 @@ YueParser::YueParser() {
464 NotIn = true_(); 469 NotIn = true_();
465 InRange = ('(' >> InRangeOpen | '[' >> InRangeClose) >> space >> Exp >> space >> ',' >> space >> Exp >> space >> (')' >> InRangeOpen | ']' >> InRangeClose); 470 InRange = ('(' >> InRangeOpen | '[' >> InRangeClose) >> space >> Exp >> space >> ',' >> space >> Exp >> space >> (')' >> InRangeOpen | ']' >> InRangeClose);
466 InDiscrete = '{' >> Seperator >> space >> exp_not_tab >> *(space >> ',' >> space >> exp_not_tab) >> space >> '}'; 471 InDiscrete = '{' >> Seperator >> space >> exp_not_tab >> *(space >> ',' >> space >> exp_not_tab) >> space >> '}';
467 In = -(key("not") >> NotIn >> space) >> key("in") >> space >> (InRange | InDiscrete | Exp); 472 In = -(key("not") >> NotIn >> space) >> key("in") >> space >> (InRange | InDiscrete | key("not") >> confusing_unary_not_error | Exp);
468 473
469 UnaryOperator = 474 UnaryOperator =
470 '-' >> not_(set(">=") | space_one) | 475 '-' >> not_(set(">=") | space_one) |