launch
launch copied to clipboard
Allow eval substitutions with spaced expressions
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 -qpython -m pytest launch/test/launch/frontend/test_substitutions.py -qpython -m flake8 --ignore=E501 launch/launch/substitutions/python_expression.py launch/test/launch/substitutions/test_python_expression.pygit 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.
Tick the box to add this pull request to the merge queue (same as @mergifyio queue).
- [ ] Queue this pull request