Skip to content

Recursive interpolation stripping in tests and definition-key expression fallback#17

Closed
sibmaks wants to merge 2 commits intomainfrom
codex/add-flag-for-expression-handling-in-options-syzqdq
Closed

Recursive interpolation stripping in tests and definition-key expression fallback#17
sibmaks wants to merge 2 commits intomainfrom
codex/add-flag-for-expression-handling-in-options-syzqdq

Conversation

@sibmaks
Copy link
Owner

@sibmaks sibmaks commented Jan 14, 2026

Motivation

  • Ensure test normalization unwraps {{ ... }} interpolation for nested definition structures so definition-key handling in tests matches runtime behavior.
  • Allow definition keys to be parsed as expressions with a safe fallback to raw keys to support keys without explicit {{ }} braces.

Description

  • Added definitionKeyExpressionFallback option to TemplateCompileOptions with a default of false to control parsing fallback behavior.
  • Updated TemplateCompilerImpl to pass the new option into RootTemplateExpressionFactory and to use a dedicated compileDefinitionObject entrypoint for compiling definition maps.
  • Reworked RootTemplateExpressionFactory to support optional key parsing fallback via parseObjectKey(..., allowFallback), added compileDefinitionObject, logging on parse failures, and helper methods containsExpression and looksLikeExpression to decide when to treat raw keys as expressions.
  • Enhanced TemplateCompilerImplIntegrationTest to recursively strip interpolation from nested definition values using stripDefinitionValue and added tests testScenarioWithDefinitionKeysWithoutBraces and testScenarioWithDefinitionKeysAndFallback along with stripInterpolation/isSwitchOrRangeKey helpers.

Testing

  • No automated tests were executed for this change.

Codex Task

@sibmaks sibmaks closed this Feb 6, 2026
@sibmaks sibmaks deleted the codex/add-flag-for-expression-handling-in-options-syzqdq branch February 6, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant