Commit graph

188 commits

Author SHA1 Message Date
Mazdak Farrokhzad
5a64ba6386 parser: span_fatal -> struct_span_err 2019-12-31 04:33:34 +01:00
Mazdak Farrokhzad
b6fc87c5b9 de-fatalize some errors 2019-12-31 04:33:34 +01:00
Mazdak Farrokhzad
2091062bf6 parser: call .struct_span_err directly 2019-12-31 04:33:34 +01:00
Vadim Petrochenkov
a2823e3af6 Rename libsyntax_ext and libsyntax_expand in code 2019-12-30 19:18:17 +03:00
Vadim Petrochenkov
b9a9c5b4fd Make things build again 2019-12-30 19:18:16 +03:00
bors
da3629b05f Auto merge of #67112 - Centril:expr-polish, r=estebank
Refactor expression parsing thoroughly

Based on https://github.com/rust-lang/rust/pull/66994 together with which this has refactored basically the entirety of `expr.rs`.

r? @estebank
2019-12-29 19:30:53 +00:00
Vadim Petrochenkov
3d57b8bcc0 doc comments: Less attribute mimicking 2019-12-28 12:33:18 +03:00
Charles Lew
0bcddfe23a Normalize identifiers in librustc_parse. 2019-12-26 13:12:58 +08:00
bors
a4cd03dee2 Auto merge of #66296 - Centril:bindings_after_at-init, r=pnkfelix
Initial implementation of `#![feature(bindings_after_at)]`

Following up on #16053, under the gate `#![feature(bindings_after_at)]`, `x @ Some(y)` is allowed subject to restrictions necessary for soundness.

The implementation and test suite should be fairly complete now.

One aspect that is not covered is the interaction with nested `#![feature(or_patterns)]`.
This is not possible to test at the moment in a good way because that feature has not progressed sufficiently and has fatal errors in MIR building. We should make sure to add such tests before we stabilize both features (but shipping one of them is fine).

