lesscss-engine icon indicating copy to clipboard operation
lesscss-engine copied to clipboard

Ampersand regression error in 1.7.4-snapshot

Open bradmac opened this issue 11 years ago • 3 comments

I got an exception compiling LESS that works fine with 1.5.1. Looks like the ampersand operator support got lost?

com.asual.lesscss.LessException: com.asual.lesscss.LessException: Parse Error: Unrecognised input (line 2, column 1) near .modulePage { &.course-pf { background-color: @body-bg !important; at com.asual.lesscss.compiler.NashornCompiler.compile(NashornCompiler.java:79)

bradmac avatar Aug 14 '14 00:08 bradmac

Can you please try to isolate the exact problematic piece or write a simple failing test case. I just tried reproducing this without success. The & operator seems to work as expected for me.

asual avatar Aug 28 '14 21:08 asual

OK, turns out it wasnt the ampersand. The less contained an erroneous piece of code which compiles fine on 1.5.1 but which causes an error on 1.7.4-SNAPSHOT:

div.references { @lightGrey; }

So this isnt a bug in asual, i presume.

bradmac avatar Oct 08 '14 01:10 bradmac

But, the erroneous LESS above results in this rather unhelpful error message: Reason: com.asual.lesscss.LessException: Parse Error: Unrecognised input (line 2, column 1) near .modulePage { &.course-pf { background-color: @body-bg !important;

...where the quoted code above is about 300 lines before from the actual error. The only way to find the error is to progressively remove code until it compiles. And this code is in an import, but the filename property of the exception is null, so there is nothing to connect the exception to the file with the error, or what part of the file.

Any chance of tightening up the error reporting?

bradmac avatar Oct 08 '14 02:10 bradmac