Skip to content

Commit 3ebaa61

Browse files
committed
debug mode throw exception info
1 parent 6b336cf commit 3ebaa61

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "PHPParser.h"
1111
#include "PHPParserVisitor.h"
1212
#include "PHPVisitor.h"
13+
#include "TitaniumAntlrErrorListener.h"
1314

1415
#define PHPBOT_VERSION "Beta1.0.0"
1516

@@ -83,6 +84,12 @@ int main(int argc, const char* argv[]) {
8384
PHPLexer lexer(&input);
8485
CommonTokenStream tokens(&lexer);
8586
PHPParser parser(&tokens);
87+
88+
if (!isDebug) {
89+
parser.removeErrorListeners();
90+
lexer.removeErrorListeners();
91+
}
92+
8693
PHPParser::ProgContext* tree = parser.prog();
8794

8895
PHPVisitor visitor;

0 commit comments

Comments
 (0)