Last active
January 16, 2019 20:16
-
-
Save indatawetrust/e0b3a3a95e3f734e80a2e853beb55ab1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum -> sum "+" product {% d => d[0] + d[2] %} | |
| sum "-" product {% d => d[0] - d[2] %} | |
| product {% d => d[0] %} | |
product -> product "*" factor {% d => d[0] * d[2] %} | |
| product "/" factor {% d => d[0] / d[2] %} | |
| factor {% d => d[0] %} | |
factor -> "(" sum ")" {% d => d[1] %} | |
| float {% d => d[0] %} | |
float -> num "." num {% d => parseFloat(d[0] + d[1] + d[2]) %} | |
| num {% d => parseInt(d[0]) %} | |
num -> [0-9]:+ {% d => d[0].join('') %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment