module lexer // SourceState records committed scanner progress, independently of a diagnostic // position that may point backwards. Reading it allocates no storage. pub struct SourceState { pub: fold_case bool = true consumed int } @[inline] pub fn (s &Scanner) source_state() SourceState { return SourceState{ fold_case: !s.no_fold, consumed: s.pos } } @[inline] pub fn (s &AltScanner) source_state() SourceState { return s.scanner.source_state() }