Comparing version 0.8.0 to 0.9.0
0.9.0 / 2011-03-18 | ||
================== | ||
* Added `-i, --interactive` for the Stylus REPL (eval stylus expressions, tab-completion etc) | ||
* Added link to vim syntax | ||
* Changed `p()` built-in to display parens | ||
* Changed `--compress -C` to `-c`, and `-css -c` is now `-C` | ||
* Fixed; preserve rest-arg expressions. Closes #194 | ||
* Fixed `*=` in selector, ex `[class*="foo"]` | ||
* Fixed `--watch` issue with growl, updated to 1.1.0. Closes #188 | ||
* Fixed negative floats when compressed. Closes #193 [reported by ludicco] | ||
0.8.0 / 2011-03-14 | ||
@@ -3,0 +15,0 @@ ================== |
@@ -411,10 +411,12 @@ | ||
/** | ||
* Inspect the given `node`. | ||
* Inspect the given `expr`. | ||
* | ||
* @param {Node} node | ||
* @param {Expression} expr | ||
* @api public | ||
*/ | ||
(exports.p = function(node){ | ||
console.log('\033[90minspect:\033[0m %s', node); | ||
(exports.p = function(expr){ | ||
expr = utils.unwrap(expr); | ||
console.log('\033[90minspect:\033[0m %s' | ||
, expr.toString().replace(/^\(|\)$/g, '')); | ||
return nodes.null; | ||
@@ -421,0 +423,0 @@ }).raw = true; |
@@ -81,2 +81,3 @@ | ||
var clone = new Expression(this.isList); | ||
clone.preserve = this.preserve; | ||
clone.lineno = this.lineno; | ||
@@ -138,7 +139,7 @@ for (var i = 0; i < this.nodes.length; ++i) { | ||
Expression.prototype.toString = function(){ | ||
return this.nodes.map(function(node){ | ||
return '(' + this.nodes.map(function(node){ | ||
return node.toString(); | ||
}).join(this.isList ? ', ' : ' '); | ||
}).join(this.isList ? ', ' : ' ') + ')'; | ||
}; | ||
@@ -37,2 +37,3 @@ | ||
, '*' | ||
, '*=' | ||
, '<' | ||
@@ -39,0 +40,0 @@ , '>' |
@@ -45,3 +45,4 @@ | ||
try { | ||
var ast = this.parser.parse(); | ||
var ast = this.parser.parse() | ||
, expr; | ||
this.evaluator = new Evaluator(ast, this.options); | ||
@@ -48,0 +49,0 @@ ast = this.evaluator.evaluate(); |
@@ -26,3 +26,3 @@ | ||
exports.version = '0.8.0'; | ||
exports.version = '0.9.0'; | ||
@@ -54,2 +54,9 @@ /** | ||
/** | ||
* Expose constructors. | ||
*/ | ||
exports.Parser = require('./parser'); | ||
exports.Evaluator = require('./visitor/evaluator'); | ||
/** | ||
* Convert the given `css` to `stylus` source. | ||
@@ -56,0 +63,0 @@ * |
@@ -162,3 +162,3 @@ | ||
* Takes an expressions with length of 1 | ||
* such as `(1 2 3)` and unwraps it to `1 2 3`. | ||
* such as `((1 2 3))` and unwraps it to `(1 2 3)`. | ||
* | ||
@@ -171,6 +171,7 @@ * @param {Expression} expr | ||
exports.unwrap = function(expr){ | ||
if (expr.preserve) return expr; | ||
if ('expression' != expr.nodeName) return expr; | ||
if (1 != expr.nodes.length) return expr; | ||
if ('expression' != expr.nodes[0].nodeName) return expr; | ||
return expr.nodes[0]; | ||
return exports.unwrap(expr.nodes[0]); | ||
}; |
@@ -226,6 +226,6 @@ | ||
// Zero is always '0' | ||
if (0 == unit.val) return '0'; | ||
if (0 == n) return '0'; | ||
// Omit leading '0' on floats | ||
if (float && n < 1) { | ||
return n.toString().substr(1) + type; | ||
if (float && n < 1 && n > -1) { | ||
return n.toString().replace('0.', '.') + type; | ||
} | ||
@@ -232,0 +232,0 @@ } |
@@ -48,3 +48,2 @@ | ||
this.options = options; | ||
this.setup(); | ||
this.calling = []; // TODO: remove, use stack | ||
@@ -125,2 +124,3 @@ }; | ||
Evaluator.prototype.evaluate = function(){ | ||
this.setup(); | ||
return this.visit(this.root); | ||
@@ -218,3 +218,3 @@ }; | ||
this.mixin(vals, block); | ||
return vals[vals.length - 1]; | ||
return vals[vals.length - 1] || nodes.null; | ||
}; | ||
@@ -591,3 +591,2 @@ | ||
// new block scope | ||
@@ -613,2 +612,3 @@ this.stack.push(new Frame(block)); | ||
} | ||
node.val.preserve = true; | ||
// argument default support | ||
@@ -615,0 +615,0 @@ } else { |
{ "name": "stylus" | ||
, "description": "Robust, expressive language which compiles to CSS" | ||
, "version": "0.8.0" | ||
, "version": "0.9.0" | ||
, "author": "TJ Holowaychuk <tj@vision-media.ca>" | ||
@@ -14,4 +14,4 @@ , "keywords": ["css", "parser", "style", "stylesheets", "jade", "language"] | ||
"cssom": "0.2.0" | ||
, "growl": "1.0.2" | ||
, "growl": "1.1.0" | ||
} | ||
} |
@@ -75,2 +75,3 @@ | ||
- TextMate [bundle](stylus/blob/master/docs/textmates.md) | ||
- VIM [Syntax](https://github.com/wavded/vim-stylus) | ||
@@ -77,0 +78,0 @@ ### Framework Support |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
193745
6677
118
+ Addedgrowl@1.1.0(transitive)
- Removedgrowl@1.0.2(transitive)
Updatedgrowl@1.1.0