-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
[v2] more predictable slashdash #407
Conversation
Alright, this is ready. I actually really like these changes, but I could use a second set of eyes. Getting rid of the weird |
also worth noting: This restricts
but this is:
I believe this is what you were hoping for, @tabatkins? |
e99256e
to
b05079c
Compare
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.
Very minor style nit, otherwise r+
SPEC.md
Outdated
final-node := base-node optional-node-space node-terminator? | ||
node-prop-or-arg := prop | value | ||
base-node := slashdash? type? node-space* string | ||
(node-space+ node-prop-or-arg)* |
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 for consistency, I'd move the optional slashdash
to here, rather than putting it into node-prop-or-arg
.
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.
Sounds good. Additionally, I just realized I didn’t put any space allowances around the /-. I’m thinking of making it like:
slashdash := '/-' line-space*
Which means that these would both be legal:
// Very reasonable, IMO
/-
node 1 2 3
// interesting and I think acceptable—it means you can use them like esclines:
node 1 /-
2 3
We can totally ban the second behavior but I think it’s better than having to special case allowing esclines after the /-. This way, we just say “/- consumes all following line-space, and the next “item”, regardless of where you put it (as long as it’s a legal /- location“.
Interestingly, that implies the following are legal too:
node /- //next thing is commented
foo
node /- /* commented */ foo
I’ll have to adjust the spec prose too, to clarify that these cases are possible.
Also reorganized grammar a bit.
Fixes: #401