Skip to content

Commit

Permalink
🚧 WIP
Browse files Browse the repository at this point in the history
semver: chore
  • Loading branch information
Somfic committed Oct 31, 2024
1 parent 2f4e41f commit 8a4f44b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ fn main() {
}))
.unwrap();

let input = "true if true else 12 if true else 'h';
let input = " fn main() {
fib(9999);
}
fn fib(n ~ int) ~ int {
if n < 2 return n;
fib(n - 1) + fib(n - 20)
}
";

let mut parser = Parser::new(input);
Expand Down Expand Up @@ -67,8 +74,9 @@ fn print_statement(statement: Statement) {
print_statement(statement);
}
}
Statement::Return(expression) => print_expression(expression),
Statement::Expression(expression) => print_expression(expression),
_ => println!("{:?}", statement),
_ => {}
}
}

Expand Down

0 comments on commit 8a4f44b

Please sign in to comment.