From 6ff65ea610433c0258dbf60730843fe6ef15656a Mon Sep 17 00:00:00 2001 From: Garrit Franke Date: Fri, 18 Dec 2020 10:28:07 +0100 Subject: [PATCH] Fix booleans in functions calls --- src/parser/rules.rs | 1 + src/parser/tests.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/parser/rules.rs b/src/parser/rules.rs index 112d4f5..60bb4d3 100644 --- a/src/parser/rules.rs +++ b/src/parser/rules.rs @@ -174,6 +174,7 @@ impl Parser { TokenKind::Identifier(_) | TokenKind::Literal(_) => { args.push(self.parse_expression()?) } + TokenKind::Keyword(Keyword::Boolean) => args.push(self.parse_expression()?), _ => { return Err(self.make_error(TokenKind::BraceClose, next)); } diff --git a/src/parser/tests.rs b/src/parser/tests.rs index 60e6713..64c83dd 100644 --- a/src/parser/tests.rs +++ b/src/parser/tests.rs @@ -607,13 +607,14 @@ fn test_function_with_return_type() { } #[test] -#[ignore] fn test_booleans_in_function_call() { let raw = " - if n > 2 { - _printf(true) - } else { - _printf(true) + fn main() { + if n > 2 { + _printf(true) + } else { + _printf(true) + } } "; let tokens = tokenize(raw);