From 54649246b0d062eada1144276946a2aa51454fac Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 13 Feb 2020 03:01:48 -0800 Subject: [PATCH] Bugfix --- schala-lang/language/src/parser.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/schala-lang/language/src/parser.rs b/schala-lang/language/src/parser.rs index 12fb4cd..0b1ad2c 100644 --- a/schala-lang/language/src/parser.rs +++ b/schala-lang/language/src/parser.rs @@ -70,20 +70,20 @@ fn parse_hex_literal(input: &str) -> IResult<&str, ExpressionKind> { Ok((rest, expr)) } -fn parse_string_literal(input: &str) -> IResult<&str, ExpressionKind> { - let (rest, _) = nom::character::complete::char('"')(input)?; - let (rest, string_output) = nom::bytes::complete::take_until("\"")(rest)?; - let (rest, _) = nom::character::complete::char('"')(rest)?; +fn parse_string_literal(text: &str) -> IResult<&str, ExpressionKind> { + let (text, _) = nom::character::complete::char('"')(text)?; + let (text, string_output) = nom::bytes::complete::take_until("\"")(text)?; + let (text, _) = nom::character::complete::char('"')(text)?; let expr = ExpressionKind::StringLiteral(Rc::new(string_output.to_string())); - Ok((rest, expr)) + Ok((text, expr)) } fn parse_literal(input: &str) -> IResult<&str, ExpressionKind> { alt(( parse_string_literal, - parse_number_literal, parse_hex_literal, parse_binary_literal, + parse_number_literal, parse_bool_literal ))(input) }