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

jison

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jison - npm Package Compare versions

Comparing version 0.3.6 to 0.3.7

2

lib/jison/ebnf.js

@@ -43,3 +43,3 @@ var EBNF = (function(){

var parser = new require('jison').Parser(grammar);
var parser = new require('../jison').Parser(grammar);

@@ -46,0 +46,0 @@ var transformExpression = function(e, opts, emit) {

@@ -47,3 +47,3 @@ // Basic RegExp Lexer

}
m = new RegExp("^"+m, caseless ? 'i':'');
m = new RegExp("^(?:"+m+")", caseless ? 'i':'');
}

@@ -105,2 +105,6 @@ newRules.push(m);

if (dict.options && dict.options.flex) {
dict.rules.push([".", "console.log(yytext);"]);
}
this.rules = prepareRules(dict.rules, dict.macros, actions, tokens && toks, this.conditions, this.options["case-insensitive"]);

@@ -107,0 +111,0 @@ var fun = actions.join("\n");

@@ -5,3 +5,3 @@ {

"description": "A parser generator with Bison's API",
"version": "0.3.6",
"version": "0.3.7",
"keywords": [

@@ -8,0 +8,0 @@ "jison",

@@ -757,1 +757,34 @@ var RegExpLexer = require("../setup").RegExpLexer,

};
exports["test flex mode default rule"] = function() {
var dict = {
rules: [
["x", "return 'X';" ]
],
options: {flex: true}
};
var input = "xyx";
var lexer = new RegExpLexer(dict);
lexer.setInput(input);
assert.equal(lexer.lex(), "X");
assert.equal(lexer.lex(), "X");
};
exports["test pipe precedence"] = function() {
var dict = {
rules: [
["x|y", "return 'X_Y';" ],
[".", "return 'N';"]
]
};
var input = "xny";
var lexer = new RegExpLexer(dict);
lexer.setInput(input);
assert.equal(lexer.lex(), "X_Y");
assert.equal(lexer.lex(), "N");
assert.equal(lexer.lex(), "X_Y");
};
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