m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-08-22 15:35:21 -0400
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-08-22 15:35:21 -0400
commit403f2ed88dbef7ce1bbb07a13bca4bc6e35cbcf3 (patch)
tree4c499c68f6ed5fdbe944f12205a15525e77308bd /src
parent845ed56bb448e52a7f708504b91a6c5d492f228d (diff)
Lex and parse additive bonus
Diffstat (limited to 'src')
-rw-r--r--src/lexer.js1
-rw-r--r--src/parser.js1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/lexer.js b/src/lexer.js
index 8635e4a..2b3b25a 100644
--- a/src/lexer.js
+++ b/src/lexer.js
@@ -18,6 +18,7 @@ newValueLexeme('constant', '\\d+', Number)
newLexemeType('d', 'd')
newLexemeType('bigPlus', ' \\+ ' )
newLexemeType('bigMinus', ' - ')
+newLexemeType('plus', '\\+')
newLexemeType('minus', '-')
newLexemeType('(', '\\(')
newLexemeType(')', '\\)')
diff --git a/src/parser.js b/src/parser.js
index 588f480..c55fee6 100644
--- a/src/parser.js
+++ b/src/parser.js
@@ -64,6 +64,7 @@ newDieOperation('E')
newDieOperation('K')
newInfix('bigPlus', 20, { type: 'add' })
+newInfix('plus', 20, { type: 'bonusAdd' })
newInfix('bigMinus', 20, { type: 'subtract' })
newSymbol('minus', (parser) => {
return {