Comparing version 0.39.0 to 0.39.1
@@ -151,2 +151,13 @@ | ||
/** | ||
* Check if the current token is a part of class selector. | ||
* | ||
* @return {Boolean} | ||
* @api private | ||
*/ | ||
isPartOfSelector: function() { | ||
return !!(this.prev && '.' == this.prev.type); | ||
}, | ||
/** | ||
* Fetch next token. | ||
@@ -346,6 +357,12 @@ * | ||
null: function() { | ||
var captures; | ||
var captures | ||
, tok; | ||
if (captures = /^(null)\b[ \t]*/.exec(this.str)) { | ||
this.skip(captures); | ||
return new Token('null', nodes.null); | ||
if (this.isPartOfSelector()) { | ||
tok = new Token('ident', new nodes.Ident('null')); | ||
} else { | ||
tok = new Token('null', nodes.null); | ||
} | ||
return tok; | ||
} | ||
@@ -364,7 +381,13 @@ }, | ||
keyword: function() { | ||
var captures; | ||
var captures | ||
, tok; | ||
if (captures = /^(return|if|else|unless|for|in)\b[ \t]*/.exec(this.str)) { | ||
var keyword = captures[1]; | ||
this.skip(captures); | ||
return new Token(keyword, keyword); | ||
if (this.isPartOfSelector()) { | ||
tok = new Token('ident', new nodes.Ident(keyword)); | ||
} else { | ||
tok = new Token(keyword, keyword); | ||
} | ||
return tok; | ||
} | ||
@@ -385,8 +408,13 @@ }, | ||
namedop: function() { | ||
var captures; | ||
var captures | ||
, tok; | ||
if (captures = /^(not|and|or|is a|is defined|isnt|is not|is)(?!-)\b([ \t]*)/.exec(this.str)) { | ||
var op = captures[1]; | ||
this.skip(captures); | ||
op = alias[op] || op; | ||
var tok = new Token(op, op); | ||
if (this.isPartOfSelector()) { | ||
tok = new Token('ident', new nodes.Ident(op)); | ||
} else { | ||
op = alias[op] || op; | ||
tok = new Token(op, op); | ||
} | ||
tok.space = captures[2]; | ||
@@ -393,0 +421,0 @@ return tok; |
{ | ||
"name": "stylus", | ||
"description": "Robust, expressive, and feature-rich CSS superset", | ||
"version": "0.39.0", | ||
"version": "0.39.1", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
251557
9546