Skip to content

Commit c2e777f

Browse files
committed
Print out all AST-s in case of ambiguous grammar
1 parent 5daa583 commit c2e777f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parser/createParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function createParser(tokenizer: Tokenizer): Parser {
3939
// but I haven't found a way to get this info from Nearley :(
4040
throw new Error('Parse error: Invalid SQL');
4141
} else {
42-
throw new Error('Parse error: Ambiguous grammar');
42+
throw new Error(`Parse error: Ambiguous grammar\n${JSON.stringify(results, undefined, 2)}`);
4343
}
4444
},
4545
};

0 commit comments

Comments
 (0)