-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[CS2] return
and export default
can now accept implicit objects
#4532
Conversation
…ng snippet to where it’ll work in CS2
Very nice 👍 |
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.
If it works I guess we’re fine. Can’t really tell how this works and what it affects.
Well, it was previously a compiler error, so it’s not a breaking change. I guess the question is, are we opening ourselves up to allowing the compiler to output too much? Are there any edge cases where something indented on a new line after a |
@@ -790,7 +790,7 @@ exports.Lexer = class Lexer | |||
LINE_CONTINUER.test(@chunk) or | |||
@tag() in ['\\', '.', '?.', '?::', 'UNARY', 'MATH', 'UNARY_MATH', '+', '-', | |||
'**', 'SHIFT', 'RELATION', 'COMPARE', '&', '^', '|', '&&', '||', | |||
'BIN?', 'THROW', 'EXTENDS'] | |||
'BIN?', 'THROW', 'EXTENDS', 'DEFAULT'] |
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.
Out of interest, but would adding 'RETURN" here achieve the same thing as 75f6912?
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 was my first thought, but it's too permissive. This causes a return line continuation even if the line following the return is the same indentation, which we definitely don't want.
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.
Ah, good point, that makes sense!
Also merged into |
Fixes #1263, probably others. This now compiles:
As does the same for
export default
.