Added % operator.

This commit is contained in:
yhirose 2015-05-28 21:35:06 -04:00
parent 0168d19a0c
commit 0ed897dd01
2 changed files with 2 additions and 1 deletions

View File

@ -140,6 +140,7 @@ private:
case '-': ret -= val; break;
case '*': ret *= val; break;
case '/': ret /= val; break;
case '%': ret %= val; break;
}
}
return Value(ret);

View File

@ -26,7 +26,7 @@ static auto g_grammar = R"(
CONDITION_OPERATOR <- < ('==' / '!=' / '<=' / '<' / '>=' / '>') > _
TERM_OPERATOR <- < [-+] > _
FACTOR_OPERATOR <- < [*/] > _
FACTOR_OPERATOR <- < [*/%] > _
IDENTIFIER <- < [a-zA-Z_]+ > _
NUMBER <- < [0-9]+ > _