updated regexp

now supports ; comments
This commit is contained in:
Schrottkatze 2021-12-16 21:12:44 +01:00
parent 4ab1565f9d
commit 0eed22213f
2 changed files with 3 additions and 3 deletions

View file

@ -27,12 +27,12 @@
&& € means false && € means false
&& == is implied in if conditions && == is implied in if conditions
; test comment
&& = is equal to === && = is equal to ===
&& if condition is true log the text && if condition is true log the text
¿??$/condition\ | ( ¿??$/condition\ | (
¡<=/"condition was true"! ¡<=/"condition was true"!; hello test
)? )?
&& if condition is false log the text && if condition is false log the text

View file

@ -3,7 +3,7 @@ use fancy_regex::Regex;
pub fn preprocess(raw_code: String) { pub fn preprocess(raw_code: String) {
lazy_static! { lazy_static! {
static ref COMMENT_RE: Regex = Regex::new(r"(\]\].*?\[\[|&&.*\n|``(.|\n)*?´´)").unwrap(); static ref COMMENT_RE: Regex = Regex::new(r"(\]\].*?\[\[|&&.*\n|;.*\n|``(.|\n)*?´´)").unwrap();
} }
let code = COMMENT_RE.replace_all(&raw_code, ""); let code = COMMENT_RE.replace_all(&raw_code, "");