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
wip: Reserved keywords only unquoted #800
base: master
Are you sure you want to change the base?
Conversation
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.
looks reasonable otherwise to me
Name: head, | ||
parent: m, | ||
Name: headString, | ||
IsUnquoted: headUnquoted, |
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.
You also need to check that there are no escapes. Use len(headString) == len(head.(*d2ast.UnquotedString).RawString)
. i.e there are no escapes if the length of the string value is equal to it's length in the AST.
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.
IsUnquoted could be confusing then, but i can't think of a word that encapsulates "is unquoted or is escaped". Raw already means something else. will leave as IsUnquoted for now unless u have a word
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.
Yea just add a comment on IsUnquoted
. I have no better word in mind.
I wait this one, to remove trailing space in quoted reserved keywords! Related: #1419 |
@nhooyr spot check before i go too far on this. there's a number of places where we iterate over
ida
and check reserved. those will be annoying, as we now have to change them to carry info about their original AST quoting. E.g. there's a lot of ScalarString() conversions made too early nowcloses #477