Evgenii P
77f4ab3e9b
Deduplicate while loop break condition
2019-08-08 08:58:28 +07:00
Aleksey Kladov
d6ab1af086
assoc types bounds
2019-08-07 21:00:02 +02:00
Evgenii P
79d4202194
Fix parser to correctly consume outer attrs before ellipsis param
2019-08-08 00:36:19 +07:00
Evgenii P
9ea36703d2
Fix variadic arg inline test
2019-08-07 23:48:21 +07:00
Evgenii P
3fb58c620c
Add function parameters attributes
2019-08-07 23:42:28 +07:00
bravomikekilo
562359d706
fix block parse problem
2019-08-03 19:57:07 +08:00
csmoe
8fe58c3598
fix: parse box syntax inside parentheses
2019-07-22 20:52:10 +08:00
Unreal Hoang
3a7f07c62d
add await to syntax, parser for await_expr
2019-07-20 17:41:31 +09:00
Ryan Cumming
2959aa446e
Remove parse error on array initializer attributes
...
This is actually allowed by the `rustc` parser but most attributes will
fail later due to attributes on expressions being experimental.
2019-06-30 19:55:50 +10:00
Ryan Cumming
b01496538c
Support attributes on array members
...
Array members are allow to have attributes such as `#[cfg]`.
This is a bit tricky as we don't know if the first expression is an
initializer or a member until we encounter a `;`. This reuses a trick
from `stmt` where we remember if we saw an attribute and then raise an
error if the first expression ends up being an initializer.
This isn't perfect as the error isn't correctly located on the attribute
or initializer; it ends up immediately after the `;`.
2019-06-30 18:36:54 +10:00
zjy
de930237ff
fixed #1384
2019-06-28 15:22:17 +08:00
bors[bot]
67ecc88f66
Merge #1415
...
1415: fix: specialization r=matklad a=csmoe
Closes #1402
r? @matklad
Co-authored-by: csmoe <csmoe@msn.com>
2019-06-24 10:10:05 +00:00
csmoe
d04473accb
fix: specialization(with blindly parsing)
...
Change-Id: Ic5d2767e8781568d76d4d0013cd6081e95ae8a95
2019-06-19 18:37:38 +08:00
csmoe
d6533994e4
fix: box_pattern
...
Change-Id: I45a856d74fb616d3bce33050f9e69d327186bd59
2019-06-19 14:28:50 +08:00
csmoe
5999733ca6
fix: box_syntax( #1412 )
...
Change-Id: I6e20e0163fa545de37226c1561b3b7103615626c
2019-06-18 21:46:47 +08:00
csmoe
2ca9f71897
fix: support existential type
2019-06-12 14:32:39 +00:00
csmoe
205a8278a9
fix: never type with binding
...
Change-Id: I14e1bc628b9d2dfdb1f40de3d3707f4e872767f2
2019-06-07 19:49:49 +08:00
Andrey Tkachenko
505b8d873f
[ #1083 ] Try block syntax: fix tests
2019-06-06 16:26:54 +04:00
Andrey Tkachenko
281c9eeaff
[ #1083 ] Try block syntax
2019-06-06 15:43:26 +04:00
Alan Du
4e449fb0b0
Fix clippy::if_same_then_else
2019-06-04 18:05:07 -04:00
Aleksey Kladov
0270b4bc57
reformat
2019-05-24 01:48:44 +03:00
Sergey Parilin
993abedd77
apply T! macro where it is possible
2019-05-15 15:35:47 +03:00
Edwin Cheng
b454eb5a60
Add macro pat parsing
2019-04-30 23:22:48 +08:00
Edwin Cheng
d436ab0581
Refactor parser handle mult-char punct internally
2019-04-28 23:46:03 +08:00
kjeremy
d8649c1af8
Simplify
2019-04-26 11:42:56 -04:00
Edwin Cheng
6c913d8fa7
Add ...
parsing for fn pointer type
2019-04-23 11:10:41 +08:00
Edwin Cheng
c0f19d7005
Add expr, pat, ty and macro_stmts
2019-04-19 03:49:56 +08:00
Edwin Cheng
57e4122b89
Add mbe stmt matcher
2019-04-17 12:34:43 +08:00
Edwin Cheng
6646d49f23
Fix bug and add expr , pat , ty matcher
2019-04-14 11:42:20 +08:00
robojumper
ca40ca93a5
Parse and infer tuple indices
2019-04-06 01:07:35 +02:00
robojumper
636270f4a4
Parse unsafe async / const unsafe fns properly
2019-04-03 17:11:56 +02:00
bors[bot]
56f3524c69
Merge #1082
...
1082: Async block in argument position r=matklad a=andreytkachenko
Fixes case when async block appears in argument position
Co-authored-by: Andrey Tkachenko <andreytkachenko64@gmail.com>
2019-04-01 11:22:13 +00:00
Andrey Tkachenko
e89b97524a
Async block in argument position
2019-04-01 15:15:41 +04:00
robojumper
d43dff43b4
Async closure syntax
2019-03-31 16:35:22 +02:00
Ville Penttinen
3f62ab8f51
Add WherePred to allow predicate access in WhereClause
...
This also unifies parsing of WHERE_PRED bounds, now Lifetime bounds will also be
parsed using TYPE_BOUND_LIST
2019-03-31 13:20:56 +03:00
bors[bot]
4666138c91
Merge #1072
...
1072: recognize async move blocks r=matklad a=memoryruins
closes #1053
Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
2019-03-31 09:18:21 +00:00
Ville Penttinen
98cff6ecec
Change parsing bounds in path_types
...
Now bounds inside a path are parsed as DYN_TRAIT_TYPE, previously they would be
parsed as `PATH_TYPE` followed by `TYPE_BOUND_LIST`.
Basically this means `Box<T + 'f>` is now parsed almost the same as
`Box<dyn T + 'f>` with the exception of not having the `dyn` keyword.
2019-03-31 10:38:36 +03:00
Ville Penttinen
e3f9d6555b
Move parsing a single TYPE_BOUND to a separate function
2019-03-30 17:23:54 +02:00
Ville Penttinen
23fdc562bf
Add new TYPE_BOUND_LIST and TYPE_BOUND syntax kinds
...
These are now used when parsing type bounds. In addition parsing paths inside a
bound now does not recursively parse paths, rather they are treated as separate
bounds, separated by +.
2019-03-30 17:11:21 +02:00
Ville Penttinen
444a119220
Fix parsing <= in type_args
2019-03-30 13:52:47 +02:00
memoryruins
abe96a4765
recognize async move
2019-03-28 18:38:59 -04:00
Ville Penttinen
95505e80fc
Support references in higher-ranked trait bounds
...
Fixes #1020
2019-03-24 20:51:55 +02:00
Aleksey Kladov
4fd8cfd6ad
replace todo with fixme
2019-03-23 11:07:09 +03:00
pcpthm
4cf179c089
Replace contract_child
to a less ad-hoc API
2019-03-19 18:44:23 +09:00
pcpthm
2fb110e1fa
Error about attributes on
...
unallowed types of expression statement
2019-03-19 17:37:08 +09:00
pcpthm
ffed132e52
Allow attributes on top level expression
...
A top level expression is either
- a expression statement or
- the last expression in a block
2019-03-19 17:24:02 +09:00
bors[bot]
1cd18f9237
Merge #991
...
991: Use Marker argument for item parsers r=matklad a=pcpthm
Before doing this for expressions, I found that the pattern (Marker argument) should be applied to the item parsers because visiblity and modifiers are parsed in a separate function.
Fixed some parser bugs:
- Fix pub_expr: `pub 42;` was allowed.
- Fix incorrect parsing of crate::path: incorrectly parsed as `crate` as a visibility.
Co-authored-by: pcpthm <pcpthm@gmail.com>
2019-03-18 09:32:28 +00:00
pcpthm
76075c7410
Use Marker argument for item parsers
...
- Fix pub_expr
- Fix incorrect parsing of crate::path
2019-03-18 14:34:08 +09:00
bors[bot]
4c1ea0b628
Merge #987
...
987: Refactor maybe_item to use Marker argument r=pcpthm a=pcpthm
As suggested at <https://github.com/rust-analyzer/rust-analyzer/pull/980#issuecomment-473659745 >.
For expression paring functions, changing signature
- from `fn(&mut Parser) -> Option<CompletedMarker>` to `fn(&mut Parser, Marker) -> Result<CompletedMarker, Marker>`
- from `fn(&mut Parser) -> CompletedMarker` to `fn(&mut Parser, Marker) -> CompletedMarker`
is my plan.
Co-authored-by: pcpthm <pcpthm@gmail.com>
2019-03-18 04:16:20 +00:00
pcpthm
3d9c2beb8e
Apply stylistic changes suggested
2019-03-18 13:14:47 +09:00
bors[bot]
91e7a3b6f2
Merge #983
...
983: support remainder assignment operator r=matklad a=JeanMertz
`%=` was returning errors for me, turns out it wasn't added as a valid assignment operation.
I'm not sure what the best location would be to add a test for this. Please let me know and I'll add one.
Co-authored-by: Jean Mertz <jean@mertz.fm>
2019-03-17 14:34:14 +00:00
Jean Mertz
a8ee994ae0
support remainder assignment operator
2019-03-17 14:11:24 +01:00
pcpthm
e570267515
Refactor maybe_item to use Marker argument
2019-03-17 22:04:25 +09:00
pcpthm
a67fe4ea7e
Fix parse tree of attribute on match arm
2019-03-17 20:57:27 +09:00
bors[bot]
aea9c98f53
Merge #985
...
985: simplify parsing blocks a bit r=pcpthm a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-17 10:26:45 +00:00
Aleksey Kladov
a8271cb31f
simplify parsing blocks a bit
2019-03-17 13:14:17 +03:00
pcpthm
a1d84f5fb0
Allow attribute on struct literal field
2019-03-17 19:08:35 +09:00
Michael Chesser
16418c35bc
Allow MINUS at the start of a pattern.
2019-03-14 19:24:11 +10:30
Caio
cc9721996c
Add test for async block
2019-03-10 14:35:25 -03:00
Caio
ad72699553
Add async keyword
2019-03-09 20:40:22 -03:00
Ville Penttinen
eb1ac43867
Introduce pattern_list to parse pipe separated patterns
...
pattern_list comes in two variants, one uses the default PAT_RECOVERY_SET as the
recovery set, while other allows the user to provide a recovery set.
2019-03-05 11:31:25 +02:00
Ville Penttinen
1f4468a8da
Add support for parsing multiple if and while-let patterns
2019-03-04 19:10:14 +02:00
Aleksey Kladov
90122542b2
allow mut ident
patterns in trait methods
...
closes #928
2019-03-04 17:47:02 +03:00
Aleksey Kladov
0a19f4f1b4
allow aliases in underscores
...
this helps with
use foo::Trait as _;
syntax
2019-03-04 16:40:08 +03:00
bors[bot]
dc8bcc1e42
Merge #926
...
926: allow vararg functions r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-04 12:49:37 +00:00
Aleksey Kladov
a99b1db49f
allow vararg functions
2019-03-04 14:34:59 +03:00
Aleksey Kladov
3000b13df2
extract block contents into a function
2019-03-04 14:17:31 +03:00
Aleksey Kladov
78f10fcdc4
rename type to type_alias in the AST as well
2019-02-25 13:49:32 +03:00
Aleksey Kladov
d334b5a1db
move parser to a separate crate
2019-02-21 13:27:45 +03:00