From c4a1d670ca35698ca65d5a11e657b4108044aaa8 Mon Sep 17 00:00:00 2001 From: electria Date: Wed, 15 Jul 2026 23:52:59 -0700 Subject: [PATCH] docs: minor logic block explanations --- src/nodes/from_str.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nodes/from_str.rs b/src/nodes/from_str.rs index c606454..5904a80 100644 --- a/src/nodes/from_str.rs +++ b/src/nodes/from_str.rs @@ -61,6 +61,7 @@ impl FromStr for Nodes { let filtered_string: String = s.chars().filter(is_not_ignored_char).collect(); for (i, c) in filtered_string.char_indices() { + // check whether we're at the end of the bit we're parsing match state { ParsingState::Start => {} ParsingState::ReadingFunctionName(start_index) => { @@ -92,6 +93,7 @@ impl FromStr for Nodes { } } + // start parsing something new (if applicable) if state == ParsingState::Start { if is_number_char(c) { state = ParsingState::ReadingNumber(i); @@ -113,6 +115,7 @@ impl FromStr for Nodes { } } + // wrap up any unfinished parsing let i = filtered_string.len(); match state { ParsingState::Start => {}