Skip to content

Commit

Permalink
cleanup error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Jul 20, 2023
1 parent fcb4806 commit 00c4bee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/yuescript/yue_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ YueParser::YueParser() {
});

confusing_unary_not_error = pl::user(true_(), [](const item_t& item) {
throw ParserError("deprecated unary operator not"sv, item.begin);
throw ParserError("deprecated use for unary operator 'not' to be here"sv, item.begin);
return false;
});

Expand Down Expand Up @@ -469,7 +469,7 @@ YueParser::YueParser() {
NotIn = true_();
InRange = ('(' >> InRangeOpen | '[' >> InRangeClose) >> space >> Exp >> space >> ',' >> space >> Exp >> space >> (')' >> InRangeOpen | ']' >> InRangeClose);
InDiscrete = '{' >> Seperator >> space >> exp_not_tab >> *(space >> ',' >> space >> exp_not_tab) >> space >> '}';
In = -(key("not") >> NotIn >> space) >> key("in") >> space >> (InRange | InDiscrete | key("not") >> confusing_unary_not_error | Exp);
In = -(key("not") >> NotIn >> space) >> key("in") >> space >> (InRange | InDiscrete | and_(key("not")) >> confusing_unary_not_error | Exp);

UnaryOperator =
'-' >> not_(set(">=") | space_one) |
Expand Down

0 comments on commit 00c4bee

Please sign in to comment.