rust/src/libsyntax
Mazdak Farrokhzad e19cb40fda
Rollup merge of #65974 - Centril:matcher-friendly-gating, r=petrochenkov
A scheme for more macro-matcher friendly pre-expansion gating

Pre-expansion gating will now avoid gating macro matchers that did not result in `Success(...)`. That is, the following is now OK despite `box 42` being a valid `expr` and that form being pre-expansion gated:

```rust
macro_rules! m {
    ($e:expr) => { 0 }; // This fails on the input below due to `, foo`.
    (box $e:expr, foo) => { 1 }; // Successful matcher, we should get `2`.
}

fn main() {
    assert_eq!(1, m!(box 42, foo));
}
```

Closes https://github.com/rust-lang/rust/issues/65846.

r? @petrochenkov
cc @Mark-Simulacrum
2019-11-07 08:51:57 +01:00
..
ast libsyntax: Unconfigure tests during normal build 2019-08-02 01:59:01 +03:00
attr Make doc comments cheaper with AttrKind. 2019-11-06 23:05:07 +11:00
diagnostics Replace diagnostic plugins with macro_rules 2019-09-05 12:35:15 -04:00
expand Review feedback: Remove more stuff! Simplify simplify simplify! 2019-11-05 14:59:29 +01:00
feature_gate Rollup merge of #65974 - Centril:matcher-friendly-gating, r=petrochenkov 2019-11-07 08:51:57 +01:00
json Fix the start/end byte positions in the compiler JSON output 2019-10-21 19:28:29 +03:00
mut_visit Aggregation of cosmetic changes made during work on REPL PRs: libsyntax 2019-09-07 16:29:04 +01:00
parse Rollup merge of #65974 - Centril:matcher-friendly-gating, r=petrochenkov 2019-11-07 08:51:57 +01:00
print parser: don't hardcode ABIs into grammar 2019-11-07 05:25:31 +01:00
source_map Apply suggestions from code review 2019-09-07 16:29:04 +01:00
tokenstream syntax_pos: NO_EXPANSION/SyntaxContext::empty() -> SyntaxContext::root() 2019-08-15 20:38:12 +03:00
util Rename Expr.node to Expr.kind 2019-09-26 18:21:09 +01:00
ast.rs syntax: use distinct FloatTy from rustc_target. 2019-11-07 05:25:31 +01:00
build.rs Remove licenses 2018-12-25 21:08:33 -07:00
Cargo.toml syntax: use distinct FloatTy from rustc_target. 2019-11-07 05:25:31 +01:00
config.rs Make doc comments cheaper with AttrKind. 2019-11-06 23:05:07 +11:00
early_buffered_lints.rs Warn if include macro fails to include entire file 2019-10-07 19:47:53 -04:00
entry.rs Rename Item.node to Item.kind 2019-09-26 18:21:48 +01:00
error_codes.rs parser: don't hardcode ABIs into grammar 2019-11-07 05:25:31 +01:00
json.rs Rollup merge of #65074 - Rantanen:json-byte-pos, r=matklad 2019-10-25 13:12:45 +02:00
lib.rs rustc, rustc_passes: don't depend on syntax_expand. 2019-10-27 17:05:57 +01:00
mut_visit.rs Make doc comments cheaper with AttrKind. 2019-11-06 23:05:07 +11:00
ptr.rs Remove many unnecessary trait derivations. 2019-10-21 20:59:18 +11:00
README.md rustc-guide has moved 2018-11-26 15:03:13 -06:00
sess.rs rollback gating for failing macro matchers 2019-11-06 12:30:08 +01:00
show_span.rs Rename rustc_errors dependency in rust 2018 crates 2019-02-13 00:28:52 +09:00
source_map.rs Span cannot represent span.hi < span.lo 2019-11-01 23:40:07 +03:00
tests.rs Rollup merge of #65074 - Rantanen:json-byte-pos, r=matklad 2019-10-25 13:12:45 +02:00
tokenstream.rs Rollup merge of #66086 - RalfJung:smallvec, r=nagisa 2019-11-06 07:03:08 +01:00
visit.rs Make doc comments cheaper with AttrKind. 2019-11-06 23:05:07 +11:00

The syntax crate contains those things concerned purely with syntax that is, the AST ("abstract syntax tree"), parser, pretty-printer, lexer, macro expander, and utilities for traversing ASTs.

For more information about how these things work in rustc, see the rustc guide: