[naga wgsl-in] Document front::wgsl::parse::lexer::Lexer. (#6805)

This commit is contained in:
Jim Blandy
2025-01-08 08:13:06 -08:00
committed by GitHub
parent a8a91737b2
commit eeb79f3b04

View File

@@ -201,10 +201,23 @@ fn is_word_part(c: char) -> bool {
#[derive(Clone)]
pub(in crate::front::wgsl) struct Lexer<'a> {
/// The remaining unconsumed input.
input: &'a str,
/// The full original source code.
///
/// We compare `input` against this to compute the lexer's current offset in
/// the source.
pub(in crate::front::wgsl) source: &'a str,
// The byte offset of the end of the last non-trivia token.
/// The byte offset of the end of the most recently returned non-trivia
/// token.
///
/// This is consulted by the `span_from` function, for finding the
/// end of the span for larger structures like expressions or
/// statements.
last_end_offset: usize,
#[allow(dead_code)]
pub(in crate::front::wgsl) enable_extensions: EnableExtensions,
}