Skip to content
Snippets Groups Projects

Resolve "Make grammar(s) more concise"

Merged René Schöne requested to merge 40-make-grammar-s-more-concise into dev
10 files
+ 50
69
Compare changes
  • Side-by-side
  • Inline
Files
10
@@ -4,7 +4,7 @@ Design considerations
- [NEW in 1.0.0] no complete intermediate structure, but instead single nodes where applicable
*/
aspect NewStuff {
syn List<TypeComponent> RagConnect.rootTypeComponentList() {
syn List<TypeComponent> RagConnect.rootTypeComponents() {
List<TypeComponent> result = new ArrayList<>();
for (Component child : rootNode.getComponentList()) {
if (child.isTypeComponent()) {
@@ -13,6 +13,7 @@ aspect NewStuff {
}
return result;
}
syn boolean RagConnect.hasRootTypeComponents() = !rootTypeComponents().isEmpty();
// inh boolean TypeComponent.isFirst();
// eq RagConnect.getRootTypeComponentList(int i).isFirst() = i == 0;
@@ -172,14 +173,14 @@ aspect NewStuff {
} else {
result = new MTokenReceiveDefinition();
}
} else if (getEndpointTarget().isTokenEndpointTarget()) {
} else if (getEndpointTarget().isTypeEndpointTarget()) {
if (getSend()) {
result = new MTypeSendDefinition();
} else {
result = new MTypeReceiveDefinition();
}
} else {
throw new RuntimeException("Unknown endpoint target type for " + this);
throw new RuntimeException("Unknown endpoint target type: " + getEndpointTarget());
}
result.setEndpointDefinition(this);
for (MappingDefinition def : effectiveMappings()) {
@@ -200,16 +201,8 @@ aspect NewStuff {
return result;
}
syn List<TypeComponent> RagConnect.rootTypeComponents() {
List<TypeComponent> result = new ArrayList<>();
for (Component child : rootNode.getComponentList()) {
if (child.isTypeComponent()) {
result.add(child.asTypeComponent());
}
}
return result;
}
syn JastAddList<MInnerMappingDefinition> EndpointDefinition.innerMappingDefinitions() = toMustache().getInnerMappingDefinitionList();
syn boolean EndpointDefinition.hasTypeEndpointTarget() = getEndpointTarget().isTypeEndpointTarget();
}
aspect OldStuff { // copied unchanged, but should work
@@ -292,13 +285,6 @@ aspect AspectGeneration {
}
};
}
@Override
public Object coerce(Object object) {
if (object instanceof Collection) {
return new com.github.mustachejava.util.DecoratedCollection((Collection) object);
}
return super.coerce(object);
}
};
com.github.mustachejava.DefaultMustacheFactory mf = new com.github.mustachejava.DefaultMustacheFactory();
mf.setObjectHandler(roh);
Loading