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) }