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

css-tree

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-tree - npm Package Compare versions

Comparing version 1.0.0-alpha.32 to 1.0.0-alpha.33

5

CHANGELOG.md

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

## 1.0.0-alpha.33 (July 12, 2019)
- Lexer
- Fixed low priority productions matching by changing an approach for robust one (#103)
## 1.0.0-alpha.32 (July 12, 2019)

@@ -2,0 +7,0 @@

6

lib/lexer/match-graph.js

@@ -73,6 +73,2 @@ var parse = require('./grammar/parse');

);
if (i > 0) {
result.checkStash = true;
}
};

@@ -286,3 +282,2 @@

result.checkStash = true;
result.then = createCondition(

@@ -321,3 +316,2 @@ MATCH,

);
result.checkStash = true;
}

@@ -324,0 +318,0 @@ }

44

lib/lexer/match.js

@@ -102,3 +102,3 @@ var hasOwnProperty = Object.prototype.hasOwnProperty;

thenStack: thenStack,
tokenCursor: tokenIndex,
tokenIndex: tokenIndex,
token: token,

@@ -131,7 +131,4 @@ prev: prev

moveToNextToken();
syntaxStash = null;
if (syntaxStash !== null) {
syntaxStash = null;
}
if (tokenIndex > longestMatch) {

@@ -248,13 +245,15 @@ longestMatch = tokenIndex;

case 'Mismatch':
if (elseStack === null) {
if (syntaxStash === null || syntaxStash === false) {
// no else branches and no stashed syntax -> break the main loop
// return a result - MISMATCH
exitReason = EXIT_REASON_MISMATCH;
break;
// when some syntax is stashed
if (syntaxStash !== null && syntaxStash !== false) {
// there is no else branches or a branch reduce match stack
if (elseStack === null || tokenIndex > elseStack.tokenIndex) {
// restore state from the stash
elseStack = syntaxStash;
syntaxStash = false; // disable stashing
}
// restore from the stash
elseStack = syntaxStash;
syntaxStash = false; // disable stashing
} else if (elseStack === null) {
// no else branches -> break the main loop
// return a result - MISMATCH
exitReason = EXIT_REASON_MISMATCH;
break;
}

@@ -269,3 +268,3 @@

matchStack = elseStack.matchStack;
tokenIndex = elseStack.tokenCursor;
tokenIndex = elseStack.tokenIndex;
token = elseStack.token;

@@ -282,15 +281,2 @@

case 'If':
if (state.checkStash) {
if (syntaxStash !== null) {
if (syntaxStash !== false) {
elseStack = syntaxStash;
syntaxStash = false; // disable stashing
state = MISMATCH;
break;
}
syntaxStash = null;
}
}
// IMPORTANT: else stack push must go first,

@@ -297,0 +283,0 @@ // since it stores the state of thenStack before changes

{
"name": "css-tree",
"version": "1.0.0-alpha.32",
"version": "1.0.0-alpha.33",
"description": "CSSTree is a tool set to work with CSS, including fast detailed parser (string->AST), walker (AST traversal), generator (AST->string) and lexer (validation and matching) based on knowledge of spec and browser implementations",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

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