r? @pnkfelix
cc @nikomatsakis @matthewjasper @pcwalton
cc https://github.com/rust-lang/rust/issues/65490
2019-12-23 21:49:44 +00:00
Mazdak Farrokhzad
5f92a56ed6 Introduce #![feature(bindings_after_at)].
Under the gate, `x @ Some(y)` is allowed.
This is subject to various restrictions for soundness.
2019-12-23 14:47:19 +01:00
Mazdak Farrokhzad
7a246acf0a fix rebase fallout 2019-12-23 14:08:50 +01:00
Mazdak Farrokhzad
05c26a445b refactor assoc op parsing 2019-12-23 13:55:45 +01:00
Mazdak Farrokhzad
e43a7ef1d4 simplify parse_prefix_range_expr 2019-12-23 13:55:10 +01:00
Mazdak Farrokhzad
8456c403e1 extract parse_not_expr 2019-12-23 13:55:04 +01:00
Mazdak Farrokhzad
efdea63c43 extract parse_prefix_expr 2019-12-23 13:51:21 +01:00
Mazdak Farrokhzad
4cfcfe9e20 extract parse_neg_expr 2019-12-23 13:51:02 +01:00
Mazdak Farrokhzad
f6ab439436 extract parse_deref_expr 2019-12-23 13:50:56 +01:00
Mazdak Farrokhzad
ada388b2b8 extract is_mistaken_not_ident_negation 2019-12-23 13:50:50 +01:00
Mazdak Farrokhzad
80eeefb05f extract recover_not_expr 2019-12-23 13:49:14 +01:00
Mazdak Farrokhzad
00cc8a1b0c simplify parse_assoc_op_cast 2019-12-23 13:48:47 +01:00
Mazdak Farrokhzad
84f9bf1a06 refactor parse_address_of -> parse_borrow_expr 2019-12-23 13:48:45 +01:00
Mazdak Farrokhzad
af5ac23a23 simplify parse_dot_call_or_expr 2019-12-23 13:47:52 +01:00
Mazdak Farrokhzad
7ae12c9385 extract parse_dot_base_expr 2019-12-23 13:47:44 +01:00
Mazdak Farrokhzad
bc95228f1b extract parse_dot_suffix_expr 2019-12-23 13:45:45 +01:00
Mazdak Farrokhzad
9c6bbf1252 extract error_unexpected_after_dot and de-fatalize 2019-12-23 13:45:13 +01:00
Mazdak Farrokhzad
ff5762b78a extract recover_field_access_by_float_lit 2019-12-23 13:44:38 +01:00
Mazdak Farrokhzad
a15d0cde57 extract parse_tuple_field_access_expr 2019-12-23 13:44:12 +01:00
Mazdak Farrokhzad
287ba5d0c8 extract parse_fn_call_expr 2019-12-23 13:44:06 +01:00
Mazdak Farrokhzad
98701b2c61 extract parse_index_expr & refactor parse_dot_suffix 2019-12-23 13:44:02 +01:00
Mazdak Farrokhzad
0bb3dad5a6 extract error_float_lits-must_have_int_part 2019-12-23 13:43:35 +01:00
Mazdak Farrokhzad
aa8adba8fb simplify parse_literal_maybe_minus 2019-12-23 13:43:28 +01:00
Mazdak Farrokhzad
f647c11121 simplify parse_fn_block_decl 2019-12-23 13:43:21 +01:00
Mazdak Farrokhzad
ad6f91a422 refactor parse_fn_block_param 2019-12-23 13:42:55 +01:00
Mazdak Farrokhzad
7bcc325034 refactor parse_if_expr 2019-12-23 13:42:49 +01:00
Mazdak Farrokhzad
44ff4df49d more recovery in if-parsing 2019-12-23 13:42:25 +01:00
Mazdak Farrokhzad
7262dcc4a7 refactor loop parsing a bit 2019-12-23 13:42:21 +01:00
Mazdak Farrokhzad
de2e443bc6 make parse_async_block conventional 2019-12-23 13:41:59 +01:00
Mazdak Farrokhzad
f6e2bdc341 extract is_certainly_not_a_block 2019-12-23 13:41:55 +01:00
Mazdak Farrokhzad
66b8ae4bce extract error_struct_lit_not_allowed_here 2019-12-23 13:34:06 +01:00
Mazdak Farrokhzad
701b974eb9 extract find_struct_error_after_field_looking_code 2019-12-23 13:32:55 +01:00
Mazdak Farrokhzad
8480b31ba9 extract recover_struct_comma_after_dotdot 2019-12-23 13:27:44 +01:00
Mazdak Farrokhzad
e77b9d36ca refactor parse_field 2019-12-23 13:27:44 +01:00
varkor
35979a92bf Add span information to ExprKind::Assign 2019-12-23 11:20:13 +00:00
Mark Rousskov
a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Mazdak Farrokhzad
63d480a07f
Rollup merge of #67508 - davesque:master, r=Dylan-DPC
Fix typo in path parser name

It appears that a little typo crept into the name of a path parsing method.
2019-12-22 19:46:15 +01:00
David Sanders
c770f5114c
Fix typo in path parser name 2019-12-21 22:11:02 -07:00
Mazdak Farrokhzad
616373e668
Rollup merge of #67148 - Centril:ty-polish, r=estebank
Refactor type & bounds parsing thoroughly

PR is based on https://github.com/rust-lang/rust/pull/67131 with first one from this PR being ` extract parse_ty_tuple_or_parens`.

Also fixes #67146.

r? @estebank
2019-12-22 02:40:00 +01:00
Mazdak Farrokhzad
db4818f325 span_suggestion_hidden -> tool_only_span_suggestion 2019-12-21 19:20:41 +01:00
Mazdak Farrokhzad
52fa020bbf unwrap -> expect 2019-12-21 19:20:41 +01:00
Mazdak Farrokhzad
d6f37c66c7 parse_ty_bare_fn: improve docs 2019-12-21 19:20:41 +01:00