From f2d62d446a7b1e03ef14b580e2aca0fad8aa23ef Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 5 Jul 2022 13:31:46 +0200 Subject: Refactor to do some to dos --- src/parser.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/parser.rs') diff --git a/src/parser.rs b/src/parser.rs index 32689d6..69dd355 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -21,7 +21,7 @@ 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, Vec) { +pub fn parse(value: &str) -> (Vec, ParseState) { let mut parse_state = ParseState { codes: parse_codes(value), definitions: HashSet::new(), @@ -37,6 +37,5 @@ pub fn parse(value: &str) -> (Vec, Vec) { 0, ); - // To do: pass whole `parse_state` back? - (events, parse_state.codes) + (events, parse_state) } -- cgit