Skip to content

parse less than token rather than left shift in context of type argum…#26653

Merged
RyanCavanaugh merged 6 commits intomicrosoft:masterfrom
Kingwl:improve_type_arguments_parser_1
Jan 24, 2019
Merged

parse less than token rather than left shift in context of type argum…#26653
RyanCavanaugh merged 6 commits intomicrosoft:masterfrom
Kingwl:improve_type_arguments_parser_1

Conversation

@Kingwl
Copy link
Copy Markdown
Contributor

@Kingwl Kingwl commented Aug 24, 2018

…ents

Fixes #23996

scanJsxIdentifier(): SyntaxKind;
scanJsxAttributeValue(): SyntaxKind;
reScanJsxToken(): JsxTokenSyntaxKind;
reScanLessThanToken(): SyntaxKind;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disgustingly, the corresponding method for a greater-than is called reScanGreaterToken. Not sure if we should be consistent here.

Copy link
Copy Markdown
Member

@DanielRosenwasser DanielRosenwasser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually not just type references that this needs to account for - can you add a test case for call type arguments as well?

function foo<T>(x: T) {}

// Both should be equivalent
foo< <T>(x: T) => void>();
foo<<T>(x: T) => void>();

@Kingwl
Copy link
Copy Markdown
Contributor Author

Kingwl commented Sep 4, 2018

Comment thread src/compiler/parser.ts Outdated
return currentToken = scanner.reScanTemplateToken();
}

function reScanLesserToken(): SyntaxKind {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reScanLessThanToken

Copy link
Copy Markdown
Member

@RyanCavanaugh RyanCavanaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a rename please

@Kingwl
Copy link
Copy Markdown
Contributor Author

Kingwl commented Jan 19, 2019

🔼

@RyanCavanaugh RyanCavanaugh merged commit 2f6c65e into microsoft:master Jan 24, 2019
@Kingwl Kingwl deleted the improve_type_arguments_parser_1 branch January 24, 2019 03:21
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants