Aleksey Kladov
22d295ceaa
Rename DotDotPat -> RestPat
2020-07-31 21:45:29 +02:00
Aleksey Kladov
9818108798
Rename BindPat -> IdentPat
2020-07-31 20:12:10 +02:00
Aleksey Kladov
6791eb9685
Rename PalceholderPat -> WildcardPat
2020-07-31 20:07:21 +02:00
Aleksey Kladov
14cb96ec0e
Allign RecordPat with RecordExpr
2020-07-31 20:00:48 +02:00
Aleksey Kladov
e8d50578ab
Correctly parse <_> paths in patterns
...
closes #3659
2020-06-09 13:45:18 +02:00
Aleksey Kladov
16943e533c
Minor, use T!
2020-06-09 13:45:11 +02:00
Aleksey Kladov
5e5eb6a108
Align grammar for record patterns and literals
...
The grammar now looks like this
[name_ref :] pat
2020-04-12 00:00:15 +02:00
Aleksey Kladov
da8eb29a2f
Macro patterns are not confused with expressions.
...
We treat macro calls as expressions (there's appropriate Into impl),
which causes problem if there's expresison and non-expression macro in
the same node (like in the match arm).
We fix this problem by nesting macor patterns into another node (the
same way we nest path into PathExpr or PathPat). Ideally, we probably
should add a similar nesting for macro expressions, but that needs
some careful thinking about macros in blocks: `{ am_i_expression!() }`.
2020-04-03 16:12:38 +02:00
Aleksey Kladov
0e46ed8420
Cleanups
2020-04-03 15:44:06 +02:00
Matthew Jasper
49b53cd7a0
Address review comments
2020-02-10 20:11:44 +00:00
Matthew Jasper
8c8d0bb34f
Add or- and parenthesized-patterns
2020-02-09 22:06:15 +00:00
Edwin Cheng
4a7e19946a
Fix parser for macro call in pattern position
2019-12-20 23:26:04 +08:00
Alexander Andreev
fdbd6bb11a
Added test for check doc strings in crates.
...
#1856
2019-09-30 11:58:53 +03:00
kjeremy
2d99e6de27
Simplify match arm
2019-09-20 12:03:25 -04:00
kjeremy
17a45a686c
Apply suggestion
2019-09-20 11:49:45 -04:00
kjeremy
5a65d4d9fb
Add indexing to record_field_pat
2019-09-20 11:43:34 -04:00
kjeremy
883edd002e
Replace usages of bump_any with bump
2019-09-19 15:51:46 -04:00
Dylan MacKenzie
4a3a15f0e7
Parse .. as a proper pattern
2019-09-14 17:08:22 -07:00
Aleksey Kladov
40170885e7
WIP: switch to fully decomposed tokens internally
2019-09-10 15:46:39 +03:00
Aleksey Kladov
e2b378ef7e
rename bump -> bump_any
2019-09-10 01:00:38 +03:00
Aleksey Kladov
32bebfaf0e
cleanup
2019-09-02 17:37:48 +03:00
Dylan MacKenzie
c08ad1cf8a
Handle Struct { box i } syntax
...
Named structs can have `box` patterns that will bind to their fields.
This is similar to the behavior of the `ref` and `mut` fields, but is at
least a little bit surprising.
2019-08-23 16:20:18 -07:00
Dylan MacKenzie
83433cd1f0
Centralize box pattern tests in patterns.rs
2019-08-23 16:19:53 -07:00
Dylan MacKenzie
ab51f57e1d
Parse BoxPat
2019-08-23 16:07:11 -07:00
Aleksey Kladov
5b18a4eef9
rename struct -> record, pos -> tuple
2019-08-23 16:59:50 +03:00
Dylan MacKenzie
f3b320adf4
Add BOX_KW to PATTERN_FIRST
2019-08-22 12:33:03 -07:00
Evgenii P
8222a1fddf
Fix is_path_start to accept T![<], fix is_path_start usages
2019-08-13 22:36:01 +07:00
csmoe
d6533994e4
fix: box_pattern
...
Change-Id: I45a856d74fb616d3bce33050f9e69d327186bd59
2019-06-19 14:28:50 +08: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
6646d49f23
Fix bug and add expr , pat , ty matcher
2019-04-14 11:42:20 +08:00
Michael Chesser
16418c35bc
Allow MINUS at the start of a pattern.
2019-03-14 19:24:11 +10:30
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
Aleksey Kladov
d334b5a1db
move parser to a separate crate
2019-02-21 13:27:45 +03:00