diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-08-01 06:44:39 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-08-01 19:30:40 +1000 |
| commit | d1f05fd1848fc68ed89d17f7937e358dacd8aed4 (patch) | |
| tree | 261e4c4a06d275386cbe7a6621a3fd524eea5b4b /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 9d77d17f7127def53c6a3555ae9a6a1f271a8e37 (diff) | |
| download | rust-d1f05fd1848fc68ed89d17f7937e358dacd8aed4.tar.gz rust-d1f05fd1848fc68ed89d17f7937e358dacd8aed4.zip | |
Distinguish the two kinds of token range.
When collecting tokens there are two kinds of range: - a range relative to the parser's full token stream (which we get when we are parsing); - a range relative to a single AST node's token stream (which we use within `LazyAttrTokenStreamImpl` when replacing tokens). These are currently both represented with `Range<u32>` and it's easy to mix them up -- until now I hadn't properly understood the difference. This commit introduces `ParserRange` and `NodeRange` to distinguish them. This also requires splitting `ReplaceRange` in two, giving the new types `ParserReplacement` and `NodeReplacement`. (These latter two names reduce the overloading of the word "range".) The commit also rewrites some comments to be clearer. The end result is a little more verbose, but much clearer.
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
0 files changed, 0 insertions, 0 deletions
