From 900bd3d64ac4c5c4c1511ab8388da3f2ed77849f Mon Sep 17 00:00:00 2001 From: Cody Date: Thu, 15 Dec 2022 14:18:13 -0600 Subject: Replace `let` keyword with `val` and `var` Thanks for pointing out that using `let` and `let mut` was stupid for a scripting language @mworzala --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 65e6ee9..5334746 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,9 @@ use lexer::Lexer; const SOURCE: &str = r#" -if 5 >= 7 { +val variable = 5; + +if variable >= 7 { print "Hello World"; } @@ -21,6 +23,6 @@ if 5 >= 7 { fn main() { let lexer = Lexer::new(SOURCE); for token in lexer { - print!("{} ", token.lexeme); + print!("({}) ", token.lexeme); } } -- cgit v1.2.3