MCPcopy Create free account
hub / github.com/Stanford-Trinity/ARTEMIS / parse_command

Function parse_command

codex-rs/core/src/parse_command.rs:77–88  ·  view source on GitHub ↗

DO NOT REVIEW THIS CODE BY HAND This parsing code is quite complex and not easy to hand-modify. The easiest way to iterate is to add unit tests and have Codex fix the implementation. To encourage this, the tests have been put directly below this function rather than at the bottom of the Parses metadata out of an arbitrary command. These commands are model driven and could include just about anyth

(command: &[String])

Source from the content-addressed store, hash-verified

75/// The goal of the parsed metadata is to be able to provide the user with a human readable gis
76/// of what it is doing.
77pub fn parse_command(command: &[String]) -> Vec<ParsedCommand> {
78 // Parse and then collapse consecutive duplicate commands to avoid redundant summaries.
79 let parsed = parse_command_impl(command);
80 let mut deduped: Vec<ParsedCommand> = Vec::with_capacity(parsed.len());
81 for cmd in parsed.into_iter() {
82 if deduped.last().is_some_and(|prev| prev == &cmd) {
83 continue;
84 }
85 deduped.push(cmd);
86 }
87 deduped
88}
89
90#[cfg(test)]
91#[allow(clippy::items_after_test_module)]

Callers 3

assert_parsedFunction · 0.85
on_exec_command_beginMethod · 0.85

Calls 1

parse_command_implFunction · 0.85

Tested by 1