Formatter

Struct Formatter 

Source
pub struct Formatter {
    pub html: bool,
    /* private fields */
}

Fields§

§html: bool

Implementations§

Source§

impl Formatter

Source

pub fn new() -> Formatter

Source

pub fn format(&mut self, tree: &Program) -> String

Source

pub fn reset_numbering(&mut self)

Source

pub fn works_cited(&mut self) -> String

Source

pub fn format_html( &mut self, tree: &Program, style: String, shim: String, ) -> String

Source

pub fn table_of_contents(&mut self, toc: &TableOfContents) -> String

Source

pub fn sections(&mut self, sections: &Vec<Section>) -> String

Source

pub fn program(&mut self, node: &Program) -> String

Source

pub fn title(&mut self, node: &Title) -> String

Source

pub fn subtitle(&mut self, node: &Subtitle) -> String

Source

pub fn body(&mut self, node: &Body) -> String

Source

pub fn section(&mut self, node: &Section) -> String

Source

pub fn paragraph(&mut self, node: &Paragraph) -> String

Source

pub fn inline_paragraph(&mut self, node: &Paragraph) -> String

Source

pub fn paragraph_element(&mut self, node: &ParagraphElement) -> String

Source

pub fn fenced_mech_code(&mut self, block: &FencedMechCode) -> String

Source

pub fn image(&mut self, node: &Image) -> String

Source

pub fn abstract_el(&mut self, node: &Vec<Paragraph>) -> String

Source

pub fn equation(&mut self, node: &Token) -> String

Source

pub fn diagram(&mut self, node: &Token) -> String

Source

pub fn citation(&mut self, node: &Citation) -> String

Source

pub fn float( &mut self, node: &Box<SectionElement>, float_dir: &FloatDirection, ) -> String

Source

pub fn info_block(&mut self, node: &Vec<Paragraph>) -> String

Source

pub fn question_block(&mut self, node: &Vec<Paragraph>) -> String

Source

pub fn success_block(&mut self, node: &Vec<Paragraph>) -> String

Source

pub fn warning_block(&mut self, node: &Vec<Paragraph>) -> String

Source

pub fn idea_block(&mut self, node: &Vec<Paragraph>) -> String

Source

pub fn error_block(&mut self, node: &Vec<Paragraph>) -> String

Source

pub fn section_element(&mut self, node: &SectionElement) -> String

Source

pub fn section_error(&mut self, src: Token, range: &SourceRange) -> String

Source

pub fn footnote(&mut self, node: &Footnote) -> String

Source

pub fn quote_block(&mut self, node: &Vec<Paragraph>) -> String

Source

pub fn thematic_break(&mut self) -> String

Source

pub fn mechdown_table(&mut self, node: &MarkdownTable) -> String

Source

pub fn mechdown_table_string(&mut self, node: &MarkdownTable) -> String

Source

pub fn mechdown_table_html(&mut self, node: &MarkdownTable) -> String

Source

pub fn grammar(&mut self, node: &Grammar) -> String

Source

pub fn code_block(&mut self, node: &Token) -> String

Source

pub fn comment(&mut self, node: &Comment) -> String

Source

pub fn list(&mut self, node: &MDList) -> String

Source

pub fn check_list(&mut self, node: &CheckList) -> String

Source

pub fn ordered_list(&mut self, node: &OrderedList) -> String

Source

pub fn unordered_list(&mut self, node: &UnorderedList) -> String

Source

pub fn mech_code(&mut self, node: &Vec<(MechCode, Option<Comment>)>) -> String

Source

pub fn fsm_implementation(&mut self, node: &FsmImplementation) -> String

Source

pub fn fsm_arm(&mut self, node: &FsmArm, last: bool) -> String

Source

pub fn guard(&mut self, node: &Guard) -> String

Source

pub fn pattern(&mut self, node: &Pattern) -> String

Source

pub fn pattern_tuple_struct(&mut self, node: &PatternTupleStruct) -> String

Source

pub fn transition(&mut self, node: &Transition) -> String

Source

pub fn fsm_specification(&mut self, node: &FsmSpecification) -> String

Source

pub fn state_definition(&mut self, node: &StateDefinition) -> String

Source

pub fn variable_define(&mut self, node: &VariableDefine) -> String

Source

pub fn statement(&mut self, node: &Statement) -> String

Source

pub fn kind_define(&mut self, node: &KindDefine) -> String

Source

