stylus-source 0.21.1 → 0.21.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.21.1
1
+ 0.21.2
data/vendor/History.md CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ 0.21.2 / 2011-12-22
3
+ ==================
4
+
5
+ * Fixed literal / within function call. Closes #432
6
+
2
7
  0.21.1 / 2011-12-20
3
8
  ==================
4
9
 
@@ -131,7 +131,7 @@ module.exports = function(options){
131
131
 
132
132
  // Compile to cssPath
133
133
  function compile() {
134
- if (debug) log('read', stylusPath);
134
+ if (debug) log('read', cssPath);
135
135
  fs.readFile(stylusPath, 'utf8', function(err, str){
136
136
  if (err) return error(err);
137
137
  var style = options.compile(str, stylusPath);
data/vendor/lib/parser.js CHANGED
@@ -1158,8 +1158,10 @@ Parser.prototype = {
1158
1158
  if ('url' == this.peek().val.name) return this.url();
1159
1159
  var name = this.expect('function').val.name;
1160
1160
  this.state.push('function arguments');
1161
+ this.parens++;
1161
1162
  var args = this.args();
1162
1163
  this.expect(')');
1164
+ this.parens--;
1163
1165
  this.state.pop();
1164
1166
  return new nodes.Call(name, args);
1165
1167
  },
data/vendor/lib/stylus.js CHANGED
@@ -24,7 +24,7 @@ exports = module.exports = render;
24
24
  * Library version.
25
25
  */
26
26
 
27
- exports.version = '0.21.1';
27
+ exports.version = '0.21.2';
28
28
 
29
29
  /**
30
30
  * Expose nodes.
@@ -51,6 +51,7 @@ var Evaluator = module.exports = function Evaluator(root, options) {
51
51
  this.options = options;
52
52
  this.calling = []; // TODO: remove, use stack
53
53
  this.importStack = [];
54
+ this.return = 0;
54
55
  };
55
56
 
56
57
  /**
@@ -252,8 +253,7 @@ Evaluator.prototype.visitFunction = function(fn){
252
253
  */
253
254
 
254
255
  Evaluator.prototype.visitEach = function(each){
255
- var _ = this.return;
256
- this.return = true;
256
+ this.return++;
257
257
  var expr = utils.unwrap(this.visit(utils.unwrap(each.expr)))
258
258
  , len = expr.nodes.length
259
259
  , val = new nodes.Ident(each.val)
@@ -262,7 +262,7 @@ Evaluator.prototype.visitEach = function(each){
262
262
  , block = this.currentBlock
263
263
  , vals = []
264
264
  , body;
265
- this.return = _;
265
+ this.return--;
266
266
 
267
267
  each.block.scope = false;
268
268
  for (var i = 0; i < len; ++i) {
@@ -317,13 +317,12 @@ Evaluator.prototype.visitCall = function(call){
317
317
  if ('expression' == fn.nodeName) fn = fn.first;
318
318
 
319
319
  // Evaluate arguments
320
- var _ = this.return;
321
- this.return = true;
320
+ this.return++;
322
321
  var args = this.visit(call.args);
323
322
  for (var key in call.args.map) {
324
323
  call.args.map[key] = this.visit(call.args.map[key]);
325
324
  }
326
- this.return = _;
325
+ this.return--;
327
326
 
328
327
  // Built-in
329
328
  if (fn.fn) {
@@ -356,10 +355,9 @@ Evaluator.prototype.visitIdent = function(ident){
356
355
  return val ? this.visit(val) : ident;
357
356
  // Assign
358
357
  } else {
359
- var _ = this.return;
360
- this.return = true;
358
+ this.return++;
361
359
  ident.val = this.visit(ident.val);
362
- this.return = _;
360
+ this.return--;
363
361
  this.currentScope.add(ident);
364
362
  return ident.val;
365
363
  }
@@ -373,13 +371,12 @@ Evaluator.prototype.visitBinOp = function(binop){
373
371
  // Special-case "is defined" pseudo binop
374
372
  if ('is defined' == binop.op) return this.isDefined(binop.left);
375
373
 
376
- var _ = this.return;
377
- this.return = true;
374
+ this.return++;
378
375
  // Visit operands
379
376
  var op = binop.op
380
377
  , left = this.visit(binop.left)
381
378
  , right = this.visit(binop.right);
382
- this.return = _;
379
+ this.return--;
383
380
 
384
381
  // HACK: ternary
385
382
  var val = binop.val
@@ -485,14 +482,13 @@ Evaluator.prototype.visitProperty = function(prop){
485
482
  return ret;
486
483
  // Regular property
487
484
  } else {
488
- var _ = this.return;
489
- this.return = true;
485
+ this.return++;
490
486
  prop.name = name;
491
487
  prop.literal = true;
492
488
  this.property = prop;
493
489
  prop.expr = this.visit(prop.expr);
494
490
  delete this.property;
495
- this.return = _;
491
+ this.return--;
496
492
  return prop;
497
493
  }
498
494
  };
@@ -542,13 +538,12 @@ Evaluator.prototype.visitBlock = function(block){
542
538
 
543
539
  Evaluator.prototype.visitIf = function(node){
544
540
  var ret
545
- , _ = this.return
546
541
  , block = this.currentBlock
547
542
  , negate = node.negate;
548
543
 
549
- this.return = true;
544
+ this.return++;
550
545
  var ok = this.visit(node.cond).first.toBoolean();
551
- this.return = _;
546
+ this.return--;
552
547
 
553
548
  // Evaluate body
554
549
  if (negate) {
@@ -593,8 +588,7 @@ Evaluator.prototype.visitIf = function(node){
593
588
  */
594
589
 
595
590
  Evaluator.prototype.visitImport = function(imported){
596
- var _ = this.return;
597
- this.return = true;
591
+ this.return++;
598
592
 
599
593
  var root = this.root
600
594
  , Parser = require('../parser')
@@ -603,7 +597,7 @@ Evaluator.prototype.visitImport = function(imported){
603
597
  , found
604
598
  , literal;
605
599
 
606
- this.return = _;
600
+ this.return--;
607
601
 
608
602
  // url() passed
609
603
  if ('url' == path.name) return imported;
data/vendor/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  { "name": "stylus"
2
2
  , "description": "Robust, expressive, and feature-rich CSS superset"
3
- , "version": "0.21.1"
3
+ , "version": "0.21.2"
4
4
  , "author": "TJ Holowaychuk <tj@vision-media.ca>"
5
5
  , "keywords": ["css", "parser", "style", "stylesheets", "jade", "language"]
6
6
  , "repository": "git://github.com/learnboost/stylus"
@@ -0,0 +1,5 @@
1
+ body {
2
+ foo: 4px;
3
+ foo: foo(4);
4
+ foo: 4px;
5
+ }
@@ -0,0 +1,4 @@
1
+ body
2
+ foo: unit(16 / 4, px)
3
+ foo: foo(16 / 4)
4
+ foo: (16/4)px
@@ -10,13 +10,7 @@
10
10
  // h1[title]
11
11
  // background: brown
12
12
 
13
- html:lang(en) a
14
- foo: 'bar'
15
-
16
- html:lang(en) a {
17
- foo: 'bar';
18
- }
19
-
20
- ul li:nth-child(2) a {
21
- foo: 'bar';
22
- }
13
+ body
14
+ foo: unit(16 / 4, px)
15
+ foo: foo(16 / 4)
16
+ foo: (16/4)px
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stylus-source
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.1
4
+ version: 0.21.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-20 00:00:00.000000000 Z
12
+ date: 2011-12-30 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Robust, expressive, and feature-rich CSS superset. This gem packages
15
15
  up stylus for use with the stylus gem.
@@ -560,6 +560,8 @@ files:
560
560
  - vendor/test/cases/regression.415.styl
561
561
  - vendor/test/cases/regression.420.css
562
562
  - vendor/test/cases/regression.420.styl
563
+ - vendor/test/cases/regression.432.css
564
+ - vendor/test/cases/regression.432.styl
563
565
  - vendor/test/cases/regression.440.css
564
566
  - vendor/test/cases/regression.440.styl
565
567
  - vendor/test/cases/regression.449.css