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.12 to 0.4.0

entry.js

39

lib/jison.js

@@ -5,7 +5,13 @@ // Jison, an LR(0), SLR(1), LARL(1), LR(1) Parser Generator

var typal = require('./jison/util/typal').typal,
Set = require('./jison/util/set').Set,
RegExpLexer = require('./jison/lexer').RegExpLexer;
var typal = require('./util/typal').typal;
var Set = require('./util/set').Set;
var Lexer = require('jison-lex');
var ebnfParser = require('ebnf-parser');
var JSONSelect = require('JSONSelect');
var Reflect = require('reflect');
var version = require('../package.json').version;
var Jison = exports.Jison = exports;
Jison.version = version;

@@ -76,3 +82,3 @@ // detect print

if (typeof grammar === 'string') {
grammar = require("./jison/bnf").parse(grammar);
grammar = ebnfParser.parse(grammar);
}

@@ -104,3 +110,3 @@

if (grammar.lex) {
this.lexer = new RegExpLexer(grammar.lex, null, this.terminals_);
this.lexer = new Lexer(grammar.lex, null, this.terminals_);
}

@@ -117,3 +123,3 @@ };

if (!grammar.bnf && grammar.ebnf) {
bnf = grammar.bnf = require("./jison/ebnf").transform(grammar.ebnf);
bnf = grammar.bnf = ebnfParser.transform(grammar.ebnf);
}

@@ -928,6 +934,6 @@

+ "\nexports.Parser = "+moduleName+".Parser;"
+ "\nexports.parse = function () { return "+moduleName+".parse.apply("+moduleName+", arguments); }"
+ "\nexports.main = "+ String(opt.moduleMain || commonjsMain)
+ "\nexports.parse = function () { return "+moduleName+".parse.apply("+moduleName+", arguments); };"
+ "\nexports.main = "+ String(opt.moduleMain || commonjsMain) + ";"
+ "\nif (typeof module !== 'undefined' && require.main === module) {\n"
+ " exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require(\"system\").args);\n}"
+ " exports.main(process.argv.slice(1));\n}"
+ "\n}"

@@ -941,3 +947,3 @@

var moduleName = opt.moduleName || "parser";
var out = "/* Jison generated parser */\n";
var out = "/* parser generated by jison " + version + " */\n";
out += (moduleName.match(/\./) ? moduleName : "var "+moduleName)+" = (function(){";

@@ -962,4 +968,2 @@ out += "\nvar parser = "+this.generateModule_();

try {
var JSONSelect = require('JSONSelect');
var Reflect = require('reflect');
var ast = Reflect.parse(parseFn);

@@ -999,10 +1003,7 @@

function commonjsMain (args) {
if (!args[1])
throw new Error('Usage: '+args[0]+' FILE');
var source, cwd;
if (typeof process !== 'undefined') {
source = require('fs').readFileSync(require('path').resolve(args[1]), "utf8");
} else {
source = require("file").path(require("file").cwd()).join(args[1]).read({charset: "utf-8"});
if (!args[1]) {
console.log('Usage: '+args[0]+' FILE');
process.exit(1);
}
var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
return exports.parser.parse(source);

@@ -1009,0 +1010,0 @@ }

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

"description": "A parser generator with Bison's API",
"version": "0.3.12",
"version": "0.4.0",
"keywords": [

@@ -28,7 +28,3 @@ "jison",

"main": "lib/jison",
"bin": {
"jison": "lib/jison/cli-wrapper.js",
"jison2json": "lib/jison/jison2json.js",
"json2jison": "lib/jison/json2jison.js"
},
"bin": "lib/cli.js",
"engines": {

@@ -40,3 +36,6 @@ "node": ">=0.4"

"reflect": "0.0.7",
"nomnom": "0.4.3"
"jison-lex": "0.0.1",
"ebnf-parser": "0.0.1",
"lex-parser": "0.0.1",
"nomnom": "1.5.2"
},

@@ -46,3 +45,4 @@ "devDependencies": {

"jison": "0.3.11",
"uglify-js": "1.3.3"
"uglify-js": "1.3.3",
"browserify": "*"
},

@@ -52,7 +52,3 @@ "scripts": {

},
"directories": {
"lib": "lib",
"bin": "./bin"
},
"homepage": "http://jison.org"
}

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

#!/usr/bin/env narwhal
exports.testParser = require("./parser/parser-tests");
exports.testLexer = require("./lexer/lexer-tests");
exports.testGrammar = require("./grammar/grammar-tests");
if (require.main === module)
require("test").run(exports);
require("test").run(exports);

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

#!/usr/bin/env narwhal
exports.testAPI = require("./api");

@@ -15,2 +13,2 @@ exports.testLR0 = require("./lr0");

if (require.main === module)
require("os").exit(require("test").run(exports));
require("test").run(exports);

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

#!/usr/bin/env narwhal
// TODO: ...should probably have some real performance tests.

@@ -4,0 +2,0 @@

exports.Jison = require("../lib/jison").Jison;
exports.Lexer = exports.RegExpLexer = require("../lib/jison/lexer").RegExpLexer;
exports.Lexer = exports.RegExpLexer = require("jison-lex");

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