-
Notifications
You must be signed in to change notification settings - Fork 522
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
base: master
Are you sure you want to change the base?
Add alias attribute #2615
Conversation
17c3ca8
to
685bf6e
Compare
@casey how do you feel about this implementation? |
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.
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.
Implements #2349