diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-09-26 09:18:23 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-09-26 13:36:35 +1000 |
| commit | aa6bfaf04b258e3e23d3f7063de4f2d37845ddec (patch) | |
| tree | b6735a3ee3d176bdadcb589e37503dd4d22c42a6 /compiler/rustc_codegen_gcc | |
| parent | 33516ac09af7038efce6332afdedc758a3943609 (diff) | |
| download | rust-aa6bfaf04b258e3e23d3f7063de4f2d37845ddec.tar.gz rust-aa6bfaf04b258e3e23d3f7063de4f2d37845ddec.zip | |
Make `rustc_lexer::cursor::Cursor` public.
`Cursor` is currently hidden, and the main tokenization path uses `rustc_lexer::first_token` which involves constructing a new `Cursor` for every single token, which is weird. Also, `first_token` also can't handle empty input, so callers have to check for that first. This commit makes `Cursor` public, so `StringReader` can contain a `Cursor`, which results in a simpler structure. The commit also changes `StringReader::advance_token` so it returns an `Option<Token>`, simplifying the the empty input case.
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions
