docs: minor logic block explanations
This commit is contained in:
parent
7f733c1053
commit
c4a1d670ca
1 changed files with 3 additions and 0 deletions
|
|
@ -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 => {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue