diff options
Diffstat (limited to '')
-rw-r--r-- | src/parser.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs index 725f326..409e812 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -3,6 +3,7 @@ use crate::content::document::document; use crate::tokenizer::{Code, Event, Point}; use crate::util::codes::parse as parse_codes; +use crate::{Constructs, Options}; use std::collections::HashSet; /// Information needed, in all content types, when parsing markdown. @@ -11,6 +12,7 @@ use std::collections::HashSet; /// It also references the input value as [`Code`][]s. #[derive(Debug)] pub struct ParseState { + pub constructs: Constructs, /// List of codes. pub codes: Vec<Code>, /// Set of defined identifiers. @@ -20,8 +22,9 @@ pub struct ParseState { /// Turn a string of markdown into events. /// /// Passes the codes back so the compiler can access the source. -pub fn parse(value: &str) -> (Vec<Event>, ParseState) { +pub fn parse(value: &str, options: &Options) -> (Vec<Event>, ParseState) { let mut parse_state = ParseState { + constructs: options.constructs.clone(), codes: parse_codes(value), definitions: HashSet::new(), }; |