-
Notifications
You must be signed in to change notification settings - Fork 455
Stabilizing Jison in Php #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Use \G and InputReader where possible in php and c# so that new strings are not made each time using substring etc.
Conflicts: ports/csharp/Jison/Jison/Template.cs ports/csharp/Jison/Jison/csharp.js
|
@robertleeplummerjr Did you have a look at #195? Were any of those commits useful? |
|
Sure. Merge it in. On Tue, Jun 24, 2014 at 2:04 PM, Zach Carter notifications@github.com
Robert Plummer |
Conflicts: ports/csharp/Jison/Jison/csharp.js
Getting ready to bring unit test into Spreadsheets/csharp-sheet
Use \G and InputReader where possible in php and c# so that new strings are not made each time using substring etc.
Getting ready to bring unit test into Spreadsheets/csharp-sheet
|
Upstreamed |
ports/csharp/Jison/Jison/Template.cs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a mix of tabs and spaces, you should follow the project standards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is actually a really good point. I only use tabs, must be visual
studio. I'll do a cleanup later today.
On Sep 22, 2014 6:17 AM, "Damien Alexandre" notifications@github.com
wrote:
In ports/csharp/Jison/Jison/Template.cs:
return ch; } public void Unput(string ch) {
var yy = new /**/ParserValue/**/();There is a mix of tabs and spaces, you should follow the project standards.
—
Reply to this email directly or view it on GitHub
https://github.com/zaach/jison/pull/220/files#r17841300.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And fixed. Thanks for spotting!
|
Php unit tests in wikiLingo all powered by Jison in PHP: http://wikilingodoesthat.com/demo/test.php |
0fe1216 to
73aa05e
Compare
lib/jison.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the signature of the parse function, which i'm weary of doing lightly. It will break consumer code. As for this particular change, returning an error string seems like the wrong API. Errors are already thrown or handle by a custom error handler. Let's get rid of this change.
|
@robertleeplummerjr Besides the one issue I commented on, this is good to go. |
|
This simply allows the parser to handle errors rather than throwing them. @robertleeplummerjr https://github.com/robertleeplummerjr Besides the one — |
|
Performance is a valiant goal, but my problems with the implementation are that it changes the parser API for a special case that relies on parser state ( Another approach would be to add a parser option to return the value from But this change has nothing to do with the PHP port, so it needs to go in a separate PR in any case. |
|
I will move it to another PR, but to your point that it prevents the parser "setInput" is called any time the parser is called to parse a string. So On Sun, Oct 19, 2014 at 1:29 PM, Zach Carter notifications@github.com
Robert Plummer |
Ah, so it looks like there's a bug in your patch which is causing my confusion.
Okay, it "extends" the api for a special use case. I'd rather do something more general and more explicit and let users declare up front if they want to change the behavior of error handling in the parser. It also avoids the awkward coupling between the lexer and parser.
It would be a declaration in the grammar file, like other options. It will change the way the parser is generated. |
|
Thanks for the correction, I see the bug, my bad. Rolled everything back On Sun, Oct 19, 2014 at 3:15 PM, Zach Carter notifications@github.com
Robert Plummer |
|
On Mon, Oct 20, 2014 at 10:00 AM, Robert Plummer <
Robert Plummer |
|
Zach is apparently busy with other projects. This will end our relationship with me contributing to Jison for the foreseeable future. I will now put effort into my own branch. |
No description provided.