From c70f884d58ee70b6419cce6572e77fd00909a121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Z=C3=ADpek?= Date: Sat, 12 Nov 2016 11:19:08 +0100 Subject: [PATCH] Token manager errors should now be treated correctly. --- src/cz/zipek/sqflint/linter/Linter.java | 2 ++ src/cz/zipek/sqflint/linter/SQFParseException.java | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/cz/zipek/sqflint/linter/Linter.java b/src/cz/zipek/sqflint/linter/Linter.java index 0eb7f47..fa60190 100644 --- a/src/cz/zipek/sqflint/linter/Linter.java +++ b/src/cz/zipek/sqflint/linter/Linter.java @@ -65,6 +65,8 @@ public int start() throws IOException { } else { getErrors().add((SQFParseException)e); } + } catch (TokenMgrError e) { + getErrors().add(new SQFParseException(e)); } finally { postParse(); diff --git a/src/cz/zipek/sqflint/linter/SQFParseException.java b/src/cz/zipek/sqflint/linter/SQFParseException.java index 56fc0f0..9d37944 100644 --- a/src/cz/zipek/sqflint/linter/SQFParseException.java +++ b/src/cz/zipek/sqflint/linter/SQFParseException.java @@ -2,6 +2,7 @@ import cz.zipek.sqflint.parser.ParseException; import cz.zipek.sqflint.parser.Token; +import cz.zipek.sqflint.parser.TokenMgrError; /** * @@ -24,6 +25,13 @@ public SQFParseException(ParseException ex) { jsonMessage = buildMessage(ex, false); } + public SQFParseException(TokenMgrError ex) { + super(ex.getMessage()); + + currentToken = null; + jsonMessage = ex.getMessage(); + } + public String getJSONMessage() { return jsonMessage; }