rust/src/libsyntax
Mazdak Farrokhzad 75e23ff411
Rollup merge of #62550 - Centril:rest-patterns, r=petrochenkov
Implement RFC 2707 + Parser recovery for range patterns

Implement https://github.com/rust-lang/rfcs/pull/2707.

- Add a new basic syntactic pattern form `ast::PatKind::Rest` (parsed as `..` or `DOTDOT`) and simplify `ast::PatKind::{Slice, Tuple, TupleStruct}` as a result.

- Lower `ast::PatKind::Rest` in combination with the aforementioned `PatKind` variants as well as `PatKind::Ident`. The HIR remains unchanged for now (may be advisable to make slight adjustments later).

- Refactor `parser.rs` wrt. parsing sequences and lists of things in the process.

- Add parser recovery for range patterns of form `X..`, `X..=`, `X...`, `..Y`, `..=Y`, and `...Y`.
   This should make it easy to actually support these patterns semantically later if we so desire.

cc https://github.com/rust-lang/rust/issues/62254

r? @petrochenkov
2019-07-28 11:11:04 +02:00
..
attr Rollup merge of #62735 - petrochenkov:galloc, r=alexcrichton 2019-07-25 23:21:00 +02:00
diagnostics Make register_[long_]diagnostics hygienic 2019-07-13 10:25:57 +01:00
ext Rollup merge of #62550 - Centril:rest-patterns, r=petrochenkov 2019-07-28 11:11:04 +02:00
parse Rollup merge of #62550 - Centril:rest-patterns, r=petrochenkov 2019-07-28 11:11:04 +02:00
print Rollup merge of #62550 - Centril:rest-patterns, r=petrochenkov 2019-07-28 11:11:04 +02:00
util Make path::resolve a method on ExtCtxt 2019-07-23 17:17:31 +02:00
ast.rs Adjust and document 'Pat::to_ty' accordingly. 2019-07-28 06:53:38 +02:00
build.rs Remove licenses 2018-12-25 21:08:33 -07:00
Cargo.toml cleanup: Remove extern crate serialize as rustc_serializes 2019-07-23 19:20:16 +03:00
config.rs Lint on 'cfg_attr(,).' 2019-06-22 12:11:01 +02:00
early_buffered_lints.rs Implement checks for meta-variables in macros 2019-07-19 19:59:12 +02:00
entry.rs Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
error_codes.rs Normalize use of backticks in compiler messages for libsyntax/* 2019-07-23 20:03:20 +02:00
feature_gate.rs Adjust feature gating of subslice patterns accordingly. 2019-07-28 06:53:38 +02:00
json.rs syntax: Make def-site span mandatory in ExpnInfo/MacroBacktrace/DiagnosticSpanMacroExpansion 2019-07-11 00:12:07 +03:00
lib.rs Move standard library injection into libsyntax_ext 2019-07-27 13:56:54 +03:00
mut_visit.rs Adjust 'ast::PatKind::{TupleStruct,Tuple,Slice}'. 2019-07-28 06:53:38 +02:00
ptr.rs cleanup: Remove extern crate serialize as rustc_serializes 2019-07-23 19:20:16 +03:00
README.md rustc-guide has moved 2018-11-26 15:03:13 -06:00
show_span.rs Rename rustc_errors dependency in rust 2018 crates 2019-02-13 00:28:52 +09:00
source_map.rs Rename some things in syntax_pos/hygiene 2019-07-11 00:12:07 +03:00
test_snippet.rs Move edition outside the hygiene lock and avoid accessing it 2019-05-21 18:17:05 +02:00
tokenstream.rs cleanup: Remove extern crate serialize as rustc_serializes 2019-07-23 19:20:16 +03:00
visit.rs Adjust 'ast::PatKind::{TupleStruct,Tuple,Slice}'. 2019-07-28 06:53:38 +02: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: