mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
allow vararg functions
This commit is contained in:
parent
5197e16648
commit
a99b1db49f
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