mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2025-01-22 21:35: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;
|
||||||
case '/': ret /= val; break;
|
case '/': ret /= val; break;
|
||||||
|
case '%': ret %= val; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Value(ret);
|
return Value(ret);
|
||||||
|
@ -26,7 +26,7 @@ static auto g_grammar = R"(
|
|||||||
|
|
||||||
CONDITION_OPERATOR <- < ('==' / '!=' / '<=' / '<' / '>=' / '>') > _
|
CONDITION_OPERATOR <- < ('==' / '!=' / '<=' / '<' / '>=' / '>') > _
|
||||||
TERM_OPERATOR <- < [-+] > _
|
TERM_OPERATOR <- < [-+] > _
|
||||||
FACTOR_OPERATOR <- < [*/] > _
|
FACTOR_OPERATOR <- < [*/%] > _
|
||||||
IDENTIFIER <- < [a-zA-Z_]+ > _
|
IDENTIFIER <- < [a-zA-Z_]+ > _
|
||||||
|
|
||||||
NUMBER <- < [0-9]+ > _
|
NUMBER <- < [0-9]+ > _
|
||||||
|
Loading…
Reference in New Issue
Block a user