mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-11-13 22:55:29 +00:00
Added % operator.
This commit is contained in:
parent
0168d19a0c
commit
0ed897dd01
@ -140,6 +140,7 @@ private:
|
||||
case '-': ret -= val; break;
|
||||
case '*': ret *= val; break;
|
||||
case '/': ret /= val; break;
|
||||
case '%': ret %= val; break;
|
||||
}
|
||||
}
|
||||
return Value(ret);
|
||||
|
@ -26,7 +26,7 @@ static auto g_grammar = R"(
|
||||
|
||||
CONDITION_OPERATOR <- < ('==' / '!=' / '<=' / '<' / '>=' / '>') > _
|
||||
TERM_OPERATOR <- < [-+] > _
|
||||
FACTOR_OPERATOR <- < [*/] > _
|
||||
FACTOR_OPERATOR <- < [*/%] > _
|
||||
IDENTIFIER <- < [a-zA-Z_]+ > _
|
||||
|
||||
NUMBER <- < [0-9]+ > _
|
||||
|
Loading…
Reference in New Issue
Block a user