cmd: quoted sheet targets, '=' separator, and 2D lists for set - #2
Merged
Conversation
- split_word is quote-aware, so 'My Sheet'!A1 (which help already advertised) parses instead of failing on "'My". - A '=' followed by whitespace after the target is the separator, not the value: set A1 = =SUM(..) is a formula, set A1 = 2025-10-26 a literal. Before, the scalar path passed '= …' to the engine as a formula. - set <range> = [[row], [row]] writes a table in one command. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot started reviewing on behalf of
Jerome Leclanche (jleclanche)
August 26, 2026 16:26
View session
There was a problem hiding this comment.
Pull request overview
This PR improves the sheet_exec command parser to better match documented set syntax and reduce ambiguity around sheet targets, separators, and list parsing.
Changes:
- Make target parsing quote-aware so
'My Sheet'!A1is treated as a single target token. - Treat
=(equals + whitespace) as an optional separator forset, avoiding accidental formula interpretation of scalar literals. - Add support for 2D list inputs (
[[row...], [row...]]) when setting multi-row ranges, and enhance list splitting to respect bracket depth.
Suppressed comments (1)
crates/sheetkit/src/cmd.rs:418
- cmd_set validates
raw.is_empty()before stripping the optional=separator, and the usage string doesn’t mention the newly-supported 2D list form. If the user provides only a separator (e.g.set A1 =), this path can fall through and produce a less helpful engine error rather than the set usage error.
let raw = strip_separator(raw);
if raw.starts_with('[') {
let inner = raw
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+214
to
220
| fn strip_separator(raw: &str) -> &str { | ||
| let trimmed = raw.trim(); | ||
| match trimmed.strip_prefix('=') { | ||
| Some(rest) if rest.starts_with(char::is_whitespace) => rest.trim_start(), | ||
| _ => trimmed, | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three parser fixes surfaced by a real agent session (five `sheet_exec` calls for one edit):
Tests added for all three; `help` updated.
🤖 Generated with Claude Code