less 4.1.2 → 4.1.3

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.
@@ -139,11 +139,21 @@ var Parser = function Parser(context, imports, fileInfo) {
139
139
  //
140
140
  parse: function (str, callback, additionalData) {
141
141
  var root;
142
- var error = null;
142
+ var err = null;
143
143
  var globalVars;
144
144
  var modifyVars;
145
145
  var ignored;
146
146
  var preText = '';
147
+ // Optionally disable @plugin parsing
148
+ if (additionalData && additionalData.disablePluginRule) {
149
+ parsers.plugin = function () {
150
+ var dir = parserInput.$re(/^@plugin?\s+/);
151
+ if (dir) {
152
+ error('@plugin statements are not allowed when disablePluginRule is set to true');
153
+ }
154
+ };
155
+ }
156
+ ;
147
157
  globalVars = (additionalData && additionalData.globalVars) ? Parser.serializeVars(additionalData.globalVars) + "\n" : '';
148
158
  modifyVars = (additionalData && additionalData.modifyVars) ? "\n" + Parser.serializeVars(additionalData.modifyVars) : '';
149
159
  if (context.pluginManager) {
@@ -208,7 +218,7 @@ var Parser = function Parser(context, imports, fileInfo) {
208
218
  message += '. Possibly missing something';
209
219
  }
210
220
  }
211
- error = new less_error_1.default({
221
+ err = new less_error_1.default({
212
222
  type: 'Parse',
213
223
  message: message,
214
224
  index: endInfo.furthest,
@@ -216,7 +226,7 @@ var Parser = function Parser(context, imports, fileInfo) {
216
226
  }, imports);
217
227
  }
218
228
  var finish = function (e) {
219
- e = error || e || imports.error;
229
+ e = err || e || imports.error;
220
230
  if (e) {
221
231
  if (!(e instanceof less_error_1.default)) {
222
232
  e = new less_error_1.default(e, imports, fileInfo.filename);
@@ -1295,15 +1305,23 @@ var Parser = function Parser(context, imports, fileInfo) {
1295
1305
  var key;
1296
1306
  var val;
1297
1307
  var op;
1308
+ //
1309
+ // case-insensitive flag
1310
+ // e.g. [attr operator value i]
1311
+ //
1312
+ var cif;
1298
1313
  if (!(key = entities.variableCurly())) {
1299
1314
  key = expect(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/);
1300
1315
  }
1301
1316
  op = parserInput.$re(/^[|~*$^]?=/);
1302
1317
  if (op) {
1303
1318
  val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\w-]+/) || entities.variableCurly();
1319
+ if (val) {
1320
+ cif = parserInput.$re(/^[iIsS]/);
1321
+ }
1304
1322
  }
1305
1323
  expectChar(']');
1306
- return new (tree_1.default.Attribute)(key, op, val);
1324
+ return new (tree_1.default.Attribute)(key, op, val, cif);
1307
1325
  },
1308
1326
  //
1309
1327
  // The `block` rule is used by `ruleset` and `mixin.definition`.
@@ -1550,7 +1568,7 @@ var Parser = function Parser(context, imports, fileInfo) {
1550
1568
  var path;
1551
1569
  var features;
1552
1570
  var index = parserInput.i;
1553
- var dir = parserInput.$re(/^@import?\s+/);
1571
+ var dir = parserInput.$re(/^@import\s+/);
1554
1572
  if (dir) {
1555
1573
  var options = (dir ? this.importOptions() : null) || {};
1556
1574
  if ((path = this.entities.quoted() || this.entities.url())) {
@@ -1701,7 +1719,7 @@ var Parser = function Parser(context, imports, fileInfo) {
1701
1719
  var args;
1702
1720
  var options;
1703
1721
  var index = parserInput.i;
1704
- var dir = parserInput.$re(/^@plugin?\s+/);
1722
+ var dir = parserInput.$re(/^@plugin\s+/);
1705
1723
  if (dir) {
1706
1724
  args = this.pluginArgs();
1707
1725
  if (args) {