b1200a29b0
Make `TokenStream` less recursive. `TokenStream` is currently recursive in *two* ways: - the `TokenTree` variant contains a `ThinTokenStream`, which can contain a `TokenStream`; - the `TokenStream` variant contains a `Vec<TokenStream>`. The latter is not necessary and causes significant complexity. This commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`. This reduces complexity significantly. In particular, `StreamCursor` is eliminated, and `Cursor` becomes much simpler, consisting now of just a `TokenStream` and an index. The commit also removes the `Extend` impl for `TokenStream`, because it is only used in tests. (The commit also removes those tests.) Overall, the commit reduces the number of lines of code by almost 200. |
||
---|---|---|
.. | ||
deriving | ||
asm.rs | ||
assert.rs | ||
Cargo.toml | ||
cfg.rs | ||
compile_error.rs | ||
concat_idents.rs | ||
concat.rs | ||
diagnostics.rs | ||
env.rs | ||
format_foreign.rs | ||
format.rs | ||
global_asm.rs | ||
lib.rs | ||
log_syntax.rs | ||
proc_macro_decls.rs | ||
proc_macro_impl.rs | ||
proc_macro_server.rs | ||
test_case.rs | ||
test.rs | ||
trace_macros.rs |