Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stylus

Package Overview
Dependencies
Maintainers
0
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylus - npm Package Compare versions

Comparing version 0.5.2 to 0.5.3

lib/._lexer.js

6

._History.md

@@ -1,4 +0,4 @@

Mac OS X  2��ATTRY���!�!com.macromates.caret{
column = 0;
line = 6;
Mac OS X  2��ATTRi�o��"�"com.macromates.caret{
column = 60;
line = 4;
}

@@ -1,1 +0,1 @@

Mac OS X  2��ATTRY��� � com.macromates.caretx���R������<[k0?'3/«��
Mac OS X  2��ATTRi�q�� � com.macromates.caretx���R������<[k0?'3/«��

@@ -1,4 +0,4 @@

Mac OS X  2��ATTRY���"�"com.macromates.caret{
Mac OS X  2��ATTRi�v��"�"com.macromates.caret{
column = 21;
line = 2;
}
0.5.3 / 2011-02-17
==================
* Added `in` operator. `3 in nums`, `padding in props` etc
* Added `Expression#hash`, hashing all of the nodes in order
* Added tests for conditionals with braces. Closes #136
* Fixed ids that are also valid colors. Closes #137
0.5.2 / 2011-02-15

@@ -3,0 +11,0 @@ ==================

@@ -1,4 +0,6 @@

Mac OS X  2��ATTRY���$�$com.macromates.caret{
column = 16;
line = 260;
Mac OS X  2��ATTRi����0� com.macromates.bookmarked_lines�$com.macromates.caret(
1258
){
column = 41;
line = 796;
}

@@ -1,4 +0,4 @@

Mac OS X  2��ATTRY���#�#com.macromates.caret{
Mac OS X  2��ATTRi����#�#com.macromates.caret{
column = 24;
line = 25;
}

@@ -607,3 +607,3 @@

var captures;
if (captures = /^#([a-f-A-F0-9]{3}) */.exec(this.str)) {
if (captures = /^#([a-fA-F0-9]{3}) */.exec(this.str)) {
this.skip(captures);

@@ -613,4 +613,6 @@ var rgb = captures[1]

, g = parseInt(rgb[1] + rgb[1], 16)
, b = parseInt(rgb[2] + rgb[2], 16);
return new Token('color', new nodes.Color(r, g, b, 1));
, b = parseInt(rgb[2] + rgb[2], 16)
, color = new nodes.Color(r, g, b, 1);
color.raw = captures[0];
return new Token('color', color);
}

@@ -625,3 +627,3 @@ },

var captures;
if (captures = /^#([a-f-A-F0-9]{6}) */.exec(this.str)) {
if (captures = /^#([a-fA-F0-9]{6}) */.exec(this.str)) {
this.skip(captures);

@@ -631,4 +633,6 @@ var rgb = captures[1]

, g = parseInt(rgb.substr(2, 2), 16)
, b = parseInt(rgb.substr(4, 2), 16);
return new Token('color', new nodes.Color(r, g, b, 1));
, b = parseInt(rgb.substr(4, 2), 16)
, color = new nodes.Color(r, g, b, 1);
color.raw = captures[0];
return new Token('color', color);
}

@@ -635,0 +639,0 @@ },

@@ -54,2 +54,15 @@

/**
* Hash all the nodes in order.
*
* @return {String}
* @api public
*/
Expression.prototype.__defineGetter__('hash', function(){
return this.nodes.map(function(node){
return node.hash;
}).join('::');
});
/**
* Inherit from `Node.prototype`.

@@ -56,0 +69,0 @@ */

@@ -13,2 +13,3 @@

var Evaluator = require('../visitor/evaluator')
, utils = require('../utils')
, nodes = require('./');

@@ -127,2 +128,12 @@

: right;
case 'in':
var vals = utils.unwrap(right).nodes
, hash = this.hash;
if (!vals) throw new Error('"in" given invalid right-hand operand, expecting an expression');
for (var i = 0, len = vals.length; i < len; ++i) {
if (hash == vals[i].hash) {
return nodes.true;
}
}
return nodes.false;
case '&&':

@@ -129,0 +140,0 @@ var a = this.toBoolean()

@@ -668,2 +668,3 @@

case '?':
case 'in':
case 'is a':

@@ -797,3 +798,3 @@ case 'is defined':

case 'string': val = tok.val.toString(); break;
case 'color': val = tok.val.toString(); break;
case 'color': val = tok.val.raw; break;
case 'space': val = ' '; break;

@@ -830,3 +831,4 @@ default: val = tok.val;

get assignment() {
var node
var op
, node
, name = this.id.name;

@@ -1062,3 +1064,3 @@

/**
* relational (('==' | '!=') relational)*
* in (('==' | '!=') in)*
*/

@@ -1068,7 +1070,7 @@

var op
, node = this.relational;
, node = this.in;
while (op = this.accept('==') || this.accept('!=')) {
this.operand = true;
if (!node) throw new Error('illegal unary ' + op);
node = new nodes.BinOp(op.type, node, this.relational);
node = new nodes.BinOp(op.type, node, this.in);
this.operand = false;

@@ -1078,2 +1080,17 @@ }

},
/**
* relational ('in' relational)*
*/
get in() {
var node = this.relational;
while (this.accept('in')) {
this.operand = true;
if (!node) throw new Error('illegal unary in');
node = new nodes.BinOp('in', node, this.relational);
this.operand = false;
}
return node;
},

@@ -1080,0 +1097,0 @@ /**

@@ -26,3 +26,3 @@

exports.version = '0.5.2';
exports.version = '0.5.3';

@@ -29,0 +29,0 @@ /**

@@ -263,3 +263,3 @@

// First node in expression
if ('[]' != op) {
if (!~['[]', 'in'].indexOf(op)) {
left = left.first;

@@ -272,2 +272,3 @@ right = right.first;

case '[]':
case 'in':
case '||':

@@ -274,0 +275,0 @@ case '&&':

{ "name": "stylus"
, "description": "Robust, expressive language which compiles to CSS"
, "version": "0.5.2"
, "version": "0.5.3"
, "author": "TJ Holowaychuk <tj@vision-media.ca>"

@@ -5,0 +5,0 @@ , "keywords": ["css", "parser", "style", "stylesheets", "jade", "language"]

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc