less 4.2.1 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,8 @@ var parser_input_1 = tslib_1.__importDefault(require("./parser-input"));
8
8
  var utils = tslib_1.__importStar(require("../utils"));
9
9
  var function_registry_1 = tslib_1.__importDefault(require("../functions/function-registry"));
10
10
  var atrule_syntax_1 = require("../tree/atrule-syntax");
11
+ var selector_1 = tslib_1.__importDefault(require("../tree/selector"));
12
+ var anonymous_1 = tslib_1.__importDefault(require("../tree/anonymous"));
11
13
  //
12
14
  // less.js - parser
13
15
  //
@@ -1172,9 +1174,26 @@ var Parser = function Parser(context, imports, fileInfo, currentIndex) {
1172
1174
  if (!e) {
1173
1175
  parserInput.save();
1174
1176
  if (parserInput.$char('(')) {
1175
- if ((v = this.selector(false)) && parserInput.$char(')')) {
1176
- e = new (tree_1.default.Paren)(v);
1177
- parserInput.forget();
1177
+ if ((v = this.selector(false))) {
1178
+ var selectors = [];
1179
+ while (parserInput.$char(',')) {
1180
+ selectors.push(v);
1181
+ selectors.push(new anonymous_1.default(','));
1182
+ v = this.selector(false);
1183
+ }
1184
+ selectors.push(v);
1185
+ if (parserInput.$char(')')) {
1186
+ if (selectors.length > 1) {
1187
+ e = new (tree_1.default.Paren)(new selector_1.default(selectors));
1188
+ }
1189
+ else {
1190
+ e = new (tree_1.default.Paren)(v);
1191
+ }
1192
+ parserInput.forget();
1193
+ }
1194
+ else {
1195
+ parserInput.restore('Missing closing \')\'');
1196
+ }
1178
1197
  }
1179
1198
  else {
1180
1199
  parserInput.restore('Missing closing \')\'');
@@ -1265,6 +1284,9 @@ var Parser = function Parser(context, imports, fileInfo, currentIndex) {
1265
1284
  error('Extend can only be used at the end of selector');
1266
1285
  }
1267
1286
  c = parserInput.currentChar();
1287
+ if (Array.isArray(e)) {
1288
+ e.forEach(function (ele) { return elements.push(ele); });
1289
+ }
1268
1290
  if (elements) {
1269
1291
  elements.push(e);
1270
1292
  }
@@ -1439,7 +1461,12 @@ var Parser = function Parser(context, imports, fileInfo, currentIndex) {
1439
1461
  merge = !isVariable && name.length > 1 && name.pop().value;
1440
1462
  // Custom property values get permissive parsing
1441
1463
  if (name[0].value && name[0].value.slice(0, 2) === '--') {
1442
- value = this.permissiveValue(/[;}]/);
1464
+ if (parserInput.$char(';')) {
1465
+ value = new anonymous_1.default('');
1466
+ }
1467
+ else {
1468
+ value = this.permissiveValue(/[;}]/);
1469
+ }
1443
1470
  }
1444
1471
  // Try to store values as anonymous
1445
1472
  // If we need the value later we'll re-parse it in ruleset.parseValue
@@ -1563,7 +1590,9 @@ var Parser = function Parser(context, imports, fileInfo, currentIndex) {
1563
1590
  }
1564
1591
  // Treat like quoted values, but replace vars like unquoted expressions
1565
1592
  var quote = new tree_1.default.Quoted('\'', item, true, index, fileInfo);
1566
- quote.variableRegex = /@([\w-]+)/g;
1593
+ if (!item.startsWith('@{')) {
1594
+ quote.variableRegex = /@([\w-]+)/g;
1595
+ }
1567
1596
  quote.propRegex = /\$([\w-]+)/g;
1568
1597
  result.push(quote);
1569
1598
  }
@@ -2213,7 +2242,7 @@ var Parser = function Parser(context, imports, fileInfo, currentIndex) {
2213
2242
  var index = parserInput.i;
2214
2243
  do {
2215
2244
  e = this.comment();
2216
- if (e) {
2245
+ if (e && !e.isLineComment) {
2217
2246
  entities.push(e);
2218
2247
  continue;
2219
2248
  }