Skip to content

Commit

Permalink
Work on comment for advance_parser() (#51)
Browse files Browse the repository at this point in the history
* Work on comment for advance_parser()

* Work on comment for advance_parser()

---------

Co-authored-by: Jeffrey Kegler <[email protected]>
  • Loading branch information
v-jkegler and Jeffrey Kegler authored Nov 12, 2024
1 parent a81808e commit 7f9ecb1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions parser/src/earley/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1496,11 +1496,15 @@ impl ParserState {
}
}

/// Advance the parser with given lexeme_idx.
/// lexer_state is state *after* consuming the byte.
/// It either initial lexer states for lazy lexers,
/// or lexer_initial_state+byte for greedy lexers.
/// lexer_byte is the byte that led to producing the lexeme.

/// Advance the parser with given 'pre_lexeme'.
/// On return, the lexer_state will be the state *after* consuming
/// 'pre_lexeme'. As a special case, a following single byte lexeme
/// is also consumed.
///
// The new lexer state will be an initial lexer states when the lexing
// is lazy. If the lexing was greedy, it will be an initial lexer state
// advanced to the byte which produced the greedy lexeme.

// This is never inlined anyways, so better make it formal
#[inline(never)]
Expand Down

0 comments on commit 7f9ecb1

Please sign in to comment.