Fix edge cases in language optimizer regexes#42
Conversation
…s, and chained shell commands
This commit updates `_span_patterns()` in `soma_language_optimizer_core.py`:
- Expands the `{...}` regex to match up to 4 levels of depth, which correctly protects deeply nested JSON structures and multiline Swift closures.
- Modifies the inline shell command regex to permit up to 40 arguments (up from 8), allowing long chained commands with operators.
- Fixes shell argument parsing to exclude backticks and prevent swallowing trailing punctuation, accurately protecting paths like `.txt` without matching trailing periods/commas in natural text.
- Reorders the pattern list to evaluate the structural `{}` bracket regex *before* the internal camelCase identifier regex, preventing internal camelCase keys from causing overlap skips and truncating the outer code block.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Fix edge cases in language optimizer regexes for nested JSON, closures, and chained shell commands
PR created automatically by Jules for task 6582744517876628760 started by @Daliys