aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2022-12-15 14:18:13 -0600
committerCody <cody@codyq.dev>2022-12-15 14:18:13 -0600
commit900bd3d64ac4c5c4c1511ab8388da3f2ed77849f (patch)
tree8de3006843d9dc717bf1c00d9942a068c90f413c /src/main.rs
parentbddb011df4999f7ffeeddf6a4b66e2da6ab19ea0 (diff)
downloadsloth-900bd3d64ac4c5c4c1511ab8388da3f2ed77849f.tar.gz
Replace `let` keyword with `val` and `var`
Thanks for pointing out that using `let` and `let mut` was stupid for a scripting language @mworzala
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 4 insertions, 2 deletions
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);
}
}