Skip to content

Commit

Permalink
Add a note about LexerCore::input
Browse files Browse the repository at this point in the history
  • Loading branch information
magicant committed Dec 30, 2024
1 parent 44e21f9 commit d90248c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions yash-syntax/src/parser/lex/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ fn ex<I: IntoIterator<Item = SourceChar>>(i: I) -> impl Iterator<Item = SourceCh

/// Core part of the lexical analyzer
struct LexerCore<'a> {
// The `input` field could be a `&'a mut dyn InputObject + 'a`, but it is
// `Box<dyn InputObject + 'a>` to allow the lexer to take ownership of the
// input object. This is necessary for `Lexer::with_code` and similarly
// constructed lexers.
input: Box<dyn InputObject + 'a>,
state: InputState,
raw_code: Rc<Code>,
Expand Down

0 comments on commit d90248c

Please sign in to comment.