stylus-source 0.39.0 → 0.39.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/vendor/lib/lexer.js +35 -7
- data/vendor/node_modules/cssom/package.json +5 -1
- data/vendor/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e057158d9472e3cc4624e8689fb850f838464d92
|
4
|
+
data.tar.gz: 3c58670f82f8224e32190ead8131aab57afe8bb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51930b64b5598168a81e152ab0f04a889715340295fb8425805a2b23fcaa6b8ae9eced40f190c2f90843950c546f4fabe9e0ee2633b2bb4142eb82f0695101d1
|
7
|
+
data.tar.gz: 9bd590c2526fb1611ef7a9a06f293c8b4197047c6abbdd847aef95fdd56962a0abb85692bd95c9d4dd6f44dd8765c323eaca120afa9e672d4b0ab57158ba4e2d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.39.
|
1
|
+
0.39.1
|
data/vendor/lib/lexer.js
CHANGED
@@ -147,6 +147,17 @@ Lexer.prototype = {
|
|
147
147
|
return tok;
|
148
148
|
},
|
149
149
|
|
150
|
+
/**
|
151
|
+
* Check if the current token is a part of class selector.
|
152
|
+
*
|
153
|
+
* @return {Boolean}
|
154
|
+
* @api private
|
155
|
+
*/
|
156
|
+
|
157
|
+
isPartOfSelector: function() {
|
158
|
+
return !!(this.prev && '.' == this.prev.type);
|
159
|
+
},
|
160
|
+
|
150
161
|
/**
|
151
162
|
* Fetch next token.
|
152
163
|
*
|
@@ -342,10 +353,16 @@ Lexer.prototype = {
|
|
342
353
|
*/
|
343
354
|
|
344
355
|
null: function() {
|
345
|
-
var captures
|
356
|
+
var captures
|
357
|
+
, tok;
|
346
358
|
if (captures = /^(null)\b[ \t]*/.exec(this.str)) {
|
347
359
|
this.skip(captures);
|
348
|
-
|
360
|
+
if (this.isPartOfSelector()) {
|
361
|
+
tok = new Token('ident', new nodes.Ident('null'));
|
362
|
+
} else {
|
363
|
+
tok = new Token('null', nodes.null);
|
364
|
+
}
|
365
|
+
return tok;
|
349
366
|
}
|
350
367
|
},
|
351
368
|
|
@@ -359,11 +376,17 @@ Lexer.prototype = {
|
|
359
376
|
*/
|
360
377
|
|
361
378
|
keyword: function() {
|
362
|
-
var captures
|
379
|
+
var captures
|
380
|
+
, tok;
|
363
381
|
if (captures = /^(return|if|else|unless|for|in)\b[ \t]*/.exec(this.str)) {
|
364
382
|
var keyword = captures[1];
|
365
383
|
this.skip(captures);
|
366
|
-
|
384
|
+
if (this.isPartOfSelector()) {
|
385
|
+
tok = new Token('ident', new nodes.Ident(keyword));
|
386
|
+
} else {
|
387
|
+
tok = new Token(keyword, keyword);
|
388
|
+
}
|
389
|
+
return tok;
|
367
390
|
}
|
368
391
|
},
|
369
392
|
|
@@ -379,12 +402,17 @@ Lexer.prototype = {
|
|
379
402
|
*/
|
380
403
|
|
381
404
|
namedop: function() {
|
382
|
-
var captures
|
405
|
+
var captures
|
406
|
+
, tok;
|
383
407
|
if (captures = /^(not|and|or|is a|is defined|isnt|is not|is)(?!-)\b([ \t]*)/.exec(this.str)) {
|
384
408
|
var op = captures[1];
|
385
409
|
this.skip(captures);
|
386
|
-
|
387
|
-
|
410
|
+
if (this.isPartOfSelector()) {
|
411
|
+
tok = new Token('ident', new nodes.Ident(op));
|
412
|
+
} else {
|
413
|
+
op = alias[op] || op;
|
414
|
+
tok = new Token(op, op);
|
415
|
+
}
|
388
416
|
tok.space = captures[2];
|
389
417
|
return tok;
|
390
418
|
}
|
@@ -42,5 +42,9 @@
|
|
42
42
|
"readme": "# CSSOM\n\nCSSOM.js is a CSS parser written in pure JavaScript. It also a partial implementation of [CSS Object Model](http://dev.w3.org/csswg/cssom/). \n\n CSSOM.parse(\"body {color: black}\")\n -> {\n cssRules: [\n {\n selectorText: \"body\",\n style: {\n 0: \"color\",\n color: \"black\",\n length: 1\n }\n }\n ]\n }\n\n\n## [Parser demo](http://nv.github.com/CSSOM/docs/parse.html)\n\nWorks well in Google Chrome 6+, Safari 5+, Firefox 3.6+, Opera 10.63+.\nDoesn't work in IE < 9 because of unsupported getters/setters.\n\nTo use CSSOM.js in the browser you might want to build a one-file version with [Jake](http://github.com/mde/node-jake):\n\n ➤ jake\n build/CSSOM.js is done\n\nTo use it with Node.js:\n\n npm install cssom\n\n## [Specs](http://nv.github.com/CSSOM/spec/)\n",
|
43
43
|
"readmeFilename": "README.mdown",
|
44
44
|
"_id": "cssom@0.2.5",
|
45
|
-
"
|
45
|
+
"dist": {
|
46
|
+
"shasum": "a290e1d4d09149286a0fdc3198126a0f9a49712a"
|
47
|
+
},
|
48
|
+
"_from": "cssom@0.2.x",
|
49
|
+
"_resolved": "https://registry.npmjs.org/cssom/-/cssom-0.2.5.tgz"
|
46
50
|
}
|
data/vendor/package.json
CHANGED