Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Rewrote parser to a more flexible version. Fixes #14 and #15 #17

Merged
merged 4 commits into from
Aug 22, 2015
Merged

Rewrote parser to a more flexible version. Fixes #14 and #15 #17

merged 4 commits into from
Aug 22, 2015

Conversation

timrach
Copy link
Collaborator

@timrach timrach commented Aug 22, 2015

The parser is not longer based on the shunting yard algorithm as it was not flexible enough. The new version is based on a grammar and therefore can be extended by any feature that can be expressed in the grammar.
With the grammar it should be easy to include parsing future features.
This commit also fixes issues 14 and 15.

The parser is not longer based on the shunting yard algorithm as it was not flexible enough. The new version is based on a grammar and therefore can be extended by any feature that can be expressed in the grammar. This commit also fixes issues 14 and 15.
@kevinbarabash
Copy link

Cool. I'm happy for the switch to a recursive descent parser... mainly b/c I'm more familiar with them which will make it easier for me to help out.

});

it("should consecutive expressions as multiplication", function(){
var input = "(x + 2) * (x + 2)";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this test case be (x + 2)(x + 2)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, thanks. I fixed it.

@kevinbarabash
Copy link

Does it handle 5(x+2) and (x+2)5?

@timrach
Copy link
Collaborator Author

timrach commented Aug 22, 2015

It does handle 5(x+2) and (x+2)5. I added tests for that.

@kevinbarabash
Copy link

Awesome, thank you!

@nicolewhite
Copy link
Owner

Nice! I'll pull this in.

nicolewhite pushed a commit that referenced this pull request Aug 22, 2015
Rewrote parser to a more flexible version. Fixes #14 and #15
@nicolewhite nicolewhite merged commit 192fa14 into nicolewhite:master Aug 22, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants