Skip to main content

parse_patch

Function parse_patch 

Source
pub fn parse_patch(patch_text: &str) -> Result<Vec<Hunk>, String>
Expand description

Parse an opencode apply_patch envelope; mirrors patch-parser.ts:148-201.

The size guard uses patch_text.len() bytes. TypeScript uses string length, but the port intentionally guards bytes so Rust bounds actual allocation size.