@@ -82,6 +82,10 @@ module.exports = class LessParser extends Parser {
8282 }
8383
8484 unknownWord ( tokens ) {
85+ // NOTE: keep commented for examining unknown structures
86+ // console.log('unknown', tokens);
87+ // console.log(this.root.first);
88+
8589 const [ first ] = tokens ;
8690
8791 // TODO: move this into a util function/file
@@ -92,7 +96,7 @@ module.exports = class LessParser extends Parser {
9296 let important = '' ;
9397
9498 // fix for #86. if rulesets are mixin params, they need to be converted to a brackets token
95- if ( bracketsIndex < 0 && firstParenIndex > 0 ) {
99+ if ( ( bracketsIndex < 0 || bracketsIndex > 3 ) && firstParenIndex > 0 ) {
96100 const lastParenIndex = tokens . findIndex ( ( t ) => t [ 0 ] === ')' ) ;
97101
98102 const contents = tokens . slice ( firstParenIndex , lastParenIndex + firstParenIndex ) ;
@@ -125,28 +129,14 @@ module.exports = class LessParser extends Parser {
125129 this . lastNode . mixin = true ;
126130 this . lastNode . raws . identifier = identifier ;
127131
128- // const importantIndex = tokens.findIndex((t) => importantPattern.test(t[1]));
129-
130132 if ( important ) {
131133 this . lastNode . important = true ;
132134 this . lastNode . raws . important = important ;
133135 }
134136
135- // if (importantIndex > 0) {
136- // nodes.splice(importantIndex, 1);
137- // [this.lastNode.raws.important] = this.lastNode.params.match(importantPattern);
138-
139- // this.lastNode.params = this.lastNode.params.replace(importantPattern, '');
140-
141- // const [spaces] = this.lastNode.params.match(/\s+$/) || [''];
142- // this.lastNode.raws.between = spaces;
143- // this.lastNode.params = this.lastNode.params.trim();
144- // }
145-
146137 return ;
147138 }
148- // NOTE: keep commented for examining unknown structures
149- // console.log('unknown', tokens);
139+
150140 super . unknownWord ( tokens ) ;
151141 }
152142} ;
0 commit comments