launch icon indicating copy to clipboard operation
launch copied to clipboard

Allow eval substitutions with spaced expressions

Open dlanov opened this issue 4 months ago • 1 comments

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.

dlanov avatar Jul 08 '26 17:07 dlanov

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

  • [ ] Queue this pull request

mergify[bot] avatar Jul 08 '26 17:07 mergify[bot]