Skip to content

Eager inlines a negative value at the start of {{ }}, which legacy parsing reads as whitespace control #5

Backlog

Description

@AlpriElse

All line references are at master b83755e9.

With lenient whitespace-control parsing (legacy overrides built from LegacyOverrides.newBuilder()), a - at the start of an expression is read as a trim marker even after a space. Eager output can start with an inlined negative value, so the second pass drops the minus. The 3.0 default (THREE_POINT_0, strict parsing) is not affected.

Repro

{# legacy overrides; c = -1, a deferred #}
{{ c + a }}
{#
  eager output:  {{ -1 + a }}
  evaluates to:  1
  expected:      -1
#}

Root cause (initial investigation)

Verified with probes: {{ c + a }} and {{ c - a }} fail under legacy; {{ a + c }} and the 3.0 overrides are fine; parenthesized forms render correctly.

Fix sketch (not implemented)

In wrapInExpression, when the output starts with - (after whitespace), emit {{ (<output>) }}, optionally only when !isParseWhitespaceControlStrictly(). {{ (-1 + a) }} renders -1 under legacy parsing.

Classification

isolated: EagerExpressionStrategy.java plus a test under both legacy and 3.0 overrides.

Activity

  1. added
    eager execution
    isolated
    sev3
    on Nov 24, 2026
  2. changed the title [-]PBT-3: Eager inlines a negative value at the start of `{{ }}`, which legacy parsing reads as whitespace control[/-] [+]Eager inlines a negative value at the start of `{{ }}`, which legacy parsing reads as whitespace control[/+] on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    eager executionisolatedsev3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions