Derive Debug and Clone for tokens and parser state
This commit is contained in:
parent
312901ddf6
commit
8d204503a8
12 changed files with 18 additions and 13 deletions
|
|
@ -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(),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue