Commit graph

54 commits

Author SHA1 Message Date
Erlend Tobiassen
c550c6759d
Add test for placeholder parameters in trait fn defs 2019-01-22 18:46:15 +01:00
Erlend Tobiassen
234b65fd61 Allow placeholder parameters in trait fn defs 2019-01-22 18:33:53 +01:00
Erlend Tobiassen
84f888e93d No need for is_type_start 2019-01-22 14:46:06 +01:00
Erlend Tobiassen
9f3d133813 Prefer TYPE_FIRST 2019-01-22 14:36:57 +01:00
Erlend Tobiassen
8198cde13b
Update tests after allowing where predicate to accept types 2019-01-22 14:32:23 +01:00
Erlend Tobiassen
2b22f5fb43 Optimistically bail out of where clause loop if not at start of a type or lifetime 2019-01-22 13:17:10 +01:00
Erlend Tobiassen
1aba42128f Don't leave a marker hanging without completing it. 2019-01-22 01:25:00 +01:00
Erlend Tobiassen
1059ec74e2 Allow types to the left of : in where predicates. 2019-01-22 01:11:35 +01:00
Marcus Klaas de Vries
fa43ef30f4 Change parsing of struct field patterns 2019-01-19 15:37:26 +03:00
Marcus Klaas de Vries
f9a6050034 Move parsing of field pattern lists to the parser (where it belongs) 2019-01-19 15:37:26 +03:00
Aleksey Kladov
b82fe73d1a make token set a const-fn 2019-01-19 15:36:58 +03:00
DJMcNab
0b9e462ab0 Fix handling of attributes in positional field lists 2019-01-12 15:42:12 +00:00
DJMcNab
afdb569902 Fix handling of where clauses in tuple structs 2019-01-10 18:21:01 +00:00
Florian Diebold
bb029cd29b Rename traits::impl_item -> impl_block as well, as well as the tests 2019-01-04 19:15:15 +01:00
Florian Diebold
fe6c4115f6 Rename ImplItem to ImplBlock
rustc uses the name ImplItem for items in impls, not the impl {} block itself,
which could lead to confusion.
2019-01-04 18:28:36 +01:00
csmoe
53c94e3ad8 parse minus before number literal 2018-12-30 23:25:07 +08:00
Florian Diebold
0d724ea572 Improve parsing of incomplete field accesses in preparation for field completion
We need to be able to get the receiver even if there is no field name yet, and
currently "a." wouldn't get parsed as a field name at all. This seems to help.
2018-12-25 15:16:42 +01:00
DJMcNab
bd5a358910 Fix where clauses using fully qualified path syntax 2018-12-21 17:20:38 +00:00
DJMcNab
55ebe449c9 Fix parsing of contextual_keyword union 2018-12-20 19:46:03 +00:00
DJMcNab
1d1950336f Use a better way of skipping SEMIs 2018-12-20 19:07:11 +00:00
DJMcNab
dc1c64f5b9 Support a blank expression before a semicolon 2018-12-20 19:07:11 +00:00
DJMcNab
134fe4f566 Fix the tests and fix the precommit hook 2018-12-20 16:45:54 +00:00
DJMcNab
466885aa5b Fix missing DOTDOTEQs 2018-12-20 16:22:13 +00:00
DJMcNab
f35151afed Don't require a command before EQ in a where clause 2018-12-20 15:50:42 +00:00
DJMcNab
27e814e182 Simplify NO_BLOCK testing 2018-12-20 12:28:59 +00:00
DJMcNab
5205c016e9 Fix ambiguity with if break
Brought up by #290
2018-12-20 11:35:02 +00:00
DJMcNab
a3b842fb8b Add tests and only traverse in the crates directory 2018-12-19 21:19:32 +00:00
DJMcNab
db67741430 Move is_block to lower in the call tree 2018-12-19 20:55:24 +00:00
DJMcNab
def0a95d35 Revert "Revert to f6f7c5"
This approach is correct, but it needs an addition to Restrictions too

This reverts commit ad00d0c8a5f64142e6636e8b048204c8f8982f4a.
2018-12-19 20:12:18 +00:00
DJMcNab
4dce66ad31 Fix handling of structs in match arms 2018-12-19 20:12:18 +00:00
DJMcNab
cd8e33fb7e Revert to f6f7c5 2018-12-19 20:12:18 +00:00
DJMcNab
7a8560ba38 Fix expression parsing by bailing out upon a macro block being found
TODO: Fix this when the block like macro is in expression position

E.g. `test(test!{})` currently parses
2018-12-19 20:12:18 +00:00
DJMcNab
97e70bf50f Possibly fix #225 2018-12-19 20:12:18 +00:00
DJMcNab
012537bd6c Fix at_ts doc comment 2018-12-19 20:12:18 +00:00
DJMcNab
20bbe0127c Fix parsing of inclusive ranges (#214)
I'm not certain that this is correct, so extra eyes would be good
2018-12-19 20:12:18 +00:00
Roland Ruckerbauer
d0f1334226 Fixed cast expression parsing in ra_syntax.
The cast expression expected any type via types::type_() function,
but the language spec does only allow TypeNoBounds (types without direct extra bounds
via `+`).

**Example:**

```rust
fn test() {
	6i8 as i32 + 5;
}
```

This fails, because the types::type_() function which should parse the type after the
as keyword is greedy, and takes all plus sign after path types as extra.

My proposed fix is to replace the not implemented `type_no_plus()` just calls (`type_()`)
function, which is used at several places. The replacement is `type_with_bounds_cond(p: &mut Parser, allow_bounds: bool)`, which passes the condition to relevant sub-parsers.

This function is then called by `type_()` and the new public `type_no_bounds()`.
2018-12-17 17:26:24 +01:00
Aleksey Kladov
4cbc902fcc grand module rename 2018-12-08 19:30:35 +03:00
Florian Diebold
1dfd06fc8a Use json comparison code from cargo for heavy tests 2018-12-06 21:32:15 +01:00
DJMcNab
0a82d768c4 Improve/add the use_item documentation 2018-12-05 21:43:40 +00:00
Aleksey Kladov
edeec6a414 Complete paths after :: 2018-11-21 18:34:20 +03:00
Aleksey Kladov
2ed1514df3 rename ROOT -> SOURCE_FILE 2018-11-07 18:42:36 +03:00
Aleksey Kladov
ec131b6c7b grammar: fix where clause parsing
closes #205
2018-11-06 21:19:32 +03:00
Aleksey Kladov
6502bd2c96 reduce code duplication 2018-11-05 11:39:51 +03:00
Aleksey Kladov
9010cb9839 grammar: for predicates in where
closes #191
2018-11-05 11:24:08 +03:00
Alan Du
d493a4476c clippy: Use if lets and remove redundant returns 2018-10-17 19:42:23 -04:00
Jeremy A. Kolb
61f3a438d3 Cargo Format
Run `cargo fmt` and ignore generated files
2018-10-16 09:41:10 -04:00
Aleksey Kladov
376639c70f Parse crate paths in expressions 2018-10-15 20:52:56 +03:00
Aleksey Kladov
171c176833 Run cargo fix 2018-10-15 19:55:32 +03:00
Daniel McNab
a55ef9b3ed Support leading pipe in match arms 2018-10-03 21:47:03 +01:00
Aleksey Kladov
baaf027da0 support 2018 paths 2018-09-29 14:53:23 +03:00