@@ -1615,7 +1615,7 @@ private function parseUnicodeDescriptor() {
1615
1615
* `window.location.href`
1616
1616
*
1617
1617
* @return Less_Tree_JavaScript|null
1618
- * @see less-2.5.3 .js#parsers.entities.javascript
1618
+ * @see less-3.13.1 .js#parsers.entities.javascript
1619
1619
*/
1620
1620
private function parseEntitiesJavascript () {
1621
1621
// Optimization: Hardcode first char, to avoid save()/restore() overhead
@@ -1642,7 +1642,7 @@ private function parseEntitiesJavascript() {
1642
1642
$ js = $ this ->matchReg ( '/ \\G[^`]*`/ ' );
1643
1643
if ( $ js ) {
1644
1644
$ this ->forget ();
1645
- return new Less_Tree_JavaScript ( substr ( $ js , 0 , -1 ), $ index , $ isEscaped );
1645
+ return new Less_Tree_JavaScript ( substr ( $ js , 0 , -1 ), $ isEscaped , $ index );
1646
1646
}
1647
1647
$ this ->restore ();
1648
1648
}
@@ -1764,7 +1764,9 @@ private function parseExtend( $isRule = false ) {
1764
1764
// namespaced, but we only support the child and descendant
1765
1765
// selector for now.
1766
1766
//
1767
- private function parseMixinCall ( $ inValue = false , $ getLookup = false ) {
1767
+ // @see less-3.13.1.js#parsers.mixin.call
1768
+ //
1769
+ private function parseMixinCall ( $ inValue , $ getLookup = null ) {
1768
1770
$ s = $ this ->input [$ this ->pos ] ?? null ;
1769
1771
$ important = false ;
1770
1772
$ lookups = null ;
@@ -2470,7 +2472,7 @@ private function parseDeclaration() {
2470
2472
if ( is_array ( $ name ) && array_key_exists ( 0 , $ name ) // to satisfy phan
2471
2473
&& $ name [0 ] instanceof Less_Tree_Keyword
2472
2474
&& $ name [0 ]->value && strpos ( $ name [0 ]->value , '-- ' ) === 0 ) {
2473
- $ value = $ this ->parsePermissiveValue ( ' ; ' );
2475
+ $ value = $ this ->parsePermissiveValue ();
2474
2476
} else {
2475
2477
// Try to store values as anonymous
2476
2478
// If we need the value later we'll re-parse it in ruleset.parseValue
@@ -2489,7 +2491,7 @@ private function parseDeclaration() {
2489
2491
if ( $ value ) {
2490
2492
$ important = $ this ->parseImportant ();
2491
2493
} elseif ( $ isVariable ) {
2492
- $ value = $ this ->parsePermissiveValue ( ' ; ' );
2494
+ $ value = $ this ->parsePermissiveValue ();
2493
2495
}
2494
2496
}
2495
2497
if ( $ value && ( $ this ->parseEnd () || $ hasDR ) ) {
@@ -2527,7 +2529,6 @@ private function parseAnonymousValue() {
2527
2529
* @param null|string|array $untilTokens
2528
2530
*/
2529
2531
private function parsePermissiveValue ( $ untilTokens = null ) {
2530
- $ value = [];
2531
2532
$ tok = $ untilTokens ?? '; ' ;
2532
2533
$ index = $ this ->pos ;
2533
2534
$ result = [];
@@ -2545,6 +2546,8 @@ private function parsePermissiveValue( $untilTokens = null ) {
2545
2546
if ( $ testCurrentChar ( $ this ->input [$ this ->pos ] ) ) {
2546
2547
return ;
2547
2548
}
2549
+
2550
+ $ value = [];
2548
2551
do {
2549
2552
$ e = $ this ->parseComment ();
2550
2553
if ( $ e ) {
@@ -2574,7 +2577,7 @@ private function parsePermissiveValue( $untilTokens = null ) {
2574
2577
2575
2578
if ( $ value ) {
2576
2579
if ( is_string ( $ value ) ) {
2577
- $ this ->error ( "expected ' " . $ value . "' " );
2580
+ $ this ->Error ( "expected ' " . $ value . "' " );
2578
2581
}
2579
2582
if ( count ( $ value ) === 1 && $ value [0 ] === ' ' ) {
2580
2583
$ this ->forget ();
@@ -2849,19 +2852,19 @@ private function parseAtRule() {
2849
2852
if ( $ hasIdentifier ) {
2850
2853
$ value = $ this ->parseEntity ();
2851
2854
if ( !$ value ) {
2852
- $ this ->error ( "expected " . $ name . " identifier " );
2855
+ $ this ->Error ( "expected " . $ name . " identifier " );
2853
2856
}
2854
2857
} elseif ( $ hasExpression ) {
2855
2858
$ value = $ this ->parseExpression ();
2856
2859
if ( !$ value ) {
2857
- $ this ->error ( "expected " . $ name . " expression " );
2860
+ $ this ->Error ( "expected " . $ name . " expression " );
2858
2861
}
2859
2862
} elseif ( $ hasUnknown ) {
2860
2863
$ value = $ this ->parsePermissiveValue ( [ '{ ' , '; ' ] );
2861
2864
$ hasBlock = $ this ->input [$ this ->pos ] === '{ ' ;
2862
2865
if ( !$ value ) {
2863
2866
if ( !$ hasBlock && $ this ->input [$ this ->pos ] !== '; ' ) {
2864
- $ this ->error ( $ name . " rule is missing block or ending semi-colon " );
2867
+ $ this ->Error ( $ name . " rule is missing block or ending semi-colon " );
2865
2868
}
2866
2869
} elseif ( !$ value ->value ) {
2867
2870
$ value = null ;
0 commit comments