From 456d855f2fb7a18eb47925d7f90b277b677e47be Mon Sep 17 00:00:00 2001 From: Eddio0141 Date: Tue, 21 May 2024 01:41:42 +0100 Subject: [PATCH] fixed stuff --- src/interpreter/evaluators.rs | 1 - src/interpreter/evaluators/class.rs | 32 ----------------------------- src/tests/expression.rs | 9 -------- src/tests/life_time.rs | 10 --------- 4 files changed, 52 deletions(-) delete mode 100644 src/interpreter/evaluators/class.rs diff --git a/src/interpreter/evaluators.rs b/src/interpreter/evaluators.rs index 7785f6a..02cdaa7 100644 --- a/src/interpreter/evaluators.rs +++ b/src/interpreter/evaluators.rs @@ -1,5 +1,4 @@ pub mod array; -pub mod class; pub mod conditional; pub mod expression; pub mod function; diff --git a/src/interpreter/evaluators/class.rs b/src/interpreter/evaluators/class.rs deleted file mode 100644 index c435014..0000000 --- a/src/interpreter/evaluators/class.rs +++ /dev/null @@ -1,32 +0,0 @@ -use nom::{ - branch::alt, bytes::complete::tag, character::complete::char, combinator::fail, sequence::tuple, -}; - -use crate::{ - parsers::{identifier, PosWithInfo}, - runtime, -}; - -use super::parsers::AstParseResult; - -#[derive(Debug, Default)] -struct Class { - name: String, -} - -impl Class { - pub fn parse(input: PosWithInfo) -> AstParseResult { - let class = alt((tag("className"), tag("class"))); - let name = identifier(fail::<_, (), _>); - let open = char('{'); - let close = char('}'); - - let (input, (_, name, _, _)) = tuple((class, name, open, close))(input)?; - - todo!() - } - - pub fn eval(args: PosWithInfo) -> Result<(), runtime::Error> { - todo!() - } -} diff --git a/src/tests/expression.rs b/src/tests/expression.rs index 9f934fe..5a26219 100644 --- a/src/tests/expression.rs +++ b/src/tests/expression.rs @@ -218,15 +218,6 @@ assert(undefined ;== undefined === false)! Interpreter::new_eval(code).unwrap(); } -#[test] -fn implicit_string_term_at_op() { - let code = r#" -var var expr = hello + 1! -assert expr === "hello1"! -"#; - Interpreter::new_eval(code).unwrap(); -} - #[test] fn implicit_string_fail() { let code = r#" diff --git a/src/tests/life_time.rs b/src/tests/life_time.rs index 1e08f64..6d89f65 100644 --- a/src/tests/life_time.rs +++ b/src/tests/life_time.rs @@ -11,13 +11,3 @@ assert value === "value"! "#; Interpreter::new_eval(input).unwrap(); } - -#[test] -fn lines() { - let input = r#" -const const foo = bar! -const const bar<-1> = "baz"! -assert foo === "baz"! - "#; - Interpreter::new_eval(input).unwrap(); -}