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

@ -134,17 +134,19 @@ fn lex(text: &str, map: LexMap, config: &Config) -> Vec<Token> {
tokens
}
#[derive(Clone, Debug)]
pub struct State {
context: Context,
dom_ids: HashMap<String, Vec<String>>,
buffers: Buffers,
}
#[derive(Clone, Debug)]
struct Buffers {
anchor: AnchorBuffer,
}
#[derive(Debug)]
#[derive(Clone, Debug)]
struct AnchorBuffer {
candidate: Anchor,
text: String,
@ -169,7 +171,7 @@ impl State {
dom_ids: HashMap::new(),
buffers: Buffers {
anchor: AnchorBuffer {
candidate: Anchor::empty(),
candidate: Anchor::default(),
text: String::new(),
destination: String::new(),
},