Derive Debug and Clone for tokens and parser state

This commit is contained in:
Juno Takano 2026-01-02 14:30:36 -03:00
commit 8d204503a8
12 changed files with 18 additions and 13 deletions

View file

@ -1,6 +1,6 @@
use crate::syntax::content::{Parseable, parser::lexeme::Lexeme};
#[derive(Debug, Clone, Eq, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq, Default)]
pub struct Anchor {
pub text: String,
pub destination: Option<String>,

View file

@ -2,7 +2,7 @@ use crate::{
syntax::content::{Parseable, Lexeme},
};
#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Code {
open: bool,
}

View file

@ -10,7 +10,7 @@ use crate::{
use std::fmt::Display;
#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Header {
open: Option<bool>,
level: Level,
@ -112,7 +112,7 @@ impl Parseable for Header {
}
}
#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum Level {
One,
Two,

View file

@ -2,7 +2,7 @@ use crate::{
syntax::content::{Parseable, parser::lexeme::Lexeme},
};
#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct LineBreak {}
impl Parseable for LineBreak {

View file

@ -1,6 +1,6 @@
use crate::syntax::content::{Parseable, parser::lexeme::Lexeme};
#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Literal {
text: String,
}

View file

@ -2,7 +2,7 @@ use crate::{
syntax::content::{Parseable, Lexeme},
};
#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Oblique {
open: bool,
}

View file

@ -1,6 +1,6 @@
use crate::syntax::content::{Parseable, parser::lexeme::Lexeme};
#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Paragraph {
open: Option<bool>,
}

View file

@ -2,7 +2,7 @@ use crate::{
syntax::content::{Parseable, Lexeme},
};
#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct PreFormat {
open: Option<bool>,
}

View file

@ -1,6 +1,6 @@
use crate::syntax::content::{Parseable, parser::lexeme::Lexeme};
#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Span {
open: Option<bool>,
}