diff --git a/lib/cli.js b/lib/cli.js index 338a23827..d03381d2d 100755 --- a/lib/cli.js +++ b/lib/cli.js @@ -168,14 +168,14 @@ cli.processGrammars = function processGrammars(file, lexFile, jsonMode) { grammar = ebnfParser.parse(file); } } catch (e) { - throw new Error('Could not parse jison grammar'); + throw new Error(e.message + '\nCould not parse jison grammar.'); } try { if (lexFile) { grammar.lex = require('lex-parser').parse(lexFile); } } catch (e) { - throw new Error('Could not parse lex grammar'); + throw new Error(e.message + '\nCould not parse lex grammar.'); } return grammar; };