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

postcss-wee-syntax

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-wee-syntax - npm Package Compare versions

Comparing version 2.0.1 to 2.0.3

npm-shrinkwrap.json

3

lib/parse.js

@@ -10,6 +10,5 @@ 'use strict';

parser.tokenize();
parser.loop();
parser.parse();
return parser.root;
};

@@ -29,19 +29,19 @@ const BaseParser = require('postcss/lib/parser');

class Parser extends BaseParser {
other() {
var token = void 0;
var end = false;
var type = null;
var colon = false;
var bracket = null;
var brackets = [];
var hasBracket = false;
other(start) {
let end = false;
let type = null;
let colon = false;
let bracket = null;
let brackets = [];
let hasBracket = false;
let tokens = [];
let token = start;
var start = this.pos;
while (this.pos < this.tokens.length) {
token = this.tokens[this.pos];
while (token) {
type = token[0];
tokens.push(token);
if (type === '(' || type === '[') {
if (!bracket) bracket = token;
if (! bracket) bracket = token;
brackets.push(type === '(' ? ')' : ']');

@@ -52,50 +52,49 @@ hasBracket = true;

} else if (brackets.length === 0) {
if (type === ';') {
if (colon) {
this.decl(this.tokens.slice(start, this.pos + 1));
if ( type === ';' ) {
if ( colon ) {
this.decl(tokens);
return;
} else if (hasBracket) {
this.mixin(tokens); // TODO: this.tokens.slice(start, this.pos + 1)
return;
} else if (hasBracket) {
this.mixin(this.tokens.slice(start, this.pos + 1));
return;
} else {
break;
}
} else if (type === '{') {
this.rule(this.tokens.slice(start, this.pos + 1));
return;
} else if (type === '}') {
this.pos -= 1;
end = true;
break;
} else if (type === ':') {
colon = true;
}
} else if (type === brackets[brackets.length - 1]) {
brackets.pop();
if (brackets.length === 0) bracket = null;
}
} else if ( type === '{' ) {
this.rule(tokens);
return;
this.pos += 1;
}
if (this.pos === this.tokens.length) {
this.pos -= 1;
end = true;
}
} else if ( type === '}' ) {
this.tokenizer.back(tokens.pop());
end = true;
break;
if (brackets.length > 0) this.unclosedBracket(bracket);
if (end && colon) {
while (this.pos > start) {
token = this.tokens[this.pos][0];
if (token !== 'space' && token !== 'comment') break;
this.pos -= 1;
}
this.decl(this.tokens.slice(start, this.pos + 1));
return;
} else if ( type === ':' ) {
colon = true;
}
} else if ( type === brackets[brackets.length - 1] ) {
brackets.pop();
if ( brackets.length === 0 ) bracket = null;
}
token = this.tokenizer.nextToken();
}
this.unknownWord(start);
if ( this.tokenizer.endOfFile() ) end = true;
if ( brackets.length > 0 ) this.unclosedBracket(bracket);
if ( end && colon ) {
while ( tokens.length ) {
token = tokens[tokens.length - 1][0];
if ( token !== 'space' && token !== 'comment' ) break;
this.tokenizer.back(tokens.pop());
}
this.decl(tokens);
return;
} else {
this.unknownWord(tokens);
}
}
mixin(tokens) {
mixin(tokens) {
let node = new Mixin(),

@@ -102,0 +101,0 @@ last;

{
"name": "postcss-wee-syntax",
"version": "2.0.1",
"version": "2.0.3",
"description": "Custom syntax used in the minimal front-end framework",

@@ -28,10 +28,10 @@ "main": "index.js",

"devDependencies": {
"chai": "^3.5.0",
"chai": "^4.1.1",
"istanbul": "^0.4.5",
"mocha": "^3.2.0",
"postcss-parser-tests": "^5.0.10"
"postcss-parser-tests": "^6.0.2"
},
"dependencies": {
"postcss": "^5.2.6"
"postcss": "^6.0.9"
}
}
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