diff --git a/kernel/src/main/java/org/kframework/compile/ResolveSemanticCasts.java b/kernel/src/main/java/org/kframework/compile/ResolveSemanticCasts.java index ced3d3f2e5e..3e31a459e56 100644 --- a/kernel/src/main/java/org/kframework/compile/ResolveSemanticCasts.java +++ b/kernel/src/main/java/org/kframework/compile/ResolveSemanticCasts.java @@ -72,17 +72,15 @@ K addSideCondition(K requires, boolean macro) { Optional sideCondition = casts.stream() .map( - k -> { - return new TransformK() { - @Override - public K apply(KVariable k) { - if (varToTypedVar.containsKey(k)) { - return varToTypedVar.get(k); - } - return k; + k -> new TransformK() { + @Override + public K apply(KVariable k) { + if (varToTypedVar.containsKey(k)) { + return varToTypedVar.get(k); } - }.apply(k); - }) + return k; + } + }.apply(k)) .map(k -> KApply(KLabel("is" + getSortNameOfCast((KApply) k)), transform(k))) .reduce(BooleanUtils::and); if (!sideCondition.isPresent()) { diff --git a/kernel/src/main/java/org/kframework/compile/SortInfo.java b/kernel/src/main/java/org/kframework/compile/SortInfo.java index 6632b53a5a4..c33d4777551 100644 --- a/kernel/src/main/java/org/kframework/compile/SortInfo.java +++ b/kernel/src/main/java/org/kframework/compile/SortInfo.java @@ -57,9 +57,7 @@ public static SortInfo fromModule(Module module) { joinOps .asMap() .forEach( - (sort, labels) -> { - info.closeOperators.put(sort, Iterators.getNext(labels.iterator(), null)); - }); + (sort, labels) -> info.closeOperators.put(sort, Iterators.getNext(labels.iterator(), null))); return info; } } diff --git a/kernel/src/main/java/org/kframework/kdep/KDepFrontEnd.java b/kernel/src/main/java/org/kframework/kdep/KDepFrontEnd.java index 212422636d1..7c72d481f77 100644 --- a/kernel/src/main/java/org/kframework/kdep/KDepFrontEnd.java +++ b/kernel/src/main/java/org/kframework/kdep/KDepFrontEnd.java @@ -127,9 +127,7 @@ protected int run() { List sortedFiles = new ArrayList(allFiles); Collections.sort( sortedFiles, - (File a, File b) -> { - return a.getAbsolutePath().compareTo(b.getAbsolutePath()); - }); + (File a, File b) -> a.getAbsolutePath().compareTo(b.getAbsolutePath())); for (File file : sortedFiles) { System.out.println(" " + file.getAbsolutePath() + " \\"); diff --git a/kernel/src/main/java/org/kframework/kompile/CompiledDefinition.java b/kernel/src/main/java/org/kframework/kompile/CompiledDefinition.java index 1d6242aacc9..0cf2dc7b508 100644 --- a/kernel/src/main/java/org/kframework/kompile/CompiledDefinition.java +++ b/kernel/src/main/java/org/kframework/kompile/CompiledDefinition.java @@ -116,39 +116,37 @@ private void initializeConfigurationVariableDefaultSorts(FileUtil files) { // searching for #SemanticCastTo(Map:lookup(_, #token(, KConfigVar))) Collections.stream(kompiledDefinition.mainModule().rules()) .forEach( - r -> { - new VisitK() { - @Override - public void apply(KApply k) { - if (k.klabel().name().startsWith("project:") - && k.items().size() == 1 - && k.items().get(0) instanceof KApply theMapLookup) { - if (KLabels.MAP_LOOKUP.equals(theMapLookup.klabel()) - && theMapLookup.size() == 2 - && theMapLookup.items().get(1) instanceof KToken t) { - if (t.sort().equals(Sorts.KConfigVar())) { - Sort sort = - Outer.parseSort(k.klabel().name().substring("project:".length())); - configurationVariableDefaultSorts.put(t.s(), sort); - if (sort.equals(Sorts.K())) { - sort = Sorts.KItem(); - } - String str = - "declaredConfigVar_" - + t.s().substring(1) - + "='" - + sort.toString() - + "'\n"; - sb.append(str); - String astr = " '" + t.s().substring(1) + "'\n"; - arr.append(astr); + r -> new VisitK() { + @Override + public void apply(KApply k) { + if (k.klabel().name().startsWith("project:") + && k.items().size() == 1 + && k.items().get(0) instanceof KApply theMapLookup) { + if (KLabels.MAP_LOOKUP.equals(theMapLookup.klabel()) + && theMapLookup.size() == 2 + && theMapLookup.items().get(1) instanceof KToken t) { + if (t.sort().equals(Sorts.KConfigVar())) { + Sort sort = + Outer.parseSort(k.klabel().name().substring("project:".length())); + configurationVariableDefaultSorts.put(t.s(), sort); + if (sort.equals(Sorts.K())) { + sort = Sorts.KItem(); } + String str = + "declaredConfigVar_" + + t.s().substring(1) + + "='" + + sort.toString() + + "'\n"; + sb.append(str); + String astr = " '" + t.s().substring(1) + "'\n"; + arr.append(astr); } } - super.apply(k); } - }.apply(r.body()); - }); + super.apply(k); + } + }.apply(r.body())); sb.append(arr); sb.append(")\n");