mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-08-28 05:27:41 +00:00
Replace the hand-rolled byte scanner in strip_css_comments with a str::find loop over "/*" and "*/". Drop the quote and backslash tracking. The stylesheet language has no string literals: parse_declarations ends a value at the first ';' or '}' with no quote awareness, and values flow into AttrValue::String verbatim, so a quoted model name is just an unknown model. Tracking quotes here also created a failure mode the simple scan does not have. An unpaired apostrophe, as in `model: don't`, disabled comment stripping for the rest of the input and then blamed a well-formed comment for the parse error. Also drop the Cow and its copied_through watermark. They avoided one allocation on a graph attribute of a few hundred bytes, parsed once per workflow load, in a function whose caller already clones the attribute and whose parser allocates a String per property and per value. Extract excerpt() for the error snippets. The two existing call sites sliced raw bytes at index 20, which panics when a multi-byte character straddles the cutoff; model_stylesheet is arbitrary user text, so that was reachable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| brainstorms | ||
| ideation | ||
| internal | ||
| plans | ||
| public | ||
| superpowers | ||