Skip to content

Commit

Permalink
Code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
nightscape committed May 8, 2024
1 parent 4fe3303 commit 5fd53eb
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions parser/src/cfg/chord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,19 @@ pub(crate) fn parse_defchordv2(
.collect_vec();
chars.insert(1, "50".to_string());

chars.append(&mut vec![
"sldr".to_string(),
"spc".to_string(),
"nop0".to_string(),
]);
chars.extend_from_slice(&["sldr".to_string(), "spc".to_string(), "nop0".to_string()]);
let sexpr_string = format!(
"(({}) (macro {}))",
participating_keys.join(" "),
chars.join(" ")
);
println!("sexpr_string: {:?}", sexpr_string);
let parsed = sexpr::parse(&sexpr_string, "foo").unwrap();
let appendix = vec![chunk[2].clone(), chunk[3].clone(), chunk[4].clone()];
let combined = [parsed[0].t.clone(), appendix].concat();
let chunk = combined.as_slice();
parse_single_chord(chunk, s)
});
Ok::<_, ParseError>(processed.collect_vec())
//
}
SExpr::List(_) => Ok(vec![parse_single_chord(chunk, s)]),
_ => Ok(vec![]),
Expand Down Expand Up @@ -183,7 +177,6 @@ fn parse_single_chord(chunk: &[SExpr], s: &ParserState) -> Result<ChordV2<'stati
bail_expr!(keys, "The minimum number of participating chord keys is 2");
}
let participants = parse_participating_keys(key_strings)?;

let action = parse_action(&chunk[1], s)?;
let timeout = parse_timeout(&chunk[2], s)?;
let release_behaviour = parse_release_behaviour(&chunk[3], s)?;
Expand Down

0 comments on commit 5fd53eb

Please sign in to comment.