From 52329532d5fd5cab5d7aa8b8ea447eaf7f97e709 Mon Sep 17 00:00:00 2001 From: b1ek Date: Sun, 17 Nov 2024 13:32:13 +1000 Subject: [PATCH] remove serde from them lexer reader compiler classes --- src/compiling/compiler.rs | 1 - src/compiling/lexing/lexer.rs | 6 +----- src/compiling/lexing/reader.rs | 5 ----- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/compiling/compiler.rs b/src/compiling/compiler.rs index 806d9dd..4fd2592 100644 --- a/src/compiling/compiler.rs +++ b/src/compiling/compiler.rs @@ -67,7 +67,6 @@ pub enum ScopingMode { /// # } /// ``` #[derive(Debug, Clone, PartialEq)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Compiler { /// Name of your language pub name: String, diff --git a/src/compiling/lexing/lexer.rs b/src/compiling/lexing/lexer.rs index 6a9dbc8..3565c17 100644 --- a/src/compiling/lexing/lexer.rs +++ b/src/compiling/lexing/lexer.rs @@ -14,12 +14,8 @@ use super::{ LexerError, LexerErrorType, }; -#[cfg(feature = "serde")] -use serde::{Serialize, Deserialize}; - /// Lexer #[derive(Debug, Clone, PartialEq)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Lexer { rules: Rules, /// Path to the lexed file @@ -32,7 +28,7 @@ pub struct Lexer { pub scoping_mode: ScopingMode, } -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +// #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] struct LexState { word: String, is_indenting: bool, diff --git a/src/compiling/lexing/reader.rs b/src/compiling/lexing/reader.rs index 63085f8..ae7c20b 100644 --- a/src/compiling/lexing/reader.rs +++ b/src/compiling/lexing/reader.rs @@ -1,15 +1,10 @@ -#[cfg(feature = "serde")] -use serde::{Serialize, Deserialize}; - const BEGINNING: (usize, usize) = (0, 1); -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum ReadMode { History, Future } -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Reader { pub code: String, pub row: usize,