Skip to content

Commit 589c722

Browse files
author
Julia Pham
committed
fix: minor error message wording
1 parent 4c8c242 commit 589c722

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/main/java/de/vill/exception/ErrorReport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public String toString() {
6767
sb.append("\n Field: ").append(field);
6868
}
6969
if (cause != null) {
70-
sb.append("\n Cause: ").append(cause);
70+
sb.append("\n Possible cause: ").append(cause);
7171
}
7272
if (hint != null) {
7373
sb.append("\n Hint: ").append(hint);

src/main/java/de/vill/main/UVLErrorListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private ErrorReport translateToReport(String message, Object offendingSymbol, Re
6666
"Wrong feature name: " + extra)
6767
.line(line).charPosition(charPosition)
6868
.reference(m.group(1))
69-
.cause("Feature names can not start with a number.")
69+
.cause("Invalid feature name. Feature names can not start with a number.")
7070
.hint("Rename the feature.")
7171
.build();
7272
}
@@ -85,7 +85,7 @@ private ErrorReport translateToReport(String message, Object offendingSymbol, Re
8585
String found = tokenToReadable(m.group(1));
8686
String expected = simplifySet(m.group(2));
8787

88-
// Sonderfall: nach Gruppierung ohne Features
88+
// Case: group keywords without features/children
8989
if (expected.equals("an indentation") && (found.equals("a new line") || found.contains("'mandatory'") || found.contains("'optional'")|| found.contains("'alternative'") || found.contains("'or'"))) {
9090
return new ErrorReport.Builder(ErrorCategory.SYNTAX,
9191
"Missing features after group type")

src/main/java/de/vill/main/UVLListener.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public void exitIncludeLine(UVLJavaParser.IncludeLineContext ctx) {
110110
.line(line).charPosition(charPos)
111111
.field(ErrorField.LANGUAGE_LEVEL)
112112
.reference(ctx.languageLevel().getText())
113-
.cause("Language level imports must have the format 'MajorLevel' or 'MajorLevel.MinorLevel'.")
114-
.hint("Use a valid language level format, e.g. 'Arithmetic-Level' or 'Arithmetic-Level.Aggregate-Function'.")
113+
.cause("Invalid language level import.")
114+
.hint("Use a valid language level format.")
115115
.build()));
116116
}
117117
}
@@ -233,8 +233,6 @@ public void enterFeature(UVLJavaParser.FeatureContext ctx) {
233233
int line = ctx.getStart().getLine();
234234
int charPos = ctx.getStart().getCharPositionInLine();
235235

236-
// Group keywords cannot be used as feature names — this typically
237-
// indicates a wrong indentation rather than an intentional feature name.
238236
if (GROUP_KEYWORDS.contains(featureReference.toLowerCase())) {
239237
errorList.add(new ParseError(new ErrorReport.Builder(ErrorCategory.SYNTAX,
240238
"'" + featureReference + "' is a reserved group keyword and cannot be used as a feature name")

0 commit comments

Comments
 (0)