Closed matthew-dean closed 3 years ago
Alternatively, this could echo the ~""
syntax, and could be ~()
to escape parens.
Meaning:
.mixin(a; ~(b, c); d);
Hmm, that seems a lot cleaner.
I added ~(b, c)
syntax to 4.0, but I have not deprecated semi-colon separators. They should stay for a while as it was recommended syntax.
@less/maintainers @less/admin
I'm currently working on re-writing the parser for Less. I'm trying to simplify the amount of backtracking in the parser, of which there currently is quite a lot, and some of that is built into the grammar.
When I came to looking at semi-colon-, comma-separation- in mixins and functions, parsing gets pretty complex very quickly.
I came up with a proposal that I think would remove the need for backtracking in mixins / functions, which I posted today.
Proposal: Instead of looking ahead for commas / semi-colons, comma-separated values can be wrapped in a (currently-proposed)
value()
function.Ex:
In a future major release, the parser would accept either semi-colon or comma separators, but they would not change the interpretation of values as they do now.
This would allow the parser (at least in the case of functions, since mixin calls / definitions still have ambiguity) to more simply parse arguments, and also doesn't change the reading of an argument based on what comes after.
Thoughts welcome.