Aleksey Kladov
7a39bc3ba2
Make records grammar more orthogonal
...
We used
name [: expr]
grammar before, now it is
[name :] expr
which makes things simpler
2020-04-11 19:20:41 +02:00
Aleksey Kladov
5c5bde47fb
Rename some tokens
2020-04-10 17:07:09 +02:00
Aleksey Kladov
0e46ed8420
Cleanups
2020-04-03 15:44:06 +02:00
Aleksey Kladov
4a745cc8cf
Fix parsing of stement-ish binary expressions
...
closes #3512
2020-03-11 14:28:18 +01:00
Edwin Cheng
f4e48ad3e4
Parse attr in rhs of let stmts
2020-02-28 13:08:47 +08:00
Aleksey Kladov
3a859e587f
Nest attrs into exprs in function args
2020-01-17 11:47:07 +01:00
Aleksey Kladov
b7c45fba57
Extract expr_with_attrs
2020-01-17 11:44:40 +01:00
Aleksey Kladov
90b8a31b83
Merge pull request #2813 from jyn514/arg_attributes
...
Allow attributes before function arguments
2020-01-17 11:15:07 +01:00
Joshua Nelson
f077d5c303
move inline function closer to relevant code
...
also updates generated inline tests
2020-01-16 22:20:17 -05:00
Edwin Cheng
ed8d5c86e3
Fix array element attribute position
2020-01-16 23:37:43 +08:00
Joshua Nelson
c78e34968f
shrink inline tes
2020-01-15 19:12:56 -05:00
Joshua Nelson
c3ac2c93fb
Allow attributes before function arguments
...
This adds support for function calls of the form:
```rust
(
#[attr(...)] 1.2,
#[attr_one(...)]
#[attr_two(...)]
1.5,
... etc ...
)
```
Closes https://github.com/rust-analyzer/rust-analyzer/issues/2801
2020-01-12 10:25:41 -05:00
Geoffry Song
a68aefdc46
Move inclusive range check to validation
2019-11-15 01:04:45 -08:00
Geoffry Song
989cebc99c
Fix parsing of "postfix" range expressions.
...
Right now they are handled in `postfix_dot_expr`, but that doesn't allow it to
correctly handle precedence. Integrate it more tightly with the Pratt parser
instead.
Also includes a drive-by fix for parsing `match .. {}`.
Fixes #2242 .
2019-11-15 00:18:28 -08:00
bors[bot]
d9338dfa98
Merge #1951
...
1951: Lower the precedence of the `as` operator. r=matklad a=goffrie
Previously, the `as` operator was being parsed like a postfix expression, and
therefore being given the highest possible precedence. That caused it to bind
more tightly than prefix operators, which it should not. Instead, parse it
somewhat like a normal binary expression with some special-casing.
Fixes #1851 .
Co-authored-by: Geoffry Song <goffrie@gmail.com>
2019-10-08 08:44:26 +00:00
Geoffry Song
b4fe06bc17
Move tests around
2019-10-05 16:33:05 -07:00
Geoffry Song
9638adaa40
Fix parsing of block expressions in "forbid_structs" contexts.
...
Forbidding block expressions entirely is too strict; instead, we should only
forbid them in contexts where we are parsing an optional RHS (i.e. the RHS of a
range expression).
2019-10-03 00:39:52 -07:00
Geoffry Song
b63f260bbc
Lower the precedence of the as
operator.
...
Previously, the `as` operator was being parsed like a postfix expression, and
therefore being given the highest possible precedence. That caused it to bind
more tightly than prefix operators, which it should not. Instead, parse it
somewhat like a normal binary expression with some special-casing.
2019-10-03 00:27:09 -07:00
Alexander Andreev
fdbd6bb11a
Added test for check doc strings in crates.
...
#1856
2019-09-30 11:58:53 +03:00
kjeremy
883edd002e
Replace usages of bump_any with bump
2019-09-19 15:51:46 -04:00
Aleksey Kladov
b9d9db83d1
cleanup dollar handling in expressions
2019-09-10 21:28:27 +03: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
7910202ecd
tiny simplification
2019-09-09 13:23:41 +03:00
Aleksey Kladov
3c2dea7f55
always wrap block into an expression
2019-09-02 20:15:51 +03:00
Aleksey Kladov
5b18a4eef9
rename struct -> record, pos -> tuple
2019-08-23 16:59:50 +03:00
bors[bot]
19e0d7d596
Merge #1676
...
1676: Fix for<'lifetime> for types specified by path r=matklad a=eupn
Fixes #1467 .
Co-authored-by: Evgenii P <eupn@protonmail.com>
2019-08-14 15:10:31 +00:00
Evgenii P
8222a1fddf
Fix is_path_start to accept T![<], fix is_path_start usages
2019-08-13 22:36:01 +07:00
bors[bot]
978e3e384b
Merge #1636
...
1636: fix block parse problem r=matklad a=bravomikekilo
try to fix [issue-1598](https://github.com/rust-analyzer/rust-analyzer/issues/1598 ).
Co-authored-by: bravomikekilo <bmk1221@126.com>
2019-08-13 12:46:47 +00:00
bravomikekilo
eb0e9bd981
add inline test
2019-08-13 18:17:10 +08:00
Aleksey Kladov
f3ee5a1509
Move numeric names inside of NameRef
2019-08-09 12:16:47 +02:00
Evgenii P
fa24e20867
Make name_ref to accept numeric names optionally
2019-08-09 16:08:36 +07:00
Evgenii P
957b5ed23a
Parse tuple struct field initialization
2019-08-09 15:38:52 +07:00
bravomikekilo
562359d706
fix block parse problem
2019-08-03 19:57:07 +08:00
Unreal Hoang
3a7f07c62d
add await to syntax, parser for await_expr
2019-07-20 17:41:31 +09:00
zjy
de930237ff
fixed #1384
2019-06-28 15:22:17 +08:00
csmoe
205a8278a9
fix: never type with binding
...
Change-Id: I14e1bc628b9d2dfdb1f40de3d3707f4e872767f2
2019-06-07 19:49:49 +08:00
Alan Du
4e449fb0b0
Fix clippy::if_same_then_else
2019-06-04 18:05:07 -04:00
Sergey Parilin
993abedd77
apply T! macro where it is possible
2019-05-15 15:35:47 +03:00
kjeremy
d8649c1af8
Simplify
2019-04-26 11:42:56 -04: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
Ville Penttinen
444a119220
Fix parsing <= in type_args
2019-03-30 13:52:47 +02: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