rust/src/libsyntax
Geoffry Song 2d9831dea5 Interpolate AST nodes in quasiquote.
This changes the `ToTokens` implementations for expressions, statements,
etc. with almost-trivial ones that produce `Interpolated(*Nt(...))`
pseudo-tokens. In this way, quasiquote now works the same way as macros
do: already-parsed AST fragments are used as-is, not reparsed.

The `ToSource` trait is removed. Quasiquote no longer involves
pretty-printing at all, which removes the need for the
`encode_with_hygiene` hack. All associated machinery is removed.

A new `Nonterminal` is added, NtArm, which the parser now interpolates.
This is just for quasiquote, not macros (although it could be in the
future).

`ToTokens` is no longer implemented for `Arg` (although this could be
added again) and `Generics` (which I don't think makes sense).

This breaks any compiler extensions that relied on the ability of
`ToTokens` to turn AST fragments back into inspectable token trees. For
this reason, this closes #16987.

As such, this is a [breaking-change].

Fixes #16472.
Fixes #15962.
Fixes #17397.
Fixes #16617.
2015-04-25 21:42:10 -04:00
..
ast_map Expose visibility for fns in syntax::visit 2015-04-14 09:54:58 +12:00
diagnostics syntax: remove #[feature(quote, unsafe_destructor)] 2015-04-21 10:08:27 -07:00
ext Interpolate AST nodes in quasiquote. 2015-04-25 21:42:10 -04:00
parse Interpolate AST nodes in quasiquote. 2015-04-25 21:42:10 -04:00
print Interpolate AST nodes in quasiquote. 2015-04-25 21:42:10 -04:00
util Change name of unit test sub-module to "tests". 2015-04-24 23:06:41 +02:00
abi.rs Fallout in libsyntax 2015-04-01 11:22:39 -04:00
ast.rs Interpolate AST nodes in quasiquote. 2015-04-25 21:42:10 -04:00
ast_util.rs Change name of unit test sub-module to "tests". 2015-04-24 23:06:41 +02:00
attr.rs Auto merge of #23011 - nagisa:the-war-of-symbol-and-symbol, r=pnkfelix 2015-04-12 01:26:53 +00:00
codemap.rs Change name of unit test sub-module to "tests". 2015-04-24 23:06:41 +02:00
config.rs syntax: Remove uses of #[feature(slice_patterns)] 2015-04-21 10:08:26 -07:00
diagnostic.rs syntax: Replace String::from_str with the stable String::from 2015-04-21 10:08:27 -07:00
feature_gate.rs Add ')' in advaced_slice_patterns error message 2015-04-24 10:10:48 +10:00
fold.rs Interpolate AST nodes in quasiquote. 2015-04-25 21:42:10 -04:00
lib.rs syntax: Copy unstable str::char_at into libsyntax 2015-04-21 10:23:53 -07:00
owned_slice.rs Switched to Box::new in many places. 2015-03-03 21:05:55 +01:00
ptr.rs syntax: remove #![feature(box_syntax, box_patterns)] 2015-04-21 10:07:48 -07:00
show_span.rs std: Stabilize FromStr and parse 2015-01-30 08:52:44 -08:00
std_inject.rs Unquote all crate names without underscores 2015-03-27 10:58:12 -07:00
str.rs syntax: Copy unstable str::char_at into libsyntax 2015-04-21 10:23:53 -07:00
test.rs Work towards a non-panicing parser (libsyntax) 2015-04-05 09:52:50 +01:00
visit.rs Expose visibility for fns in syntax::visit 2015-04-14 09:54:58 +12:00