From e2bf67fb5d3b63703c6f5865a4772411f5c93f15 Mon Sep 17 00:00:00 2001 From: Paul Nelissen Date: Tue, 28 Jul 2026 10:02:43 +0200 Subject: [PATCH 1/6] Trial: listOfListFix --- .../ExpressionEvaluatorFunctionTest.xtend | 54 +++++++++++++++++++ .../tests/ExpressionValidationTest.xtend | 28 ++++++++++ .../xtext/types/utilities/TypeUtilities.xtend | 4 +- 3 files changed, 84 insertions(+), 2 deletions(-) diff --git a/bundles/nl.esi.xtext.expressions.tests/src/nl/esi/xtext/expressions/tests/ExpressionEvaluatorFunctionTest.xtend b/bundles/nl.esi.xtext.expressions.tests/src/nl/esi/xtext/expressions/tests/ExpressionEvaluatorFunctionTest.xtend index 9710f24..fffba8d 100644 --- a/bundles/nl.esi.xtext.expressions.tests/src/nl/esi/xtext/expressions/tests/ExpressionEvaluatorFunctionTest.xtend +++ b/bundles/nl.esi.xtext.expressions.tests/src/nl/esi/xtext/expressions/tests/ExpressionEvaluatorFunctionTest.xtend @@ -319,4 +319,58 @@ class ExpressionEvaluatorFunctionTest extends ExpressionEvaluatorTestBase { } ''') } + + + @Test + def void testListOfLists() { + assertEval(''' + record Config { + string [ ] [ ] listOfListOfStrings string [ ] + listOfStrings + string aString + } + Config config = Config { + listOfListOfStrings = [ + ['0a','0b','0c'], + ['1a','1b','1c'], + ['2a','2b','2c'] + ], + listOfStrings = null, + aString = null + } + Config out = Config { + listOfListOfStrings = null , + listOfStrings = < string [ ] > [ "0a" , "0b" , "0c" ] , + aString = "0a" + } + + string s = "0a" + string [ ] sArray = < string [ ] > [ "0a" , "0b" , "0c" ] + ''', ''' + record Config { + string[][] listOfListOfStrings + string[] listOfStrings + string aString + } + Config config = Config { + listOfListOfStrings = [ + ['0a','0b','0c'], + ['1a','1b','1c'], + ['2a','2b','2c'] + ], + listOfStrings = null, + aString = null + } + Config out = Config { + listOfListOfStrings = null, + listOfStrings = get(config.listOfListOfStrings, 0), // expected returned value: ['0a', '0b', '0c'] + aString = get(get(config.listOfListOfStrings, 0), 0) + } + string s = out.aString + string[] sArray = out.listOfStrings + ''') + + } + + } diff --git a/bundles/nl.esi.xtext.expressions.tests/src/nl/esi/xtext/expressions/tests/ExpressionValidationTest.xtend b/bundles/nl.esi.xtext.expressions.tests/src/nl/esi/xtext/expressions/tests/ExpressionValidationTest.xtend index 86397a1..3092ed5 100644 --- a/bundles/nl.esi.xtext.expressions.tests/src/nl/esi/xtext/expressions/tests/ExpressionValidationTest.xtend +++ b/bundles/nl.esi.xtext.expressions.tests/src/nl/esi/xtext/expressions/tests/ExpressionValidationTest.xtend @@ -209,6 +209,34 @@ class ExpressionValidationTest { int d = 2 ^ 3 ^ 2 ''') } + + @Test + def void testListOfLists(){ + validate(''' + record Config { + string[][] listOfListOfStrings + string[] listOfStrings + string aString + } + Config config = Config { + listOfListOfStrings = [ + ['0a','0b','0c'], + ['1a','1b','1c'], + ['2a','2b','2c'] + ], + listOfStrings = null, + aString = null + } + Config out = Config { + listOfListOfStrings = null, + listOfStrings = get(config.listOfListOfStrings, 0), // expected returned value: ['0a', '0b', '0c'] + aString = get(get(config.listOfListOfStrings, 0), 0) + } + + string s = out.aString + string[] s1 = out.listOfStrings + ''') + } private def validate(String text) { val result = parseHelper.parse(text) diff --git a/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/utilities/TypeUtilities.xtend b/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/utilities/TypeUtilities.xtend index acf7ba7..6561452 100644 --- a/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/utilities/TypeUtilities.xtend +++ b/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/utilities/TypeUtilities.xtend @@ -300,8 +300,8 @@ class TypeUtilities { if (subType instanceof VectorTypeConstructor) { if (baseType instanceof VectorTypeConstructor) { if(!subType.type.subTypeOf(baseType.type)) return false - if(subType.dimensions.size != baseType.dimensions.size) return false - for (i : 0 ..< subType.dimensions.size) { + if(subType.dimensions.size < baseType.dimensions.size) return false + for (i : 0 ..< baseType.dimensions.size) { if(subType.dimensions.get(i).size != baseType.dimensions.get(i).size) return false } return true From c388a54fc518b3423118eb3dd8c3448967024670 Mon Sep 17 00:00:00 2001 From: Paul Nelissen Date: Tue, 28 Jul 2026 12:19:57 +0200 Subject: [PATCH 2/6] Remove plantuml from XPlus --- XPlus.setup | 2 - .../META-INF/MANIFEST.MF | 81 ++++++------------- .../nl.esi.xtext.types/META-INF/MANIFEST.MF | 1 - features/nl.esi.xplus.feature/feature.xml | 4 - .../nl.esi.xplus.target.target | 6 +- 5 files changed, 24 insertions(+), 70 deletions(-) diff --git a/XPlus.setup b/XPlus.setup index cf41b4c..c9e233f 100644 --- a/XPlus.setup +++ b/XPlus.setup @@ -383,8 +383,6 @@ url="https://download.eclipse.org/releases/2024-09"/> - - - - - diff --git a/releng/nl.esi.xplus.target/nl.esi.xplus.target.target b/releng/nl.esi.xplus.target/nl.esi.xplus.target.target index 09739c0..510a716 100644 --- a/releng/nl.esi.xplus.target/nl.esi.xplus.target.target +++ b/releng/nl.esi.xplus.target/nl.esi.xplus.target.target @@ -72,11 +72,7 @@ - - - - - + From f2c92455a1668fba06261b00c321258b3af9163c Mon Sep 17 00:00:00 2001 From: Paul Nelissen Date: Tue, 28 Jul 2026 13:02:00 +0200 Subject: [PATCH 3/6] Other removals of plantuml --- bundles/nl.esi.xtext.launch/Launch Runtime Eclipse.launch | 7 ------- releng/nl.esi.xplus.standard.site/category.xml | 3 --- 2 files changed, 10 deletions(-) diff --git a/bundles/nl.esi.xtext.launch/Launch Runtime Eclipse.launch b/bundles/nl.esi.xtext.launch/Launch Runtime Eclipse.launch index bd540f7..8539978 100644 --- a/bundles/nl.esi.xtext.launch/Launch Runtime Eclipse.launch +++ b/bundles/nl.esi.xtext.launch/Launch Runtime Eclipse.launch @@ -74,13 +74,6 @@ - - - - - - - diff --git a/releng/nl.esi.xplus.standard.site/category.xml b/releng/nl.esi.xplus.standard.site/category.xml index 1c250cf..3397cc1 100644 --- a/releng/nl.esi.xplus.standard.site/category.xml +++ b/releng/nl.esi.xplus.standard.site/category.xml @@ -38,9 +38,6 @@ - - - XPlus Framework From 5724c2bdc93ff07bf7374da8b219e28947c2721e Mon Sep 17 00:00:00 2001 From: Paul Nelissen Date: Tue, 28 Jul 2026 15:31:34 +0200 Subject: [PATCH 4/6] fix inferActualType for vectors --- .../utilities/ExpressionsUtilities.xtend | 4 ++++ .../esi/xtext/types/utilities/TypeUtilities.xtend | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/bundles/nl.esi.xtext.expressions/src/nl/esi/xtext/expressions/utilities/ExpressionsUtilities.xtend b/bundles/nl.esi.xtext.expressions/src/nl/esi/xtext/expressions/utilities/ExpressionsUtilities.xtend index 84bf985..126fea6 100644 --- a/bundles/nl.esi.xtext.expressions/src/nl/esi/xtext/expressions/utilities/ExpressionsUtilities.xtend +++ b/bundles/nl.esi.xtext.expressions/src/nl/esi/xtext/expressions/utilities/ExpressionsUtilities.xtend @@ -326,8 +326,12 @@ class ExpressionsUtilities { if (type === null) return null return switch (type) { VectorTypeConstructor: createVectorTypeConstructor => [ + val subType = resolutionMap.get(type.type) type = substituteGenerics(type.typeObject.elementType.asType, resolutionMap).type dimensions += type.dimensions.copyAll + if(subType.isVectorType) { + dimensions += subType.dimensions + } ] MapTypeConstructor: createMapTypeConstructor => [ type = substituteGenerics(type.typeObject.keyType.asType, resolutionMap).type diff --git a/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/utilities/TypeUtilities.xtend b/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/utilities/TypeUtilities.xtend index 6561452..42edfce 100644 --- a/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/utilities/TypeUtilities.xtend +++ b/bundles/nl.esi.xtext.types/src/nl/esi/xtext/types/utilities/TypeUtilities.xtend @@ -31,6 +31,7 @@ import nl.esi.xtext.types.types.VectorTypeConstructor import nl.esi.xtext.types.types.VectorTypeDecl import org.eclipse.emf.ecore.resource.Resource import org.eclipse.emf.ecore.util.EcoreUtil +import nl.esi.xtext.types.types.Dimension class TypeUtilities { /* @@ -61,6 +62,16 @@ class TypeUtilities { def static boolean isVectorType(Type t){ return t.getTypeObject.isVectorType } + + def static List getDimensions(Type t){ + if(t instanceof VectorTypeConstructor) { + return t.dimensions + } + if (t instanceof VectorTypeDecl) { + return t.constructor.dimensions + } + return List.of + } def static boolean isVectorType(TypeObject t){ t instanceof VectorTypeConstructor || t instanceof VectorTypeDecl @@ -300,8 +311,8 @@ class TypeUtilities { if (subType instanceof VectorTypeConstructor) { if (baseType instanceof VectorTypeConstructor) { if(!subType.type.subTypeOf(baseType.type)) return false - if(subType.dimensions.size < baseType.dimensions.size) return false - for (i : 0 ..< baseType.dimensions.size) { + if(subType.dimensions.size != baseType.dimensions.size) return false + for (i : 0 ..< subType.dimensions.size) { if(subType.dimensions.get(i).size != baseType.dimensions.get(i).size) return false } return true From 8b5cd981ee62e8077189cfc8a3927e917dd71246 Mon Sep 17 00:00:00 2001 From: Paul Nelissen Date: Tue, 28 Jul 2026 15:47:36 +0200 Subject: [PATCH 5/6] Improve names --- .../utilities/ExpressionsUtilities.xtend | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/bundles/nl.esi.xtext.expressions/src/nl/esi/xtext/expressions/utilities/ExpressionsUtilities.xtend b/bundles/nl.esi.xtext.expressions/src/nl/esi/xtext/expressions/utilities/ExpressionsUtilities.xtend index 126fea6..67357b3 100644 --- a/bundles/nl.esi.xtext.expressions/src/nl/esi/xtext/expressions/utilities/ExpressionsUtilities.xtend +++ b/bundles/nl.esi.xtext.expressions/src/nl/esi/xtext/expressions/utilities/ExpressionsUtilities.xtend @@ -322,27 +322,27 @@ class ExpressionsUtilities { /** * Recursively substitute generic type parameters in a type structure. */ - private def static Type substituteGenerics(Type type, Map resolutionMap) { - if (type === null) return null - return switch (type) { + private def static Type substituteGenerics(Type targetType, Map resolutionMap) { + if (targetType === null) return null + return switch (targetType) { VectorTypeConstructor: createVectorTypeConstructor => [ - val subType = resolutionMap.get(type.type) - type = substituteGenerics(type.typeObject.elementType.asType, resolutionMap).type - dimensions += type.dimensions.copyAll - if(subType.isVectorType) { - dimensions += subType.dimensions + val substituteType = resolutionMap.get(targetType.type) + type = substituteGenerics(targetType.typeObject.elementType.asType, resolutionMap).type + dimensions += targetType.dimensions.copyAll + if(substituteType.isVectorType) { + dimensions += substituteType.dimensions } ] MapTypeConstructor: createMapTypeConstructor => [ - type = substituteGenerics(type.typeObject.keyType.asType, resolutionMap).type - valueType = substituteGenerics(type.typeObject.valueType.asType, resolutionMap).asExprType + type = substituteGenerics(targetType.typeObject.keyType.asType, resolutionMap).type + valueType = substituteGenerics(targetType.typeObject.valueType.asType, resolutionMap).asExprType ] TypeReference: { // resolve generics or just the original type decl - return resolutionMap.getOrDefault(type.type,type) + return resolutionMap.getOrDefault(targetType.type,targetType) } default: - type + targetType } } From dd58456ab7fb1510911e25e2a9f75b23942d09fc Mon Sep 17 00:00:00 2001 From: Paul Nelissen Date: Tue, 28 Jul 2026 15:57:46 +0200 Subject: [PATCH 6/6] swap dimensions --- .../xtext/expressions/utilities/ExpressionsUtilities.xtend | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/nl.esi.xtext.expressions/src/nl/esi/xtext/expressions/utilities/ExpressionsUtilities.xtend b/bundles/nl.esi.xtext.expressions/src/nl/esi/xtext/expressions/utilities/ExpressionsUtilities.xtend index 67357b3..c02abee 100644 --- a/bundles/nl.esi.xtext.expressions/src/nl/esi/xtext/expressions/utilities/ExpressionsUtilities.xtend +++ b/bundles/nl.esi.xtext.expressions/src/nl/esi/xtext/expressions/utilities/ExpressionsUtilities.xtend @@ -328,10 +328,10 @@ class ExpressionsUtilities { VectorTypeConstructor: createVectorTypeConstructor => [ val substituteType = resolutionMap.get(targetType.type) type = substituteGenerics(targetType.typeObject.elementType.asType, resolutionMap).type - dimensions += targetType.dimensions.copyAll if(substituteType.isVectorType) { - dimensions += substituteType.dimensions + dimensions += substituteType.dimensions.copyAll } + dimensions += targetType.dimensions.copyAll ] MapTypeConstructor: createMapTypeConstructor => [ type = substituteGenerics(targetType.typeObject.keyType.asType, resolutionMap).type