aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-04 16:04:51 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-04 16:04:51 -0600
commitf28e74c6c28c58819cbdc69994ce17407443bbb4 (patch)
tree815b1db3bbd8e75a7aac163463f6f569c142ac23
parent813049bf86f73015b6656cca38364df5aa06b098 (diff)
downloadmakers-f28e74c6c28c58819cbdc69994ce17407443bbb4.tar.gz
makers-f28e74c6c28c58819cbdc69994ce17407443bbb4.zip
auto-yeet spaces after comma between function arguments
-rw-r--r--src/makefile/token.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/makefile/token.rs b/src/makefile/token.rs
index 18a1773..44d8c8b 100644
--- a/src/makefile/token.rs
+++ b/src/makefile/token.rs
@@ -13,7 +13,10 @@ use nom::{
Finish, IResult,
};
#[cfg(feature = "full")]
-use nom::{character::complete::space1, multi::separated_list1};
+use nom::{
+ character::complete::{space0, space1},
+ multi::separated_list1,
+};
trait Err<'a>: 'a + ParseError<&'a str> + ContextError<&'a str> {}
impl<'a, T: 'a + ParseError<&'a str> + ContextError<&'a str>> Err<'a> for T {}
@@ -210,7 +213,7 @@ fn function_call_body<'a, E: Err<'a>>(
separated_pair(
macro_function_name,
space1,
- separated_list1(tag(","), tokens_but_not(vec![',', end])),
+ separated_list1(pair(tag(","), space0), tokens_but_not(vec![',', end])),
),
|(name, args)| Token::FunctionCall {
name: name.into(),
@@ -460,7 +463,7 @@ mod test {
tokens,
TokenString(vec![token_function_call(
"foo",
- vec![TokenString::text("bar"), tokenize(" $(baz)")?]
+ vec![TokenString::text("bar"), tokenize("$(baz)")?]
)])
);
Ok(())