From 38ccbac97ce94afed8921aef427b7c677641b54d Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 4 Apr 2021 12:29:56 +0200 Subject: [PATCH] stop after a couple of parse errors (it's not useful to continue for long if there are parse errors) --- compilerAst/src/prog8/parser/ModuleParsing.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compilerAst/src/prog8/parser/ModuleParsing.kt b/compilerAst/src/prog8/parser/ModuleParsing.kt index 8283a0401..5099d7cb0 100644 --- a/compilerAst/src/prog8/parser/ModuleParsing.kt +++ b/compilerAst/src/prog8/parser/ModuleParsing.kt @@ -62,6 +62,8 @@ class ModuleImporter { is prog8Parser -> System.err.println("${recognizer.inputStream.sourceName}:$line:$charPositionInLine: $msg") else -> System.err.println("$line:$charPositionInLine $msg") } + if(numberOfErrors>=5) + throw ParsingFailedError("There are too many parse errors. Stopping.") } }