-
Notifications
You must be signed in to change notification settings - Fork 476
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
Allow private attribute on aliases #1434
Conversation
4b2f250
to
c775208
Compare
c775208
to
83a113a
Compare
@casey could you take a look at this one when you have a chance? |
Yoo, sorry for slacking! This looks mostly good, but I believe the parser will incorrectly parse a recipe named [private]
alias:
echo foo Just doesn't really have keywords, so |
83a113a
to
e14cbea
Compare
@casey looks like I can use the same strategy the other alias-parsing code was using, namely explicitly looking ahead for a ColonEquals token. This is a bit messy, but not messier than other existing parsing code I think. |
I noticed you just pushed some commits, haven't looked at them in detail, but the approach of checking the next few tokens seems reasonable. One alternative is that we could parse attributes as items, and then let the analyzer figure out which attributes belonged on which items. This would allow attributes to be added to everything, without having to introduce special-purpose code to the parser. Or we could take the approach used for doc-comments, where the parser basically stores pending doc-comments, and then adds them to recipes when it gets to them. |
What do you think? Since you got it working, putting off doing something more general is fine for now. |
In the short term, I'd like to get this merged and be able to close out #1421 entirely. Longer-term, I think the current parser is a bit messy in a way that makes making changes to the grammar harder than it needs to be, and it's worth thinking about how to make that better in general rather than just trying to solve individual proposed changes to the grammar as they come up.
I'm not a huge fan of this idea - this is basically introducing a new variant of
This is actually kind of messy in the existing code, in that |
Sounds reasonable to me! Let's get this in. |
No description provided.