From 5062b3aebec7555eec470043444f96d87f490bf4 Mon Sep 17 00:00:00 2001 From: ElementG9 Date: Tue, 25 Aug 2020 16:10:44 -0600 Subject: [PATCH] multiline comments are hella gay --- src/tokenizer.rs | 31 ------------------------------- test.pvt | 30 ++++++++++++++---------------- 2 files changed, 14 insertions(+), 47 deletions(-) diff --git a/src/tokenizer.rs b/src/tokenizer.rs index b9f4b30..20446bc 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -70,37 +70,6 @@ pub fn tokenize(source: &str) -> Vec { } current += 1; } - } else if chars.get(current + 1) == Some(&'*') { - let mut depth = 1; - 'comment: loop { - if chars.get(current) == Some(&'*') - && chars.get(current + 1) == Some(&'/') - { - depth -= 1; - if depth == 0 { - break 'comment; - } - } - if chars.get(current) == Some(&'/') - && chars.get(current + 1) == Some(&'*') - { - depth += 1; - } else if chars.get(current) == None { - break 'comment; - } else { - current += 1; - } - } - // 'comment: loop { - // if (chars.get(current) == Some(&'/') - // && chars.get(current - 1) == Some(&'*')) - // || chars.get(current) == None - // { - // current += 1; - // break 'comment; - // } - // current += 1; - // } } else { current += 1; } diff --git a/test.pvt b/test.pvt index 34cd009..6f82562 100644 --- a/test.pvt +++ b/test.pvt @@ -1,21 +1,19 @@ // A comment -/* A multi-line -comment! */ +// An implicit int. +log(2); +// An explicit int. +log(5i); -/* -A multi-line comment! +// An implicit float. +log(2.5); +// An explicit float. +log(3f); -/* -A nested multi-line comment! -*/ +// Booleans and multiple arguments. +log(true, false); -*/ - -log(2); // An implicit int. -log(5i); // An explicit int. -log(2.5); // An implicit float. -log(3f); // An explicit float. -log(true, false); // Logging two things in one log call, and booleans. -log("Hello world!"); // A string literal. -log("What's that over there?"); // A string showing how different delimiters layer. +// Strings. +log("Hello world!"); +// A string showing how different delimiters layer. +log("What's that over there?");