Vadim Petrochenkov
8d799218ab
parser: Remove Parser::prev_token_kind
2020-02-10 20:29:37 +03:00
Matthias Prechtl
f35a7c38da
Make issue references consistent
2020-02-09 20:43:49 +01:00
Mazdak Farrokhzad
c0b7b41cff
parse_ty_common: use enum
s instead of bool
s.
2020-02-05 01:27:08 +01:00
Mazdak Farrokhzad
e233331a51
syntax::print -> new crate rustc_ast_pretty
2020-02-01 18:59:49 +01:00
Mazdak Farrokhzad
82c19b4388
Rollup merge of #68108 - varkor:chained-comparison-suggestions, r=Centril
...
Add suggestions when encountering chained comparisons
Ideally, we'd also prevent the type error, which is just extra noise, but that will require moving the error from the parser, and I think the suggestion makes things clear enough for now.
Fixes https://github.com/rust-lang/rust/issues/65659 .
2020-01-12 03:28:02 +01:00
Mazdak Farrokhzad
4eee796679
Rollup merge of #68120 - Centril:ban-range-to-dotdotdot, r=oli-obk
...
Ban `...X` pats, harden tests, and improve diagnostics
Follow up to https://github.com/rust-lang/rust/pull/67258#issuecomment-565656155 and https://github.com/rust-lang/rust/pull/67258#discussion_r357879932 .
r? @cramertj @oli-obk
2020-01-11 12:36:15 +01:00
Mazdak Farrokhzad
883932c6ba
Ban ...X
pats, harden tests, and improve diagnostics.
...
Also fix a bug with the span passed in `mk_range`.
2020-01-11 08:58:58 +01:00
Mazdak Farrokhzad
cacda2d7a0
Rollup merge of #68084 - estebank:ice-68000, r=varkor
...
Do not ICE on unicode next point
Use `shrink_to_hi` instead of `next_point` and fix `next_point`.
Fix #68000 , fix #68091 , fix #68092 .
2020-01-11 04:02:28 +01:00
varkor
088a1808d2
Add suggestions when encountering chained comparisons
2020-01-11 01:56:25 +00:00
Esteban Küber
b93ef68245
Change next_point
when shrink_to_hi
is more appropriate
2020-01-10 11:23:59 -08:00
Mazdak Farrokhzad
d5598aa7a0
Introduce #![feature(half_open_range_patterns)]
.
...
This feature adds `X..`, `..X`, and `..=X` patterns.
2020-01-10 07:29:04 +01:00
Vadim Petrochenkov
70f1d57048
Rename syntax_pos
to rustc_span
in source code
2020-01-01 09:15:18 +03:00
Mazdak Farrokhzad
2e7806146c
parser: bug -> span_bug
2019-12-31 04:33:34 +01:00
Mazdak Farrokhzad
6fba125912
parser::path: remove .fatal calls
2019-12-31 04:33:34 +01:00
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
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
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
211560d05c
extract parse_array_or_slice_ty
2019-12-21 19:20:41 +01:00
Mazdak Farrokhzad
49826845a9
use .span_suggestion_short for &&
2019-12-20 22:53:40 +01:00
Mazdak Farrokhzad
9b53c5be06
fix bug in parse_tuple_parens_expr + related refactoring
2019-12-20 22:53:40 +01:00
Mazdak Farrokhzad
66470d3217
recover #[attr] if expr {}
2019-12-20 22:53:40 +01:00
Mazdak Farrokhzad
a0d20935cc
introduce 'type AttrVec'
2019-12-20 22:53:40 +01:00
Mazdak Farrokhzad
3d5dbcb44a
simplify parse_bottom_expr more
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
948ff674f9
use mk_expr_err more
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
4311a4d7f9
extract parse_lit_expr and simplify
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
e9a4d94c44
extract parse_break_expr
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
a3c0ef1a8b
refactor parse_incorrect_await_syntax
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
2f9b191886
extract parse_{expr_opt, return_expr, yield_expr}
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
327641e35c
recover on 'do catch { .. }'
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
32ac9d0e45
pass attr as param in new methods
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
4e01b70964
add recovery to parse_labeled_expr
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
3ed5ba7fa8
extract parse_labeled_expr
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
5f0f86b6ca
extract parse_path_start_expr
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
cb985ba60f
extract parse_array_or_repeat_expr
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
9cb2b08a5d
extract parse_tuple_parens_expr
2019-12-20 22:41:29 +01:00
A C
0c32ee1781
Clean up parse_bottom_expr
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
dd15904a4d
parse_bottom_expr: use else if
2019-12-20 22:41:29 +01:00
Mazdak Farrokhzad
52acaa6974
implement recovery in check_assoc_op
2019-12-20 22:41:28 +01:00
Mazdak Farrokhzad
903c9dfd18
extract should_continue_as_assoc_expr
2019-12-20 22:41:28 +01:00
Mazdak Farrokhzad
34d91709b6
parse: refactor fun ret ty & param ty
2019-12-12 17:54:49 +01:00
Mazdak Farrokhzad
74804fa3e7
rustc_parser: cleanup imports
2019-12-05 06:38:06 +01:00
Vadim Petrochenkov
0fac56717a
syntax: Remove redundant span from ast::Mac
...
Also remove a couple of redundant `visit_mac` asserts
2019-12-02 21:56:34 +03:00
Vadim Petrochenkov
a81804b4d5
syntax: Introduce a struct MacArgs
for macro arguments
2019-12-02 21:56:34 +03:00
Matthew Jasper
064bed0f31
Parse and feature gate raw address of expressions
2019-11-24 18:06:13 +00:00
Matthew Jasper
a8efd31f2b
Add raw address of expressions to the AST and HIR
2019-11-24 18:06:13 +00:00
Vadim Petrochenkov
11580ced40
Address review comments
2019-11-17 01:11:28 +03:00
Vadim Petrochenkov
a699f17483
parse: Use string literal parsing in the asm
macro
2019-11-16 21:21:37 +03:00
Vadim Petrochenkov
b85a3da421
parse: Support parsing optional literals
...
Revert weird renaming of the former `LitError::report`
2019-11-16 21:21:37 +03:00
Mazdak Farrokhzad
4ae2728fa8
move syntax::parse -> librustc_parse
...
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-10 03:57:18 +01:00