use std::any::Any; use std::cell::Ref; use std::collections::HashMap; use std::rc::Rc; use crate::compiler::compiler::Compiler; use crate::compiler::compiler::Target; use crate::document::document::Document; use crate::document::document::DocumentAccessors; use crate::document::element::ContainerElement; use crate::document::element::ElemKind; use crate::document::element::Element; use crate::lsp::semantic::Semantics; use crate::parser::parser::ParseMode; use crate::parser::parser::ParserState; use crate::parser::property::Property; use crate::parser::property::PropertyParser; use crate::parser::reports::macros::*; use crate::parser::reports::Report; use crate::parser::reports::*; use crate::parser::rule::Rule; use crate::parser::source::Cursor; use crate::parser::source::Token; use crate::parser::source::VirtualSource; use crate::parser::util; use parser::util::escape_source; use regex::Regex; #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum MarkerKind { Open, Close, } #[derive(Debug)] pub struct ListMarker { pub(self) location: Token, pub(self) numbered: bool, pub(self) kind: MarkerKind, } impl Element for ListMarker { fn location(&self) -> &Token { &self.location } fn kind(&self) -> ElemKind { ElemKind::Block } fn element_name(&self) -> &'static str { "List Marker" } fn compile( &self, compiler: &Compiler, _document: &dyn Document, _cursor: usize, ) -> Result { match compiler.target() { Target::HTML => match (self.kind, self.numbered) { (MarkerKind::Close, true) => Ok("".to_string()), (MarkerKind::Close, false) => Ok("".to_string()), (MarkerKind::Open, true) => Ok("
    ".to_string()), (MarkerKind::Open, false) => Ok("