-
Notifications
You must be signed in to change notification settings - Fork 65
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
Move all JS codegeneration to the generate-js
pass
#117
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0afd4a5
Cleanup bytecode generator (pegjs/pegjs#450): Split `consts` collecti…
Mingun 017b868
Cleanup bytecode generator (pegjs/pegjs#450): Move function code gene…
Mingun f3c6d0c
Cleanup bytecode generator (pegjs/pegjs#450): Move expectation code g…
Mingun 3d51dd9
Cleanup bytecode generator (pegjs/pegjs#450): Move regexp code genera…
Mingun 8318d04
Cleanup bytecode generator (pegjs/pegjs#450): Move literal code gener…
Mingun ed88b84
Cleanup bytecode generator (pegjs/pegjs#450): Regenerate parser and u…
Mingun e8557cc
Cleanup bytecode generator (pegjs/pegjs#450): Rename opcode `MATCH_RE…
Mingun dcbe046
Cleanup bytecode generator (pegjs/pegjs#450): Merge js.js into genera…
Mingun aa44ec3
Cleanup bytecode generator (pegjs/pegjs#450): Replace PUSH opcode wit…
Mingun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Doesn't this (as an example of several opcode changes) conflict with the typescript plugin? Is @metadevpro following the work here yet? How could they support both peggy and pegjs if they wanted?
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.
It will. Instead of renaming that opcode we can just leave it unused and introduce a new opcode for
PUSH_EMPTY_STRING
. RenamingMATCH_REGEXP
also should be reverted. Also we could add an alias instead of renaming or just do nothing. Then in version 2.0 we could completely remove the unused opcode.On the other hand, @metadevpro could create a local copy of opcodes, he anyway is not needed to use exactly the same opcodes as peggy used because they used only as a glue between generate-bytecode-ts and generate-ts passes.
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.
OK, my suggestion from your choices above:
PUSH
as 0. Mark it as deprecated with a comment.PUSH_EMPTY_STRING
MATCH_CHAR_CLASS
andMATCH_REGEXP
both as opcode 20, but markMATCH_REGEXP
as deprecated with a comment.I think this will allow plugins to support both peggy and pegjs at the same time adequately. If you expect that plugins would need to take different actions for
MATCH_CHAR_CLASS
andMATCH_REGEXP
, then don't alias them together, and instead leaveMATCH_REGEXP
as opcode 20, create a new opcode forMATCH_CHAR_CLASS
.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.
All done as you said. I've make a rebase , changed only the last and the pre-pre-last commits.
MATCH_REGEXP
andPUSH
marked@deprecated
, noted this in theCHANGELOG.md
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.
Thanks!