mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 15:47:31 +00:00
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
This commit is contained in:
parent
f7a7092d69
commit
c3ac2c93fb
3 changed files with 126 additions and 0 deletions
|
@ -535,11 +535,22 @@ fn cast_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
|
|||
m.complete(p, CAST_EXPR)
|
||||
}
|
||||
|
||||
// test arg_list
|
||||
// fn assert_float(s: &str, n: f64) {}
|
||||
// fn foo() {
|
||||
// assert_float(
|
||||
// "1.797693134862315708e+308L",
|
||||
// #[allow(clippy::excessive_precision)]
|
||||
// #[allow(dead_code)]
|
||||
// 1.797_693_134_862_315_730_8e+308,
|
||||
// );
|
||||
// }
|
||||
fn arg_list(p: &mut Parser) {
|
||||
assert!(p.at(T!['(']));
|
||||
let m = p.start();
|
||||
p.bump(T!['(']);
|
||||
while !p.at(T![')']) && !p.at(EOF) {
|
||||
attributes::outer_attributes(p);
|
||||
if !p.at_ts(EXPR_FIRST) {
|
||||
p.error("expected expression");
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue