Extend syntax inconsistency (was "ParseError: Unrecognised input" on extends)
Open
Nobody has claimed this yet.
bug
medium priority
- Dominant language
- JavaScript
- Stars
- 17k
- Forks
- 3.4k
- Avg merge
- 7h 42m
- Merged PRs (30d)
- 26
Description
If I lint this file by lessc -l file:
.something {
color: red;
}
body {
nav {/* a lot more lines */
ul {
color: blue;
/*v1*/
li:extend(.something);
/*v2
li {
&:extend(.something);
}*/
}
/*v3
ul li:extend(.something); */
}
}
I receive a message that isn't even pointing me in the direction of the error:
ParseError: Unrecognised input in file on line 5, column 2:
4 body {
5 [red] nav { /* a lot more lines */ [/red]
6 ul {
There are two issues:
- The parser accepts only v2 of the the three expressions that appear equivalent to me. My understanding of less is limited so I'm expecting to have overlooked something. I'd appreciate some feedback.
- In this particular case the
ParseErrormessage is not helpful. Guessing from the rarity of misleading messages I've seen so far I'd blame extend. But I should investigate this further.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the example with lessc -l file and compare the parser's handling of the v1, v2, and v3 extend forms. Trace the resulting parse error to determine why it reports the nav line; done means the accepted syntax and any corrected error location are covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100