Browse Source

Fix booleans in functions calls

github-actions v0.0.4
Garrit Franke 2 years ago
parent
commit
6ff65ea610
  1. 1
      src/parser/rules.rs
  2. 11
      src/parser/tests.rs

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

11
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);

Loading…
Cancel
Save