Make Oblique no longer a context, add a point module

This commit is contained in:
Juno Takano 2026-01-05 12:52:48 -03:00
commit 315956e20d
4 changed files with 58 additions and 20 deletions

View file

@ -9,9 +9,15 @@ use crate::syntax::content::parser::{
pub struct State {
pub context: Context,
pub dom_ids: HashMap<String, Vec<String>>,
pub switches: Switches,
pub buffers: Buffers,
}
#[derive(Clone, Debug)]
pub struct Switches {
pub oblique: bool,
}
#[derive(Clone, Debug)]
pub struct Buffers {
pub anchor: AnchorBuffer,
@ -56,14 +62,15 @@ impl std::fmt::Display for AnchorBuffer {
}
}
impl State {
pub fn new() -> State {
impl Default for State {
fn default() -> State {
State {
context: Context {
inline: Inline::None,
block: Block::None,
},
dom_ids: HashMap::new(),
switches: Switches { oblique: false },
buffers: Buffers {
anchor: AnchorBuffer {
candidate: Anchor::default(),