m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-07-15 23:04:50 -0400
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-07-15 23:09:26 -0400
commit80df0f9425e8b64b8a3fcca308cb784d02d52f62 (patch)
tree9135b9cae1c34e6851f8c3bcfa5b59b8a33ac861 /src
parente0ab43bcdc050ca3cac2adea927817d99700737e (diff)
Implement the unary 'd' operation
Diffstat (limited to 'src')
-rw-r--r--src/parser.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/parser.js b/src/parser.js
index fc9add3..3437f1a 100644
--- a/src/parser.js
+++ b/src/parser.js
@@ -33,7 +33,13 @@ newSymbol('(', function(parser) {
newSymbol(')')
-newSymbol('d', null, 30, (left, parser) => {
+newSymbol('d', (parser) => {
+ return {
+ type: 'd',
+ left: { type: 'constant', value: 1 },
+ right: parser.expression(29)
+ }
+}, 30, (left, parser) => {
return {
type: 'd',
left: left,