Comparing version 0.3.12 to 0.4.0
@@ -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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
0
3
10
129590
6
4
24
3522
+ Addedebnf-parser@0.0.1
+ Addedjison-lex@0.0.1
+ Addedlex-parser@0.0.1
+ Addedcolors@0.5.1(transitive)
+ Addedebnf-parser@0.0.1(transitive)
+ Addedjison@0.3.12(transitive)
+ Addedjison-lex@0.0.1(transitive)
+ Addedlex-parser@0.0.1(transitive)
+ Addednomnom@1.5.2(transitive)
+ Addedunderscore@1.1.7(transitive)
Updatednomnom@1.5.2