diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-07-14 23:34:55 -0400 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-07-14 23:34:55 -0400 |
commit | c5b9b7d03a37b807b212c29a9bdf7afc837c5423 (patch) | |
tree | 010ff6b701a22204cdec8fd277e7a8129ae988e2 /src/parser.js | |
parent | d3132a5463908bcabd0578ad48a457b2bec30a9a (diff) |
Lex and parse parentheses
Diffstat (limited to 'src/parser.js')
-rw-r--r-- | src/parser.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parser.js b/src/parser.js index 6c39c77..9f2c6ac 100644 --- a/src/parser.js +++ b/src/parser.js @@ -16,6 +16,14 @@ newSymbol('constant', function() { return { type: 'constant', value: this.value } }) +newSymbol('(', function(parser) { + const value = parser.expression(1) + parser.match(')') + return value +}) + +newSymbol(')') + newSymbol('d', null, 30, (left, parser) => { return { type: 'd', |