@malloydata/malloy
Advanced tools
Comparing version 0.0.12-dev221202180754 to 0.0.12-dev221204204332
@@ -52,2 +52,14 @@ "use strict"; | ||
const reference_list_1 = require("./reference-list"); | ||
/** | ||
* This ignores a -> popMode when the mode stack is empty, which is a hack, | ||
* but it let's us parse }% | ||
*/ | ||
class HandlesOverpoppingLexer extends MalloyLexer_1.MalloyLexer { | ||
popMode() { | ||
if (this._modeStack.isEmpty) { | ||
return this._mode; | ||
} | ||
return super.popMode(); | ||
} | ||
} | ||
class MalloyParserErrorHandler { | ||
@@ -109,3 +121,12 @@ constructor(translator, messages) { | ||
this.sourceInfo = this.getSourceInfo(source); | ||
const parse = this.runParser(source, that); | ||
let parse; | ||
try { | ||
parse = this.runParser(source, that); | ||
} | ||
catch (parseException) { | ||
that.root.logger.log({ | ||
message: `Malloy internal parser exception [${parseException.message}]`, | ||
}); | ||
parse = undefined; | ||
} | ||
if (that.root.logger.hasErrors()) { | ||
@@ -159,3 +180,3 @@ this.response = { | ||
const inputStream = antlr4ts_1.CharStreams.fromString(source); | ||
const lexer = new MalloyLexer_1.MalloyLexer(inputStream); | ||
const lexer = new HandlesOverpoppingLexer(inputStream); | ||
const tokenStream = new antlr4ts_1.CommonTokenStream(lexer); | ||
@@ -162,0 +183,0 @@ const malloyParser = new MalloyParser_1.MalloyParser(tokenStream); |
{ | ||
"name": "@malloydata/malloy", | ||
"version": "0.0.12-dev221202180754", | ||
"version": "0.0.12-dev221204204332", | ||
"license": "GPL-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
1582075
41175