From 00aecbd156a4d4d846c955490697a62e5d9f49b0 Mon Sep 17 00:00:00 2001 From: Peva Blanchard Date: Fri, 20 Mar 2026 09:36:33 +0100 Subject: [PATCH 1/9] maven local: lcaac core v2.3.0 --- plugin/build.gradle.kts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 9e5473243..7d3da9840 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -28,14 +28,15 @@ kotlin { // Configure project's dependencies repositories { mavenCentral() - maven { - name = "github" - url = uri("https://maven.pkg.github.com/kleis-technology/lcaac") - credentials { - username = System.getenv("GITHUB_ACTOR") - password = System.getenv("GITHUB_TOKEN") - } - } +// maven { +// name = "github" +// url = uri("https://maven.pkg.github.com/kleis-technology/lcaac") +// credentials { +// username = System.getenv("GITHUB_ACTOR") +// password = System.getenv("GITHUB_TOKEN") +// } +// } + mavenLocal() } sourceSets { @@ -47,7 +48,7 @@ sourceSets { } dependencies { - implementation("ch.kleis.lcaac:core:2.0.0") + implementation("ch.kleis.lcaac:core:2.3.0") implementation(files(layout.buildDirectory.dir("stdlib/ef3.1")) { builtBy("generateEmissionFactors31") From 024732f27c321acb3f7d80942c2db6d355f16f4b Mon Sep 17 00:00:00 2001 From: Peva Blanchard Date: Fri, 20 Mar 2026 09:36:40 +0100 Subject: [PATCH 2/9] bnf: global parameters block --- plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/Lca.bnf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/Lca.bnf b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/Lca.bnf index 96e5ff771..a7b8f9dcb 100644 --- a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/Lca.bnf +++ b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/Lca.bnf @@ -92,7 +92,7 @@ LCA File */ -lcaFile ::= package? import* (process | test | dataSourceDefinition | unitDefinition | substance | globalVariables )* +lcaFile ::= package? import* (process | test | dataSourceDefinition | unitDefinition | substance | globalParameters | globalVariables )* /* Package @@ -129,6 +129,7 @@ columnDefinition ::= columnRef '=' dataExpression { Global variables */ +globalParameters ::= "params" '{' globalAssignment* '}' globalVariables ::= "variables" '{' globalAssignment* '}' globalAssignment ::= dataRef '=' dataExpression { implements=["ch.kleis.lcaac.plugin.language.psi.type.PsiGlobalAssignment"] From fc88b14f1203171af3e719a7c3a7f3d0ce8cb399 Mon Sep 17 00:00:00 2001 From: Peva Blanchard Date: Fri, 20 Mar 2026 09:42:21 +0100 Subject: [PATCH 3/9] loader: read global parameters --- .../lcaac/plugin/language/loader/LcaLoader.kt | 22 ++++++++++++++----- .../lcaac/plugin/language/loader/LcaMapper.kt | 2 +- .../lcaac/plugin/language/psi/LcaFile.kt | 10 ++++++++- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaLoader.kt b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaLoader.kt index d18329206..615238fa7 100644 --- a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaLoader.kt +++ b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaLoader.kt @@ -50,7 +50,7 @@ class LcaLoader( throw EvaluatorException("Duplicate substance ${e.duplicates} defined") } - val globals = try { + val globalVariables = try { DataRegister.empty>() .plus( unitDefinitions @@ -66,7 +66,7 @@ class LcaLoader( ) .plus( files - .flatMap { it.getGlobalAssignments() } + .flatMap { it.getGlobalVariables() } .map { DataKey(it.first) to dataExpression(it.second) } .asIterable() ) @@ -74,12 +74,23 @@ class LcaLoader( throw EvaluatorException("Duplicate global variable ${e.duplicates} defined") } + val globalParameters = try { + DataRegister.empty>() + .plus(files + .flatMap { it.getGlobalParameters() } + .map { DataKey(it.first) to dataExpression(it.second) } + .asIterable() + ) + } catch (e: RegisterException) { + throw EvaluatorException("Duplicate global variable ${e.duplicates} defined") + } + val dataSources = try { DataSourceRegister.empty>() .plus( dataSourceDefinitions.map { DataSourceKey(it.getDataSourceRef().name) to dataSourceDefinition(it) } - .asIterable() + .asIterable() ) } catch (e: RegisterException) { throw EvaluatorException("Duplicate data source ${e.duplicates} defined") @@ -89,7 +100,7 @@ class LcaLoader( ProcessTemplateRegister.empty>() .plus( processDefinitions - .map { Pair(it.buildUniqueKey(), process(it, globals, dataSources)) } + .map { Pair(it.buildUniqueKey(), process(it, globalVariables, dataSources)) } .asIterable() ) } catch (e: RegisterException) { @@ -97,7 +108,8 @@ class LcaLoader( } return SymbolTable( - data = globals, + globalParameters = globalParameters, + globalVariables = globalVariables, dataSources = dataSources, processTemplates = processTemplates, dimensions = dimensions, diff --git a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaMapper.kt b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaMapper.kt index 3dd7b349b..efeb911ff 100644 --- a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaMapper.kt +++ b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaMapper.kt @@ -40,7 +40,7 @@ class LcaMapper( val locals = psiProcess.getVariables().mapValues { dataExpression(it.value) } val params = psiProcess.getParameters().mapValues { dataExpression(it.value) } val symbolTable = SymbolTable( - data = try { + globalVariables = try { Register( globals .plus(params.mapKeys { DataKey(it.key) }) diff --git a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/psi/LcaFile.kt b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/psi/LcaFile.kt index b69f1462e..dd8cfb95c 100644 --- a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/psi/LcaFile.kt +++ b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/psi/LcaFile.kt @@ -51,7 +51,15 @@ class LcaFile(viewProvider: FileViewProvider) : PsiFileBase(viewProvider, LcaLan return PsiTreeUtil.getChildrenOfTypeAsList(this, LcaSubstance::class.java) } - fun getGlobalAssignments(): Collection> { + fun getGlobalParameters(): Collection> { + return PsiTreeUtil.getChildrenOfTypeAsList(this, LcaGlobalParameters::class.java) + .flatMap { + it.globalAssignmentList + .map { a -> a.getDataRef().name to a.getValue() } + } + } + + fun getGlobalVariables(): Collection> { return PsiTreeUtil.getChildrenOfTypeAsList(this, LcaGlobalVariables::class.java) .flatMap { it.globalAssignmentList From 56a26f9bea1d6dd996dc65169169b0555716a9a8 Mon Sep 17 00:00:00 2001 From: Peva Blanchard Date: Fri, 20 Mar 2026 09:55:31 +0100 Subject: [PATCH 4/9] csv processor: include global parameters --- .../lcaac/plugin/actions/csv/CsvProcessor.kt | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/actions/csv/CsvProcessor.kt b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/actions/csv/CsvProcessor.kt index ed56c92cf..482b316d7 100644 --- a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/actions/csv/CsvProcessor.kt +++ b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/actions/csv/CsvProcessor.kt @@ -32,32 +32,22 @@ class CsvProcessor( ) ) private val sourceOps = DefaultDataSourceOperations(ops, config, factory.buildConnectors()) - private val evaluator = Evaluator(symbolTable, ops, sourceOps) fun process(request: CsvRequest): List { + val globalParameters = parseOverrides( + symbolTable.globalParameters.toMap().mapKeys { it.key.name }, + request, + ) val reqName = request.processName val reqLabels = request.matchLabels val template = symbolTable.getTemplate(reqName, reqLabels) ?: throw EvaluatorException("Could not get template for ${request.processName}") + val processParameters = parseOverrides(template.params, request) - val arguments = template.params - .mapValues { entry -> - when (val v = entry.value) { - is QuantityExpression<*> -> request[entry.key]?.let { - val amount = parseDouble(it) - EQuantityScale(ops.pure(amount), EUnitOf(v)) - } ?: entry.value - - is StringExpression -> request[entry.key]?.let { - EStringLiteral(it) - } ?: entry.value - - else -> throw EvaluatorException("$v is not a supported data expression") - } - } - - val trace = evaluator.trace(template, arguments) + val st = symbolTable.overrideGlobalParameters(globalParameters) + val evaluator = Evaluator(st, ops, sourceOps) + val trace = evaluator.trace(template, processParameters) val systemValue = trace.getSystemValue() val entryPoint = trace.getEntryPoint() val program = ContributionAnalysisProgram(systemValue, entryPoint) @@ -73,4 +63,23 @@ class CsvProcessor( ) } } + + private fun parseOverrides( + data: Map>, + request: CsvRequest + ): Map> = data + .mapValues { entry -> + when (val v = entry.value) { + is QuantityExpression<*> -> request[entry.key]?.let { + val amount = parseDouble(it) + EQuantityScale(ops.pure(amount), EUnitOf(v)) + } ?: entry.value + + is StringExpression -> request[entry.key]?.let { + EStringLiteral(it) + } ?: entry.value + + else -> throw EvaluatorException("$v is not a supported data expression") + } + } } From e47c2dd4bb71e80a9b30a61cd03e02deea100853 Mon Sep 17 00:00:00 2001 From: Peva Blanchard Date: Wed, 25 Mar 2026 23:27:16 +0100 Subject: [PATCH 5/9] fix loader and mapper --- .../ch/kleis/lcaac/plugin/language/loader/LcaLoader.kt | 2 +- .../ch/kleis/lcaac/plugin/language/loader/LcaMapper.kt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaLoader.kt b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaLoader.kt index 615238fa7..c28c99ec8 100644 --- a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaLoader.kt +++ b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaLoader.kt @@ -100,7 +100,7 @@ class LcaLoader( ProcessTemplateRegister.empty>() .plus( processDefinitions - .map { Pair(it.buildUniqueKey(), process(it, globalVariables, dataSources)) } + .map { Pair(it.buildUniqueKey(), process(it, globalParameters, globalVariables, dataSources)) } .asIterable() ) } catch (e: RegisterException) { diff --git a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaMapper.kt b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaMapper.kt index efeb911ff..8ecf8959e 100644 --- a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaMapper.kt +++ b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaMapper.kt @@ -32,7 +32,8 @@ class LcaMapper( fun process( psiProcess: LcaProcess, - globals: DataRegister, + globalParameters: DataRegister, + globalVariables: DataRegister, dataSources: DataSourceRegister, ): EProcessTemplate { val name = psiProcess.name @@ -40,9 +41,10 @@ class LcaMapper( val locals = psiProcess.getVariables().mapValues { dataExpression(it.value) } val params = psiProcess.getParameters().mapValues { dataExpression(it.value) } val symbolTable = SymbolTable( + globalParameters, globalVariables = try { Register( - globals + globalVariables .plus(params.mapKeys { DataKey(it.key) }) .plus(locals.mapKeys { DataKey(it.key) }) ) From b6cc3e76e0cedf8d2e07ecfc45639304958c6734 Mon Sep 17 00:00:00 2001 From: Peva Blanchard Date: Wed, 25 Mar 2026 23:27:25 +0100 Subject: [PATCH 6/9] refactor sensitivity analysis task --- .../actions/tasks/SensitivityAnalysisTask.kt | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/actions/tasks/SensitivityAnalysisTask.kt b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/actions/tasks/SensitivityAnalysisTask.kt index db39883b4..6697431b0 100644 --- a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/actions/tasks/SensitivityAnalysisTask.kt +++ b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/actions/tasks/SensitivityAnalysisTask.kt @@ -56,12 +56,17 @@ class SensitivityAnalysisTask( indicator.isIndeterminate = true // nb params via psi - val nbQuantitativeParams = runReadAction { + val nbGlobalParams = runReadAction { + val collector = LcaFileCollector(file.project) + collector.collect(file).flatMap { it.getGlobalParameters() }.toList().size + } + val nbProcessQuantitativeParams = runReadAction { val fqn = "${file.getPackageName()}.$processName" ProcessStubKeyIndex.findProcesses(project, fqn, matchLabels).first().getParameters() .filter { it.value !is LcaStringExpression } .size } + val nbQuantitativeParams = nbGlobalParams + nbProcessQuantitativeParams val ops = DualOperations(nbQuantitativeParams) if (nbQuantitativeParams == 0) { NotificationGroupManager.getInstance() @@ -101,10 +106,29 @@ class SensitivityAnalysisTask( ) ) val sourceOps = DefaultDataSourceOperations(ops, config, factory.buildConnectors()) - val (arguments, parameters) = - prepareArguments(ops, sourceOps, symbolTable, template.params) - val trace = Evaluator(symbolTable, ops, sourceOps).trace(template, arguments) - this.analysis = SensitivityAnalysisProgram(trace.getSystemValue(), trace.getEntryPoint(), parameters).run() + val (globalArguments, globalParameters) = + prepareArguments( + ops, sourceOps, symbolTable, + symbolTable.globalParameters.toMap().mapKeys { it.key.name }, + offset = 0, + ) + val st = symbolTable.overrideGlobalParameters(globalArguments) + val evaluator = Evaluator(st, ops, sourceOps) + val (processArguments, processParameters) = + prepareArguments( + ops, sourceOps, symbolTable, + template.params, + offset = globalParameters.size(), + ) + val trace = evaluator.trace(template, processArguments) + val allParameters = globalParameters + processParameters + this.analysis = + SensitivityAnalysisProgram( + trace.getSystemValue(), + trace.getEntryPoint(), + allParameters, + ops, + ).run() } override fun onSuccess() { @@ -142,7 +166,8 @@ class SensitivityAnalysisTask( ops: DualOperations, sourceOps: DataSourceOperations, symbolTable: SymbolTable, - params: Map> + params: Map>, + offset: Int = 0, ): Pair>, ParameterVector> { val dataReducer = DataExpressionReducer(symbolTable.data, symbolTable.dataSources, ops, sourceOps) val reduced = params.mapValues { dataReducer.reduce(it.value) } @@ -151,7 +176,7 @@ class SensitivityAnalysisTask( .mapIndexed { index: Int, (name, value): Pair> -> with(ops) { name to EQuantityScale( - value.scale * (pure(1.0) + basis(index)), + value.scale * (pure(1.0) + basis(offset + index)), value.base, ) } From c42adce98027008393aa3c3a244c4b11eed48401 Mon Sep 17 00:00:00 2001 From: Peva Blanchard Date: Thu, 26 Mar 2026 17:28:13 +0100 Subject: [PATCH 7/9] stub index version bump --- .../ch/kleis/lcaac/plugin/language/psi/stub/StubIndexVersion.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/psi/stub/StubIndexVersion.kt b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/psi/stub/StubIndexVersion.kt index a528118e2..269c1a6e8 100644 --- a/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/psi/stub/StubIndexVersion.kt +++ b/plugin/src/main/kotlin/ch/kleis/lcaac/plugin/language/psi/stub/StubIndexVersion.kt @@ -3,4 +3,4 @@ package ch.kleis.lcaac.plugin.language.psi.stub /** * Should be incremented when the stub structure is modified. */ -const val stubIndexVersion: Int = 8 +const val stubIndexVersion: Int = 9 From 3adc6875f4a2256016f13c50d6a57f78cbdae45f Mon Sep 17 00:00:00 2001 From: Peva Blanchard Date: Thu, 26 Mar 2026 17:51:26 +0100 Subject: [PATCH 8/9] gradle: maven github --- plugin/build.gradle.kts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 7d3da9840..da9178167 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -28,15 +28,14 @@ kotlin { // Configure project's dependencies repositories { mavenCentral() -// maven { -// name = "github" -// url = uri("https://maven.pkg.github.com/kleis-technology/lcaac") -// credentials { -// username = System.getenv("GITHUB_ACTOR") -// password = System.getenv("GITHUB_TOKEN") -// } -// } - mavenLocal() + maven { + name = "github" + url = uri("https://maven.pkg.github.com/kleis-technology/lcaac") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } } sourceSets { From fe0924c1c4294b657f21776716f1d4aee60a5cb9 Mon Sep 17 00:00:00 2001 From: Peva Blanchard Date: Thu, 26 Mar 2026 19:49:29 +0100 Subject: [PATCH 9/9] fix test --- .../ch/kleis/lcaac/plugin/e2e/E2ETest.kt | 4 ++-- .../ide/syntax/LanguageCompletionTest.kt | 9 +++++---- .../plugin/language/loader/LcaLoaderTest.kt | 19 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plugin/src/test/kotlin/ch/kleis/lcaac/plugin/e2e/E2ETest.kt b/plugin/src/test/kotlin/ch/kleis/lcaac/plugin/e2e/E2ETest.kt index 504a37255..d50766700 100644 --- a/plugin/src/test/kotlin/ch/kleis/lcaac/plugin/e2e/E2ETest.kt +++ b/plugin/src/test/kotlin/ch/kleis/lcaac/plugin/e2e/E2ETest.kt @@ -135,7 +135,7 @@ class E2ETest : BasePlatformTestCase() { // then Prelude.unitMap().forEach { - assertNotNull(symbolTable.getData(it.key)) + assertNotNull(symbolTable.getGlobalVariable(it.key)) } } @@ -587,7 +587,7 @@ class E2ETest : BasePlatformTestCase() { // when val symbolTable = createFilesAndSymbols(vf) - val target = symbolTable.getData("q")!! + val target = symbolTable.getGlobalVariable("q")!! val reducer = DataExpressionReducer(symbolTable.data, symbolTable.dataSources, ops, mockk()) val actual = with(ToValue(ops)) { reducer.reduce(target).toValue() diff --git a/plugin/src/test/kotlin/ch/kleis/lcaac/plugin/language/ide/syntax/LanguageCompletionTest.kt b/plugin/src/test/kotlin/ch/kleis/lcaac/plugin/language/ide/syntax/LanguageCompletionTest.kt index 7f08ed7c4..25bda5b9d 100644 --- a/plugin/src/test/kotlin/ch/kleis/lcaac/plugin/language/ide/syntax/LanguageCompletionTest.kt +++ b/plugin/src/test/kotlin/ch/kleis/lcaac/plugin/language/ide/syntax/LanguageCompletionTest.kt @@ -21,15 +21,16 @@ class LanguageCompletionTest : LcaCompletionTestCase() { assertNotNull(lookupElementStrings) assertSameElements( lookupElementStrings!!, + "@cached", + "datasource", "import", "package", + "params", "process", "substance", + "test", "unit", "variables", - "test", - "datasource", - "@cached" ) } @@ -44,7 +45,7 @@ class LanguageCompletionTest : LcaCompletionTestCase() { // Then assertNotNull(lookupElementStrings) - assertSameElements(lookupElementStrings!!, "import", "package", "process") + assertSameElements(lookupElementStrings!!, "package", "params", "process", "import") } @Test diff --git a/plugin/src/test/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaLoaderTest.kt b/plugin/src/test/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaLoaderTest.kt index dc7df1cd8..6e031b3d7 100644 --- a/plugin/src/test/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaLoaderTest.kt +++ b/plugin/src/test/kotlin/ch/kleis/lcaac/plugin/language/loader/LcaLoaderTest.kt @@ -13,7 +13,6 @@ import ch.kleis.lcaac.core.math.basic.BasicOperations import ch.kleis.lcaac.plugin.fixture.UnitFixture import ch.kleis.lcaac.plugin.language.psi.LcaFile import com.intellij.testFramework.ParsingTestCase -import io.mockk.mockk import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 @@ -45,7 +44,7 @@ class LcaLoaderTest : ParsingTestCase("", "lca", LcaParserDefinition()) { // when val symbolTable = parser.load() val actual = listOf("a", "b", "c", "d", "e") - .associateWith { symbolTable.getData(it)!! } + .associateWith { symbolTable.getGlobalVariable(it)!! } // then val expected: Map> = mapOf( @@ -310,7 +309,7 @@ class LcaLoaderTest : ParsingTestCase("", "lca", LcaParserDefinition()) { ) // when - val actual = parser.load().getData("x") + val actual = parser.load().getGlobalVariable("x") // then val expected = EStringLiteral("hello") @@ -412,7 +411,7 @@ class LcaLoaderTest : ParsingTestCase("", "lca", LcaParserDefinition()) { val symbolTable = parser.load() // then - val actual = symbolTable.getData("lbs") + val actual = symbolTable.getGlobalVariable("lbs") val expect = EUnitAlias("lbs", EQuantityScale(ops.pure(2.2), EDataRef("kg"))) assertEquals(expect, actual) } @@ -436,7 +435,7 @@ class LcaLoaderTest : ParsingTestCase("", "lca", LcaParserDefinition()) { val unit = "fooSymbol" // when - val quantity = symbolTable.getData("fooUnitName") as EUnitLiteral + val quantity = symbolTable.getGlobalVariable("fooUnitName") as EUnitLiteral // then assertEquals(quantity.symbol.toString(), unit) @@ -771,7 +770,7 @@ class LcaLoaderTest : ParsingTestCase("", "lca", LcaParserDefinition()) { // then val unitsSymbolTable = SymbolTable( - data = symbolTable.data + globalVariables = symbolTable.globalVariables, ) val expected = EProcessTemplate( body = EProcess( @@ -1078,7 +1077,7 @@ class LcaLoaderTest : ParsingTestCase("", "lca", LcaParserDefinition()) { // then val actual = ((symbolTable.getTemplate("carrot") as EProcessTemplate).body).products[0] val unitsSymbolTable = SymbolTable( - data = symbolTable.data + globalVariables = symbolTable.globalVariables ) val expected = ETechnoExchange( EQuantityScale(ops.pure(1.0), EDataRef("kg")), @@ -1111,7 +1110,7 @@ class LcaLoaderTest : ParsingTestCase("", "lca", LcaParserDefinition()) { // then val actual = ((symbolTable.getTemplate("carrot") as EProcessTemplate).body).products[0] val unitsSymbolTable = SymbolTable( - data = symbolTable.data + globalVariables = symbolTable.globalVariables ) val expect = ETechnoExchange( EQuantityScale(ops.pure(1.0), EDataRef("kg")), @@ -1234,7 +1233,7 @@ class LcaLoaderTest : ParsingTestCase("", "lca", LcaParserDefinition()) { val symbolTable = parser.load() // then - val actual = symbolTable.getData("r")!! + val actual = symbolTable.getGlobalVariable("r")!! assertEquals(expected, actual) } @@ -1267,7 +1266,7 @@ class LcaLoaderTest : ParsingTestCase("", "lca", LcaParserDefinition()) { val symbolTable = parser.load() // then - val actual = symbolTable.getData("r")!! + val actual = symbolTable.getGlobalVariable("r")!! assertEquals(expected, actual) }