fix bug in scanner fix
@@ -309,8 +309,9 @@ public class RuleGrammarGenerator {
} else if (addConfigCells) {
// remove cells from parsing config cells so they don't conflict with the production in kast.k
// also add all matching terminals to the #CellName sort
- for (Production prod : iterable(mod.productions())) {
- for (ProductionItem pi : iterable(prod.items())) {
+ for (Sentence prod : extensionProds) {
+ if (prod instanceof Production) {
+ for (ProductionItem pi : iterable(((Production)prod).items())) {
if (pi instanceof Terminal) {
Terminal t = (Terminal)pi;
if (t.value().matches("[A-Za-z][A-Za-z0-9\\-]*")) {
@@ -319,6 +320,7 @@ public class RuleGrammarGenerator {
}
}
}
+ }
parseProds = Stream.concat(prods.stream(), stream(mod.sentences()).filter(s -> !s.att().contains("cell"))).collect(Collectors.toSet());
} else
parseProds = Stream.concat(prods.stream(), stream(mod.sentences())).collect(Collectors.toSet());
