feat: switch to the CS2 AST format#317
Merged
alangpierce merged 1 commit intodecaffeinate:masterfrom Feb 18, 2018
Merged
Conversation
7a42cdc to
cdf8539
Compare
There's some CS2-specific code, but we don't yet ever run the CS2 parser. Instead, we run the CS1 parser, convert that AST to a CS2 AST, then convert that to a decaffeinate-parser AST. This should make it possible to variably use the CS1 or CS2 parser depending on configuration. BREAKING CHANGE: Node 4 is no longer supported. The returned CoffeeScript AST is now a CS2 AST, and there are slight differences in ranges and AST structure for comment-only blocks.
cdf8539 to
e9c3692
Compare
Member
Author
|
FYI @eventualbuddha I'm going to drop support for node 4 in decaffeinate. CS2 is distributed with ES2015 syntax, so it won't run in node 4, and it would be a pain to support CS1 in a way that never requires importing the CS2 code. Node 4 is reaching end-of-life in a few months anyway, and it seems reasonable to use node 6 or later for decaffeinate even if you're still running node 4 in production. |
Collaborator
Sounds good. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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's some CS2-specific code, but we don't yet ever run the CS2 parser.
Instead, we run the CS1 parser, convert that AST to a CS2 AST, then convert that
to a decaffeinate-parser AST. This should make it possible to variably use the
CS1 or CS2 parser depending on configuration.
BREAKING CHANGE: Node 4 is no longer supported. The returned CoffeeScript AST is
now a CS2 AST, and there are slight differences in ranges and AST structure for
comment-only blocks.