rust/src/libsyntax_ext
Mazdak Farrokhzad b1200a29b0
Rollup merge of #57004 - nnethercote:TS-change-Stream, r=petrochenkov
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.
2019-01-13 17:21:39 +01:00
..
deriving Fix trace_macros and log_syntax 2018-12-27 15:51:36 +03:00
asm.rs make panictry! private to libsyntax 2019-01-02 11:02:30 -05:00
assert.rs make panictry! private to libsyntax 2019-01-02 11:02:30 -05:00
Cargo.toml Upgrade smallvec to 0.6.7 and use the new may_dangle feature. 2018-12-10 09:31:27 +11:00
cfg.rs make panictry! private to libsyntax 2019-01-02 11:02:30 -05:00
compile_error.rs Improve error recovery for some built-in macros 2018-12-30 01:43:35 +03:00
concat_idents.rs Improve error recovery for some built-in macros 2018-12-30 01:43:35 +03:00
concat.rs Improve error recovery for some built-in macros 2018-12-30 01:43:35 +03:00
diagnostics.rs Remove licenses 2018-12-25 21:08:33 -07:00
env.rs Improve error recovery for some built-in macros 2018-12-30 01:43:35 +03:00
format_foreign.rs Remove licenses 2018-12-25 21:08:33 -07:00
format.rs don't unwrap unexpected tokens in format! 2019-01-11 13:00:44 -05:00
global_asm.rs make panictry! private to libsyntax 2019-01-02 11:02:30 -05:00
lib.rs Remove licenses 2018-12-25 21:08:33 -07:00
log_syntax.rs Make sure feature gate errors are recoverable 2018-12-27 15:51:37 +03:00
proc_macro_decls.rs Remove licenses 2018-12-25 21:08:33 -07:00
proc_macro_impl.rs Remove licenses 2018-12-25 21:08:33 -07:00
proc_macro_server.rs Make TokenStream less recursive. 2019-01-08 15:08:46 +11:00
test_case.rs Make sure feature gate errors are recoverable 2018-12-27 15:51:37 +03:00
test.rs Remove licenses 2018-12-25 21:08:33 -07:00
trace_macros.rs Make sure feature gate errors are recoverable 2018-12-27 15:51:37 +03:00