Skip to content

Add alias attribute#2615

Open
marcaddeo wants to merge 7 commits intocasey:masterfrom
marcaddeo:add-alias-attribute
Open

Add alias attribute#2615
marcaddeo wants to merge 7 commits intocasey:masterfrom
marcaddeo:add-alias-attribute

Conversation

@marcaddeo
Copy link
Copy Markdown
Contributor

@marcaddeo marcaddeo commented Feb 1, 2025

Implements #2349

@marcaddeo marcaddeo force-pushed the add-alias-attribute branch from 17c3ca8 to 685bf6e Compare February 1, 2025 21:26
@marcaddeo marcaddeo marked this pull request as ready for review February 1, 2025 21:30
@marcaddeo
Copy link
Copy Markdown
Contributor Author

@casey how do you feel about this implementation?

Copy link
Copy Markdown
Owner

@casey casey left a comment

Choose a reason for hiding this comment

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

Just took a first look at this!

I think it's probably not a good idea to try to construct a Name token, when the source was in fact a string literal, and that Alias should be refactored to make the name field a String. If we need a token so we can report error locations, we shoiuld use a Token, and the underlying TokenKind may be a Identifier or a StringLiteral, depending on the source.

You can use Lexer::is_identifier to check if StringLiteral::cooked is a valid identifier. StringLiteral::cooked should be use, since it may contain escape characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants