Open murtyjones opened 3 years ago
Thanks for opening this issue!
Hmm. The way my eyes see it is:
"If there's a string literal (i.e. "my-class") then it's a string.. otherwise it's an identifier".
Then with blocks it would be something in the realm of "if there's a block its not a string literal, otherwise it's a string literal".
And to me, both of those seem like the same level of reading-complexity.
So, for me requiring blocks seems like unnecessary boilerplate (block expressions are supported today but not required for a single identifier).
I'm wondering whether or not blocks just make it more familiar to React developers where blocks are required (probably?) since the JS world doesn't have something like syn. Or if blocks are truly more readable to most Rust developers (the target audience).
Also not very versed in syntax highlighting.. But I think a highlighter would know decide how to highlight based on the token type. In this case, an Ident
.
Just my thoughts!
Looking over the example:
I think that requiring curly braces, similar to how React does:
...Would be a bit more readable for the developer, and while I'm not so familiar with how syntax highlighters are built, I imagine knowing to expect
{...}
would be helpful for those tools too.