MCPcopy Create free account
hub / github.com/PerroEngine/Perro / project_command

Function project_command

perro_source/devtools/perro_cli/src/project.rs:765–792  ·  view source on GitHub ↗
(args: &[String], cwd: &Path)

Source from the content-addressed store, hash-verified

763 }
764
765 out
766}
767
768fn format_key_value_line(line: &str) -> String {
769 let Some(eq_idx) = find_equals_outside_strings(line) else {
770 return line.to_string();
771 };
772 let (left, right) = line.split_at(eq_idx);
773 format!("{} = {}", left.trim(), right[1..].trim())
774}
775
776fn find_equals_outside_strings(line: &str) -> Option<usize> {
777 let mut escaped = false;
778 let mut in_string = false;
779 for (idx, ch) in line.char_indices() {
780 if escaped {
781 escaped = false;
782 continue;
783 }
784 match ch {
785 '\\' if in_string => escaped = true,
786 '"' => in_string = !in_string,
787 '=' if !in_string => return Some(idx),
788 _ => {}
789 }
790 }
791 None
792}
793
794fn leading_close_braces(line: &str) -> usize {
795 line.chars().take_while(|ch| *ch == '}').count()

Callers 1

mainFunction · 0.85

Calls 13

parse_cli_targetFunction · 0.85
build_web_commandFunction · 0.85
build_android_commandFunction · 0.85
log_stepFunction · 0.85
compile_project_bundleFunction · 0.85
log_doneFunction · 0.85
anyMethod · 0.80
parse_flag_valueFunction · 0.70
resolve_local_pathFunction · 0.70
workspace_rootFunction · 0.70

Tested by

no test coverage detected