From c190289f6fea9f2ed638381c98f64521f0fe684f Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Sat, 21 Aug 2021 16:50:37 +0200 Subject: [PATCH] =?UTF-8?q?Show=20better=20error=20message=20on=20's?= =?UTF-8?q?=E2=88=80'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit see #15 --- src/main/java/edu/kit/typicalc/model/parser/LambdaLexer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/kit/typicalc/model/parser/LambdaLexer.java b/src/main/java/edu/kit/typicalc/model/parser/LambdaLexer.java index 04729c6..60ac369 100644 --- a/src/main/java/edu/kit/typicalc/model/parser/LambdaLexer.java +++ b/src/main/java/edu/kit/typicalc/model/parser/LambdaLexer.java @@ -151,7 +151,9 @@ public class LambdaLexer { } while (pos < term.length() && Character.isLetterOrDigit(term.charAt(pos)) && (int) term.charAt(pos) < 128); if (pos < term.length() && (int) term.charAt(pos) >= 128) { - return new Result<>(null, ParseError.unexpectedCharacter2(term.charAt(pos), pos, term, errorType)); + return new Result<>(null, + ParseError.unexpectedCharacter2(term.charAt(pos), pos, term, errorType) + .expectedType(TokenType.VARIABLE)); } String s = sb.toString(); TokenType type;