From 81952cfc4035b9456834fcad394d178696598e85 Mon Sep 17 00:00:00 2001 From: mlokr Date: Fri, 10 May 2024 21:38:15 +0200 Subject: [PATCH] compiling return stmt --- hblang/examples/arithmetic.hb | 3 +++ hblang/src/lexer.rs | 1 + 2 files changed, 4 insertions(+) create mode 100644 hblang/examples/arithmetic.hb diff --git a/hblang/examples/arithmetic.hb b/hblang/examples/arithmetic.hb new file mode 100644 index 00000000..52394e6c --- /dev/null +++ b/hblang/examples/arithmetic.hb @@ -0,0 +1,3 @@ +main := ||: int { + return 10 - 20 / 2 + 4 * (2 + 2) - 4 * 4; +} diff --git a/hblang/src/lexer.rs b/hblang/src/lexer.rs index 54f41707..490db405 100644 --- a/hblang/src/lexer.rs +++ b/hblang/src/lexer.rs @@ -163,5 +163,6 @@ mod tests { empty => ""; whitespace => " \t\n\r"; example => include_str!("../examples/main_fn.hb"); + arithmetic => include_str!("../examples/arithmetic.hb"); } }