From 2cbe2dc197db02441e05af265c8c9443d46562a6 Mon Sep 17 00:00:00 2001 From: b1ek Date: Tue, 22 Aug 2023 22:58:55 +1000 Subject: [PATCH] remove pointer errors from lint as they are not always correct --- src/lib.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f8e6f59..f6ea860 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,6 @@ pub fn lint_code(code: &&str) -> Result<(), Vec> { let mut loop_stack: Vec = vec![]; let mut pos = 0 as usize; - let mut pointer = 0; let chars = code.chars().collect::>(); let size = code.len(); @@ -24,20 +23,6 @@ pub fn lint_code(code: &&str) -> Result<(), Vec> { let char = chars[pos]; pos += 1; - if char == '<' { - if pointer == 0 { - errors.push(format!("ERR: Reducing pointer to less than 0 is not allowed ({})", pos)); - continue - } - pointer -= 1; - } - if char == '>' { - if pointer == 29999 { - errors.push(format!("ERR: Increasing pointer to more than 29999 is not allowed ({})", pos)); - continue - } - pointer += 1; - } if char == '[' { loop_stack.push(pos); continue