X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FERecord.java;h=a41c0f042d46034e782ec06b78888bfe146cf7c9;hb=527940f032d9dd8ebd4c7bd202356115f1715120;hp=32999dcb48877a689c980d7e7c1bc73973b46345;hpb=eecd74faded034bd067094b42bbac0d286d8d9fa;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERecord.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERecord.java index 32999dcb4..a41c0f042 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERecord.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERecord.java @@ -54,11 +54,14 @@ public class ERecord extends ASTExpression { THashMap recordMap = new THashMap(fields.length); for(FieldAssignment field : fields) { if(field.value == null) { + String actualName = field.name; + if(actualName.charAt(0) == '?') + actualName = actualName.substring(1); String bestMatch = null; int bestMatchLength = 0; for(int i=0;i bestMatchLength) { + if(actualName.startsWith(fieldName) && fieldName.length() > bestMatchLength) { bestMatch = fieldName; bestMatchLength = fieldName.length(); } @@ -121,5 +124,9 @@ public class ERecord extends ASTExpression { public Expression accept(ExpressionTransformer transformer) { return transformer.transform(this); } - + + @Override + public void accept(ExpressionVisitor visitor) { + visitor.visit(this); + } }