[update] Allowed a parser to parse the first term with minus.

This commit is contained in:
falsycat 2019-10-14 00:00:00 +00:00
parent 937a4fa09a
commit 16aeda8612
2 changed files with 5 additions and 1 deletions

View File

@ -120,6 +120,10 @@ private class RuleSet {
static Expression ParseExpressionFromFirstTerm(Term term) {
return Expression([term]);
}
static Expression ParseExpressionFromFirstNegativeTerm(
@(TokenType.Sub) Token, Term term) {
return Expression([term * -1f]);
}
static Expression ParseExpressionFromFollowingAddedTerm(
Expression expr, @(TokenType.Add) Token, Term term) {
return expr + term;

View File

@ -2,6 +2,6 @@ $define beat {0}
$repeat i 100 {
A [$i*5+$beat..($i+1)*5+$beat] {
damage = 1;
damage = -1;
}
}