Skip to content

[IMP] compiler: improve expression parser scoping and template string handling#1883

Merged
ged-odoo merged 1 commit into
odoo:masterfrom
piso-odoo:master-imp-expr-parser-scoping-piso
May 12, 2026
Merged

[IMP] compiler: improve expression parser scoping and template string handling#1883
ged-odoo merged 1 commit into
odoo:masterfrom
piso-odoo:master-imp-expr-parser-scoping-piso

Conversation

@piso-odoo
Copy link
Copy Markdown
Collaborator

The current expression parser uses a flat local variable tracking mechanism, which leads to incorrect behavior in nested arrow functions and template string interpolations.

This commit introduces a scope stack to properly track variable scopes across nested expressions. It also propagates local variables into template string interpolations to ensure correct variable resolution.

Key improvements:

  • Proper handling of nested arrow function scopes
  • Correct tracking of local variables using a scope stack
  • Support for seeded locals in template string expressions
  • Prevent incorrect context lookups inside template strings

… handling

The current expression parser uses a flat local variable tracking mechanism,
which leads to incorrect behavior in nested arrow functions and template
string interpolations.

This commit introduces a scope stack to properly track variable scopes across
nested expressions. It also propagates local variables into template string
interpolations to ensure correct variable resolution.

Key improvements:
- Proper handling of nested arrow function scopes
- Correct tracking of local variables using a scope stack
- Support for seeded locals in template string expressions
- Prevent incorrect context lookups inside template strings
@ged-odoo ged-odoo merged commit ec21ee2 into odoo:master May 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants