Skip to content

Replace the evaluator with a Peggy-generated parser#3

Open
frostburn wants to merge 23 commits intoeosterberg:masterfrom
frostburn:peggy
Open

Replace the evaluator with a Peggy-generated parser#3
frostburn wants to merge 23 commits intoeosterberg:masterfrom
frostburn:peggy

Conversation

@frostburn
Copy link
Copy Markdown

Builds on #2 and passes existing test suite.

Convert source code to TypeScript
Limit the Javascript grammar to numbers only.
Generate abstract syntax tree parser with Peggy.
Replace existing string evaluator with an AST evaluator.

ref eosterberg#1
Exponentiation is right-associative i.e. x**y**z = x**(y**z).
Add support for adding your own functions and constants to the evaluation context.
Allow the user to override Math defaults.
Fix scope issues by differentiating between local and global context.
Implement bitwise operators
Reserve 'let' in addition to 'const'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant