mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Merge #926
926: allow vararg functions r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
dc8bcc1e42
3 changed files with 56 additions and 1 deletions
|
@ -43,7 +43,7 @@ fn list_(p: &mut Parser, flavor: Flavor) {
|
|||
if flavor.type_required() {
|
||||
opt_self_param(p);
|
||||
}
|
||||
while !p.at(EOF) && !p.at(ket) {
|
||||
while !p.at(EOF) && !p.at(ket) && !(flavor == Flavor::Normal && p.at(DOTDOTDOT)) {
|
||||
if !p.at_ts(VALUE_PARAMETER_FIRST) {
|
||||
p.error("expected value parameter");
|
||||
break;
|
||||
|
@ -53,6 +53,11 @@ fn list_(p: &mut Parser, flavor: Flavor) {
|
|||
p.expect(COMMA);
|
||||
}
|
||||
}
|
||||
// test param_list_vararg
|
||||
// extern "C" { fn printf(format: *const i8, ...) -> i32; }
|
||||
if flavor == Flavor::Normal {
|
||||
p.eat(DOTDOTDOT);
|
||||
}
|
||||
p.expect(ket);
|
||||
m.complete(p, PARAM_LIST);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue