-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
optional-node-space around equals sign in properties #401
Comments
Also, I think |
I think a good test for where Would |
The latter is definitely a bigger concern. I'm not sure what to do about that ambiguity: you definitely should be able to slashdash entire props... |
Maybe a better test for where Does this work?
I think |
It makes sense that an entity next to |
What would be the "entity next to |
I mean that it would be parsed as if edit: That is, I view |
Ah I see, that makes sense. |
That explains why |
So thinking about it, what we want is for slashdash to work in exactly three places:
Does that sound like what we want? It seems to be a pretty straightforward rule |
That sounds good to me. Are we okay with slashdashed children blocks in a non-final position? E.g. |
idk. Personally, I'm willing to live with that, even though it's a bit weird. |
If it was easy to block I'd prefer to not allow that, but I'm fine with allowing it if needed, yes. |
lol looking into making this change, this is what the spec actually says already: * A [Node](#node) name (or its type annotation): the entire Node is
treated as Whitespace, including all props, args, and children.
* A node [Argument](#argument) (or its type annotation), in which case
the Argument value is treated as Whitespace.
* A [Property](#property) key, in which case the entire property, both
key and value, is treated as Whitespace.
* A [Children Block](#children-block), in which case the entire block,
including all children within, is treated as Whitespace. I should change that to "including its type annotations" but other than that, this is what we've been talking about. The thing that needs to be done now is to fix the grammar to reflect this logic. I was thinking about the restrictions around children blocks, but considering how the following is, I think, reasonable, I don't think we should bother with the added complexity:
Likewise, and more interestingly, I think this should be legal, if we're going to be enabling the above use-case:
That is, slashdashes after the children block should still be valid. But this should not be:
So that complicates the node terminator a bit, I think. We'll see. Any thoughts? @tabatkins @larsgw ? |
PR over here: #407 |
The grammar for a property looks like this at the moment:
However, the text says:
Probably the latter needs to be reworded to allow whitespace, esclines, and slashdash comments.
(Sidenote, I'm a bit unsure if slashdash comments are good in this context. Firstly,
node prop= /-"foo" "bar"
would be equivalent tonode prop="bar"
which is not very obvious (it looks like"foo"
and especially"bar"
are just Values to me on first sight). Secondly,node prop=/-"foo" "bar"
is invalid which seems a bit inconsistent, I feel like that would be clearer.Thirdly, I think)node prop /-="foo" ="bar"
is probably very annoying to parse, especially nowprop
is a valid Value.The text was updated successfully, but these errors were encountered: