diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-04 12:49:37 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-04 12:49:37 +0000 |
commit | dc8bcc1e42b573a8c315dd42a43c0fc4d5bfa8f8 (patch) | |
tree | 690bdd424bc2315e7a4479e1d1d3600ffe2160e2 /crates/ra_parser | |
parent | 8a5d48b6c6e180017e47175a07f77f4f7ec6549d (diff) | |
parent | a99b1db49f9040f2aec9e72b2c68ec8153210b49 (diff) |
Merge #926
926: allow vararg functions r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_parser')
-rw-r--r-- | crates/ra_parser/src/grammar/params.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar/params.rs b/crates/ra_parser/src/grammar/params.rs index 185386569..a70f067f9 100644 --- a/crates/ra_parser/src/grammar/params.rs +++ b/crates/ra_parser/src/grammar/params.rs | |||
@@ -43,7 +43,7 @@ fn list_(p: &mut Parser, flavor: Flavor) { | |||
43 | if flavor.type_required() { | 43 | if flavor.type_required() { |
44 | opt_self_param(p); | 44 | opt_self_param(p); |
45 | } | 45 | } |
46 | while !p.at(EOF) && !p.at(ket) { | 46 | while !p.at(EOF) && !p.at(ket) && !(flavor == Flavor::Normal && p.at(DOTDOTDOT)) { |
47 | if !p.at_ts(VALUE_PARAMETER_FIRST) { | 47 | if !p.at_ts(VALUE_PARAMETER_FIRST) { |
48 | p.error("expected value parameter"); | 48 | p.error("expected value parameter"); |
49 | break; | 49 | break; |
@@ -53,6 +53,11 @@ fn list_(p: &mut Parser, flavor: Flavor) { | |||
53 | p.expect(COMMA); | 53 | p.expect(COMMA); |
54 | } | 54 | } |
55 | } | 55 | } |
56 | // test param_list_vararg | ||
57 | // extern "C" { fn printf(format: *const i8, ...) -> i32; } | ||
58 | if flavor == Flavor::Normal { | ||
59 | p.eat(DOTDOTDOT); | ||
60 | } | ||
56 | p.expect(ket); | 61 | p.expect(ket); |
57 | m.complete(p, PARAM_LIST); | 62 | m.complete(p, PARAM_LIST); |
58 | } | 63 | } |