Repository navigation
fix: Align the ASI behaviour with typescript - #3053
Open
Changqing-JING wants to merge 2 commits into
Open
Changqing-JING wants to merge 2 commits into
Changqing-JING wants to merge 2 commits into
Conversation
Changqing-JING
marked this pull request as draft
October 17, 2026 09:10
Changqing-JING
force-pushed
the
fix/parser
branch
from
October 17, 2026 09:16
7ed0f4e to
696e6b7
Compare
Changqing-JING
marked this pull request as ready for review
October 20, 2026 02:29
Contributor
Author
Member
|
@Changqing-JING, taking a look |
JairusSW
reviewed
Nov 13, 2026
| let ret = Node.createExpressionStatement(expr); | ||
| tn.skip(Token.Semicolon); | ||
| if (isFor) tn.skip(Token.Semicolon); | ||
| else this.parseSemicolon(tn); |
Member
There was a problem hiding this comment.
Wouldn't isFor not fire in a nested func declaration?
eg.
export function foo(): i32 {
function bar(): i32 { return 42; } return bar();
}on my end, it panics when a nested function is followed by a statement on the same line as the closing brace.
|
|
||
| // Name<T> | ||
| if (tn.skip(Token.LessThan)) { | ||
| if (!tn.peekOnNewLine() && tn.skip(Token.LessThan)) { |
Member
There was a problem hiding this comment.
This might affect generics (< token) when it's on a new line. For example,
class Foo<T> {}
class Bar extends Foo
<string> {}should fail i think?
Member
|
Generally, looks good. Please fix the issues i found and it'd probably be good to add a test for them as well |
This branch has not been deployed
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.
Fixes #2130
Changes proposed in this pull request:
Align the ASI behaviour with typescript