Skip to content

Commit

Permalink
Merge pull request #2 from joelburget/master
Browse files Browse the repository at this point in the history
Stop silencing useful information.
  • Loading branch information
Alex authored Jul 5, 2016
2 parents fd06089 + dd2564e commit fa3ee5c
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,13 @@ cli.processGrammars = function processGrammars(file, lexFile, jsonMode) {
var ebnfParser = require('ebnf-parser');
var cjson = require('cjson');
var grammar;
try {
if (jsonMode) {
grammar = cjson.parse(file);
} else {
grammar = ebnfParser.parse(file);
}
} catch (e) {
throw new Error('Could not parse jison grammar');
if (jsonMode) {
grammar = cjson.parse(file);
} else {
grammar = ebnfParser.parse(file);
}
try {
if (lexFile) {
grammar.lex = require('lex-parser').parse(lexFile);
}
} catch (e) {
throw new Error('Could not parse lex grammar');
if (lexFile) {
grammar.lex = require('lex-parser').parse(lexFile);
}
return grammar;
};
Expand Down

0 comments on commit fa3ee5c

Please sign in to comment.