Merge pull request #373 from Ekleog/parse-ofborg

Parse @ofborg invocation
This commit is contained in:
Graham Christensen 2019-07-03 18:18:15 -04:00 committed by GitHub
commit 20bb9e53ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@ named!(normal_token(CompleteStr) -> CompleteStr,
named!(parse_line_impl(CompleteStr) -> Option<Vec<Instruction>>, alt!( named!(parse_line_impl(CompleteStr) -> Option<Vec<Instruction>>, alt!(
do_parse!( do_parse!(
res: ws!(many1!(ws!(preceded!( res: ws!(many1!(ws!(preceded!(
tag_no_case!("@grahamcofborg"), alt!(tag_no_case!("@grahamcofborg") | tag_no_case!("@ofborg")),
alt!( alt!(
ws!(do_parse!( ws!(do_parse!(
tag!("build") >> tag!("build") >>
@ -129,7 +129,7 @@ mod tests {
parse( parse(
" "
@grahamcofborg build bar @grahamcofborg build bar
@grahamcofborg eval @ofborg eval
@grahamcofborg build foo", @grahamcofborg build foo",
) )
); );
@ -178,7 +178,7 @@ Also, just in case, let's try foo
vec![String::from("foo"), String::from("bar")] vec![String::from("foo"), String::from("bar")]
),]), ),]),
parse( parse(
"@GrahamCOfBorg build foo bar "@OfBorg build foo bar
baz", baz",
) )
@ -211,7 +211,7 @@ baz",
String::from("baz"), String::from("baz"),
] ]
),]), ),]),
parse("@GrahamCOfBorg build foo bar baz") parse("@OfBorg build foo bar baz")
); );
} }
@ -241,7 +241,7 @@ baz",
String::from("baz.Baz"), String::from("baz.Baz"),
] ]
),]), ),]),
parse("@grahamcofborg build foo bar baz.Baz") parse("@ofborg build foo bar baz.Baz")
); );
} }