Comparing version 0.4.7 to 0.4.8
@@ -41,3 +41,3 @@ #!/usr/bin/env node | ||
.option('module-type', { | ||
abbr: 't', | ||
abbr: 'm', | ||
default: 'commonjs', | ||
@@ -47,2 +47,8 @@ metavar: 'TYPE', | ||
}) | ||
.option('parser-type', { | ||
abbr: 'p', | ||
default: 'lalr', | ||
metavar: 'TYPE', | ||
help: 'The type of algorithm to use for the parser (lr0, slr, lalr, lr)' | ||
}) | ||
.option('version', { | ||
@@ -97,6 +103,13 @@ abbr: 'V', | ||
var settings = grammar.options || {}; | ||
if (opts['parser-type']) settings.type = opts['parser-type']; | ||
if (lexFile) grammar.lex = lexParser.parse(lexFile); | ||
settings.debug = opts.debug; | ||
if (!settings.moduleType) settings.moduleType = opts['module-type']; | ||
if (!settings.moduleName && name) settings.moduleName = name.replace(/-\w/g, function (match){ return match.charAt(1).toUpperCase(); }); | ||
if (!settings.moduleName && name) { | ||
settings.moduleName = name.replace(/-\w/g, | ||
function (match){ | ||
return match.charAt(1).toUpperCase(); | ||
}); | ||
} | ||
@@ -103,0 +116,0 @@ var generator = new jison.Generator(grammar, settings); |
@@ -5,3 +5,3 @@ { | ||
"description": "A parser generator with Bison's API", | ||
"version": "0.4.7", | ||
"version": "0.4.8", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "jison", |
@@ -42,2 +42,18 @@ Jison | ||
Full cli option list: | ||
Usage: jison [file] [lexfile] [options] | ||
file file containing a grammar | ||
lexfile file containing a lexical grammar | ||
Options: | ||
-j, --json force jison to expect a grammar in JSON format | ||
-o FILE, --outfile FILE Filename and base module name of the generated parser | ||
-t, --debug Debug mode | ||
-m TYPE, --module-type TYPE The type of module to generate (commonjs, amd, js) | ||
-p TYPE, --parser-type TYPE The type of algorithm to use for the parser (lr0, slr, lalr, lr) | ||
-V, --version print version and exit | ||
Usage from a CommonJS module | ||
@@ -44,0 +60,0 @@ -------------------------- |
136710
3656
161