feat: add error recovery to action parser#16
feat: add error recovery to action parser#16google-labs-jules[bot] wants to merge 1 commit intodevfrom
Conversation
- Update `action.parser.ts` to include `consumeError` rule. - `consumeError` skips tokens until a semicolon is found, allowing the parser to continue after an error. - Update `actions` rule to optionally match `consumeError` if a valid action is not found. - Update `Action.parse` to log errors but return the partially valid CST result. - Update `debug` method to detect if `consumeError` was triggered. - Update visitor to handle potential missing nodes gracefully. - Revert unintended changes to duplicate action handling (keep first).
|
👋 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. |
This PR implements error recovery in the action parser using Chevrotain. When an invalid action is encountered in a semicolon-separated list of actions, the parser will now skip the invalid tokens until the next semicolon and continue parsing subsequent actions. This prevents the entire parse from failing due to a single syntax error. The errors are logged to the console, and the valid actions are returned. The
debugmethod has also been updated to correctly report strings containing recovered errors as invalid.PR created automatically by Jules for task 6759689772035151301 started by @7185