File tree 2 files changed +200
-127
lines changed
kernel/src/main/java/org/kframework/compile/checks
kore/src/main/scala/org/kframework/attributes
2 files changed +200
-127
lines changed Original file line number Diff line number Diff line change @@ -84,15 +84,16 @@ private <T extends HasAtt & HasLocation> void checkUnrecognizedAtts(T term) {
84
84
}
85
85
86
86
private <T extends HasAtt & HasLocation > void checkRestrictedAtts (T term ) {
87
- Class <?> cls = term .getClass ();
88
- Att att = term .att ();
89
- Set <Key > keys = stream (att .att ().keySet ()).map (Tuple2 ::_1 ).collect (Collectors .toSet ());
90
- keys .removeIf (k -> k .allowedSentences ().exists (c -> c .isAssignableFrom (cls )));
91
- if (!keys .isEmpty ()) {
92
- List <String > sortedKeys = keys .stream ().map (Key ::toString ).sorted ().toList ();
87
+ Set <Key > badKeys =
88
+ stream (term .att ().att ().keySet ())
89
+ .map (Tuple2 ::_1 )
90
+ .filter (k -> k .visibility ().isPermitted (term ))
91
+ .collect (Collectors .toSet ());
92
+ if (!badKeys .isEmpty ()) {
93
+ List <String > sortedKeys = badKeys .stream ().map (Key ::toString ).sorted ().toList ();
93
94
errors .add (
94
95
KEMException .compilerError (
95
- cls . getSimpleName () + " cannot have the following attributes : " + sortedKeys , term ));
96
+ "The following attributes are not permitted here : " + sortedKeys , term ));
96
97
}
97
98
}
98
99
You can’t perform that action at this time.
0 commit comments