Skip to content

Allow eval substitutions with spaced expressions#981

Open
dlanov wants to merge 1 commit into
ros2:rollingfrom
dlanov:allow-spaces-in-eval-substitution
Open

Allow eval substitutions with spaced expressions#981
dlanov wants to merge 1 commit into
ros2:rollingfrom
dlanov:allow-spaces-in-eval-substitution

Conversation

@dlanov

@dlanov dlanov commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Allows eval substitutions to parse expressions that the frontend splits across multiple arguments because of spaces.

For example, $(eval 1 == 1) can now be parsed by joining the split expression arguments back together with spaces.

Changes

  • Updates PythonExpression.parse() to accept three or more expression arguments.
  • Joins split expression arguments with spaces before constructing the substitution.
  • Adds a focused unit test for parsing a split expression.

Testing

  • python -m pytest launch/test/launch/substitutions/test_python_expression.py -q
  • python -m pytest launch/test/launch/frontend/test_substitutions.py -q
  • python -m flake8 --ignore=E501 launch/launch/substitutions/python_expression.py launch/test/launch/substitutions/test_python_expression.py
  • git diff --check

Issue reference

Relates #469

Notes

This keeps the existing one-argument and two-argument parsing behavior unchanged.
In particular, this PR does not change the existing handling of unescaped quote characters in frontend expressions.

AI assistance disclosure

Claude Code helped prepare this code change and test.
I manually reviewed the diff and test results.

Signed-off-by: Dennis Lanov <dennis.lanov@gmail.com>
@mergify

mergify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

1 participant