Skip to content

Commit

Permalink
Remove mention of group(_) from error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott-Guest committed Feb 12, 2024
1 parent 0f086cd commit 1791019
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
10 changes: 8 additions & 2 deletions k-distribution/tests/regression-new/checks/checkModuleAtts.k.out
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
[Error] Compiler: Module cannot have the following attributes: [group]
Source(checkModuleAtts.k)
Location(2,1,3,10)
. v~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | module CHECKMODULEATTS [foo, group(bar), baz]
3 | endmodule
. ~~~~~~~~^
[Error] Compiler: Unrecognized attributes: [baz, foo]
Hint: User-defined groups can be added with the group(_) attribute.
Source(checkModuleAtts.k)
Location(2,1,3,10)
. v~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | module CHECKMODULEATTS [foo, group(bar), baz]
3 | endmodule
. ~~~~~~~~^
[Error] Compiler: Had 1 structural errors.
[Error] Compiler: Had 2 structural errors.
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[Error] Compiler: Unrecognized attributes: [badAtt]
Hint: User-defined groups can be added with the group(_) attribute.
Source(test.k)
Location(3,18,3,71)
3 | syntax Int ::= r"[\\+-]?[0-9]+" [prefer, token, prec(2), badAtt(10)]
. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Error] Compiler: Unrecognized attributes: [badAtt]
Hint: User-defined groups can be added with the group(_) attribute.
Source(test.k)
Location(4,18,4,68)
4 | | Int "+" Int [group(badAttButOkay),badAtt,function]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -793,12 +793,7 @@ private static Tuple2<Att.Key, String> getCellProperty(K k) {
.orElseThrow(
() ->
KEMException.compilerError(
"Unrecognized attribute: "
+ keyToken.s()
+ "\n"
+ "Hint: User-defined groups can be added with the"
+ " group=\"...\" attribute.",
k));
"Unrecognized property: " + keyToken.s(), k));
if (kapp.klist().items().get(0) instanceof KToken) {
KToken valueToken = (KToken) kapp.klist().items().get(1);
if (valueToken.sort().equals(Sorts.KString())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ private <T extends HasAtt & HasLocation> void checkUnrecognizedAtts(T term) {
errors.add(
KEMException.compilerError(
"Unrecognized attributes: "
+ stream(term.att().unrecognizedKeys()).map(Key::toString).sorted().toList()
+ "\nHint: User-defined groups can be added with the group(_) attribute.",
+ stream(term.att().unrecognizedKeys()).map(Key::toString).sorted().toList(),
term));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,7 @@ public static Att toAtt(JsonObject data) {
"Unrecognized attribute "
+ key
+ " found in KAST Json term when unparsing KATT: "
+ attMap
+ "\n"
+ "Hint: User-defined groups can be added with the group(_)"
+ " attribute."));
+ attMap));
newAtt = newAtt.add(attKey, attMap.getString(key));
}
}
Expand Down

0 comments on commit 1791019

Please sign in to comment.