From e2b1af59b4e287d1943ffb265069f5039324d534 Mon Sep 17 00:00:00 2001 From: Gabriel <68819302+obsidianical@users.noreply.github.com> Date: Thu, 16 Dec 2021 09:40:17 +0100 Subject: [PATCH] examples the first --- sm-test-files/hello.sm | 45 +++++++++++++++++++++++++++++++++++++++++- src/main.rs | 4 ++-- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/sm-test-files/hello.sm b/sm-test-files/hello.sm index 3413956..56b5ad5 100644 --- a/sm-test-files/hello.sm +++ b/sm-test-files/hello.sm @@ -1 +1,44 @@ -fuck java +#mult /}}string{{str\ /{float}num\ | + ¿string * float? + +&& rest line comment + +]]Inline comment[[ + +`` + multiline comment + indention example (comments have to be indented as well, btw): + first level + second level + third level + fourth level + fifth level + sixth level + + main function has to be a thing +´´ + +¡}}string{{ variable! + +&& take input into variable +¡=>/variable\! + +&& output variable +¡<=/variable\! + +&& $ means true +&& € means false + +&& if condition is true log the text +¿??$/condition\ | + ¡<=/"condition was true"! +? + +&& if condition is false log the text +¿??€/condition\ | + ¡<=/"condition was false"! +? + +¿??$/condition\ | + ¡<= + diff --git a/src/main.rs b/src/main.rs index 9c8984d..613ce20 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,8 +9,8 @@ fn main() { fn multiply_strings(str: String, multiplier: f32) -> String { let mut r: String = String::from(str); - let mult_float = multiplier - (multiplier as i32) as f32; - let slice = &r.clone()[0..(r.len() as f32 * mult_float) as usize]; + let rest = multiplier - (multiplier as i32) as f32; + let slice = &r.clone()[0..(r.len() as f32 * rest) as usize]; r = r.repeat(multiplier as usize); r += slice;