Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix serde not compiling for struct with lifetime #70

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/compiling/lexing/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ pub struct Lexer {
}

#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
struct LexState<'a> {
struct LexState {
word: String,
is_indenting: bool,
is_escaped: bool,
token_start_index: usize,
position: (usize, usize),
reader: Reader<'a>,
reader: Reader,
lexem: Vec<Token>,
region_handler: RegionHandler,
compound_handler: CompoundHandler,
Expand Down
12 changes: 6 additions & 6 deletions src/compiling/lexing/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ pub enum ReadMode {
}

#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
b1ek marked this conversation as resolved.
Show resolved Hide resolved
pub struct Reader<'a> {
pub code: &'a String,
pub struct Reader {
Ph0enixKM marked this conversation as resolved.
Show resolved Hide resolved
pub code: String,
pub row: usize,
pub col: usize,
pub index: usize,
pub new_line: bool
}

impl<'a> Reader<'a> {
pub fn new(code: &'a String) -> Self {
impl Reader {
pub fn new(code: &String) -> Self {
Reader {
code,
code: code.clone(),
row: BEGINNING.0,
col: BEGINNING.1,
index: 0,
Expand Down Expand Up @@ -116,7 +116,7 @@ impl<'a> Reader<'a> {
}
}

impl<'a> Iterator for Reader<'a> {
impl Iterator for Reader {
type Item = char;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
Loading