Page MenuHomePhabricator

Fix ParseError in mixin-args.less test case
Closed, ResolvedPublic

Description

Lessjs v2.5.3 mixin-args test failed to compile.

lessc: Less_Exception_Parser: Expected ')' got '.' in test.less on line 221, column 16
219| 	@y: 4  5  6;
220|   
221| 	&1 {.m3(@x...)}
222| 	&2 {.m3(@y...)}
223| 	&3 {.wr(a, b, c)}
224| 	&4 {.wr(a; b; c, d)} in.../less.php/lib/Less/Parser.php:2642
Stack trace:
#0 .../less.php/lib/Less/Parser.php(852): Less_Parser->Error('Expected ')' go...')
#1 .../less.php/lib/Less/Parser.php(1413): Less_Parser->expectChar(')')
#2 .../less.php/lib/Less/Parser.php(924): Less_Parser->parseMixinCall()
#3 .../less.php/lib/Less/Parser.php(1878): Less_Parser->parsePrimary()
#4 .../less.php/lib/Less/Parser.php(1939): Less_Parser->parseBlock()
#5 .../less.php/lib/Less/Parser.php(923): Less_Parser->parseRuleset()
#6 .../less.php/lib/Less/Parser.php(1878): Less_Parser->parsePrimary()
#7 .../less.php/lib/Less/Parser.php(1939): Less_Parser->parseBlock()
#8 .../less.php/lib/Less/Parser.php(923): Less_Parser->parseRuleset()
#9 .../less.php/lib/Less/Parser.php(623): Less_Parser->parsePrimary()
#10 .../less.php/lib/Less/Parser.php(582): Less_Parser->GetRules(...)
#11 .../less.php/lib/Less/Parser.php(447): Less_Parser->_parse(...)
#12 .../less.php/bin/lessc(175): Less_Parser->parseFile(...)
#13 {main}

Details

Event Timeline

Krinkle triaged this task as Medium priority.Jan 5 2024, 2:22 PM

I mananged the code to pass but the test for mixins-args fails due to border-radius calculation.

There was 1 failure:

1) phpunit_FixturesTest::testFixture with data set "Fixtures/lessjs-2.5.3 mixins-args" ('/Users/pmiazga/projects/wmf/l...gs.css', '/Users/pmiazga/projects/wmf/l...s.less', array())
Standard compiler
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
   width: "{";
 }
 .slash-vs-math {
-  border-radius: 2px/5px;
-  border-radius: 5px/10px;
+  border-radius: 0.4px;
+  border-radius: 0.5px;
   border-radius: 6px;
 }
 .comma-vs-semi-colon {

@Krinkle can you remind me what we do with those? Just add to override or keep the fixture disabled with a link to a new ticket?

pmiazga renamed this task from Investigate ParseError in mixin-args.less test case to Fix ParseError in mixin-args.less test case.Apr 19 2024, 4:47 PM

Change #1022094 had a related patch set uploaded (by Pmiazga; author: Pmiazga):

[mediawiki/libs/less.php@master] Support expand operator in Mixin Call

https://gerrit.wikimedia.org/r/1022094

Change #1022094 merged by jenkins-bot:

[mediawiki/libs/less.php@master] Support expand operator in Mixin Call

https://gerrit.wikimedia.org/r/1022094

The problem is resolved. The mixins-args.less file had a math operation that was causing the fixture to fail but for now we introduced an override that should be removed in T362343.