m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-07-14 18:13:21 -0400
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-07-14 18:13:21 -0400
commita15a2986c95131a13d3707ae50f8a215dcaac564 (patch)
tree48e0bf9d95508ba9a94bfb2fd6f4bff51a89a25a /src
parent9f4197c659207534401ee6a7299275bf4d109949 (diff)
Lex and parse addition
Diffstat (limited to 'src')
-rw-r--r--src/parser.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parser.js b/src/parser.js
index 01b5494..c7d91c3 100644
--- a/src/parser.js
+++ b/src/parser.js
@@ -24,6 +24,14 @@ newSymbol('d', null, 30, (left, parser) => {
}
})
+newSymbol('+', null, 20, (left, parser) => {
+ return {
+ type: 'add',
+ left: left,
+ right: parser.expression(20)
+ }
+})
+
newSymbol('end', null, -1)
const newParser = (tokens) => {