Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
changfeng committed Sep 4, 2022
1 parent 984f490 commit 7665089
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
16 changes: 9 additions & 7 deletions lib/LessParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,15 @@ module.exports = class LessParser extends Parser {
this.tokenizer.back(token);
}

this.atrule(this.tokenizer.nextToken());
this.lastNode.mixin = true;
this.lastNode.raws.identifier = identifier;

if (important) {
this.lastNode.important = true;
this.lastNode.raws.important = important;
if (this.lastNode) {
this.atrule(this.tokenizer.nextToken());
this.lastNode.mixin = true;
this.lastNode.raws.identifier = identifier;

if (important) {
this.lastNode.important = true;
this.lastNode.raws.important = important;
}
}
}

Expand Down
8 changes: 6 additions & 2 deletions lib/nodes/interpolation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

module.exports = {
interpolation(token) {
const tokens = [token, this.tokenizer.nextToken()];
const tokens = [token];
const validTypes = ['word', '}'];
const nextToken = this.tokenizer.nextToken();
if (newToken) {
tokens.push(newToken);
}

// look for @{ but not @[word]{
if (tokens[0][1].length > 1 || tokens[1][0] !== '{') {
if (tokens[0][1].length > 1 || (newToken && tokens[1][0] !== '{')) {
this.tokenizer.back(tokens[1]);
return false;
}
Expand Down

0 comments on commit 7665089

Please sign in to comment.