pub fn tuple_destructure(&mut self, node: &TupleDestructure) -> String

Source

pub fn variable_assign(&mut self, node: &VariableAssign) -> String

Source

pub fn op_assign(&mut self, node: &OpAssign) -> String

Source

pub fn op_assign_op(&mut self, node: &OpAssignOp) -> String

Source

pub fn slice_ref(&mut self, node: &SliceRef) -> String

Source

pub fn expression(&mut self, node: &Expression) -> String

Source

pub fn range_expression(&mut self, node: &RangeExpression) -> String

Source

pub fn function_call(&mut self, node: &FunctionCall) -> String

Source

pub fn argument(&mut self, node: &(Option<Identifier>, Expression)) -> String

Source

pub fn slice(&mut self, node: &Slice) -> String

Source

pub fn subscript(&mut self, node: &Subscript) -> String

Source

pub fn brace(&mut self, node: &Vec<Subscript>) -> String

Source

pub fn swizzle(&mut self, node: &Vec<Identifier>) -> String

Source

pub fn dot_int(&mut self, node: &RealNumber) -> String

Source

pub fn dot(&mut self, node: &Identifier) -> String

Source

pub fn all(&mut self) -> String

Source

pub fn bracket(&mut self, node: &Vec<Subscript>) -> String

Source

pub fn structure(&mut self, node: &Structure) -> String

Source

pub fn map(&mut self, node: &Map) -> String

Source

pub fn mapping(&mut self, node: &Mapping) -> String

Source

pub fn set(&mut self, node: &Set) -> String

Source

pub fn tuple_struct(&mut self, node: &TupleStruct) -> String

Source

pub fn table(&mut self, node: &Table) -> String

Source

pub fn table_header(&mut self, node: &TableHeader) -> String

Source

pub fn table_row(&mut self, node: &TableRow) -> String

Source

pub fn table_column(&mut self, node: &TableColumn) -> String

Source

pub fn field(&mut self, node: &Field) -> String

Source

pub fn tuple(&mut self, node: &Tuple) -> String

Source

pub fn record(&mut self, node: &Record) -> String

Source

pub fn binding(&mut self, node: &Binding) -> String

Source

pub fn matrix(&mut self, node: &Matrix) -> String

Source

pub fn matrix_column_elements( &mut self, column_elements: &[&MatrixColumn], ) -> String

Source

pub fn matrix_row(&mut self, node: &MatrixRow) -> String

Source

pub fn matrix_column(&mut self, node: &MatrixColumn) -> String

Source

pub fn var(&mut self, node: &Var) -> String

Source

pub fn kind_annotation(&mut self, node: &Kind) -> String

Source

pub fn kind(&mut self, node: &Kind) -> String

Source

pub fn factor(&mut self, node: &Factor) -> String

Source

pub fn term(&mut self, node: &Term) -> String

Source

pub fn formula_operator(&mut self, node: &FormulaOperator) -> String

Source

pub fn table_op(&mut self, node: &TableOp) -> String

Source

pub fn set_op(&mut self, node: &SetOp) -> String

Source

pub fn add_sub_op(&mut self, node: &AddSubOp) -> String

Source

pub fn mul_div_op(&mut self, node: &MulDivOp) -> String

Source

pub fn power_op(&mut self, node: &PowerOp) -> String

Source

pub fn vec_op(&mut self, node: &VecOp) -> String

Source

pub fn comparison_op(&mut self, node: &ComparisonOp) -> String

Source

pub fn logic_op(&mut self, node: &LogicOp) -> String

Source

pub fn boolean(&mut self, node: &Token) -> String

Source

pub fn empty(&mut self, node: &Token) -> String

Source

pub fn literal(&mut self, node: &Literal) -> String

Source

pub fn atom(&mut self, node: &Atom) -> String

Source

pub fn string(&mut self, node: &MechString) -> String

Source

pub fn number(&mut self, node: &Number) -> String

Source

pub fn real_number(&mut self, node: &RealNumber) -> String

Source

pub fn complex_numer(&mut self, node: &C64Node) -> String

Source

pub fn imaginary_number(&mut self, node: &ImaginaryNumber) -> String

Source

pub fn humanize_html(input: String) -> String

Trait Implementations§

Source§

impl Clone for Formatter

Source§

fn clone(&self) -> Formatter

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Formatter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Formatter

Source§

fn eq(&self, other: &Formatter) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Formatter

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,