mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Change extend format to :extend(.class); - part 1 - support for stand-alone &:extend(.class);
This commit is contained in:
@@ -525,9 +525,8 @@ less.Parser = function Parser(env) {
|
||||
primary: function () {
|
||||
var node, root = [];
|
||||
|
||||
while ((node = $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
|
||||
$(this.mixin.call) || $(this.comment) || $(this.directive) ||
|
||||
$(this.extend))
|
||||
while ((node = $(this.extend) || $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
|
||||
$(this.mixin.call) || $(this.comment) || $(this.directive))
|
||||
|| $(/^[\s\n]+/) || $(/^;+/)) {
|
||||
node && root.push(node);
|
||||
}
|
||||
@@ -814,15 +813,15 @@ less.Parser = function Parser(env) {
|
||||
extend: function() {
|
||||
var elements = [], e, args, index = i;
|
||||
|
||||
if (input.charAt(i) !== '+') { return; }
|
||||
if (!$(/^&:extend\(/)) { return; }
|
||||
|
||||
while (e = $(/^\+\+[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
|
||||
elements.push(new(tree.Element)(null, e.slice(2), i));
|
||||
while (e = $(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
|
||||
elements.push(new(tree.Element)(null, e, i));
|
||||
}
|
||||
|
||||
expect(/^\);/);
|
||||
|
||||
if (elements.length > 0 && ($(';') || peek('}'))) {
|
||||
return new(tree.Extend)(elements, index);
|
||||
}
|
||||
return new(tree.Extend)(elements, index);
|
||||
},
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user