Skip to content
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

Add alias attribute #2615

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

marcaddeo
Copy link
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
Contributor Author

@casey how do you feel about this implementation?

Copy link
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