File tree Expand file tree Collapse file tree 2 files changed +43
-2
lines changed Expand file tree Collapse file tree 2 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -660,7 +660,14 @@ module.exports = grammar({
660
660
$ . self ,
661
661
) ,
662
662
663
- variadic_parameter : _ => '...' ,
663
+ variadic_parameter : $ => seq (
664
+ optional ( $ . mutable_specifier ) ,
665
+ optional ( seq (
666
+ field ( 'pattern' , $ . _pattern ) ,
667
+ ':' ,
668
+ ) ) ,
669
+ '...' ,
670
+ ) ,
664
671
665
672
parameter : $ => seq (
666
673
optional ( $ . mutable_specifier ) ,
Original file line number Diff line number Diff line change @@ -290,6 +290,12 @@ extern "C" fn printf(
290
290
...,
291
291
) {}
292
292
293
+ pub unsafe extern "C" fn c_variadic_no_use(fmt: *const i8, mut ap: ...) -> i32 {
294
+ // CHECK: call void @llvm.va_start
295
+ vprintf(fmt, ap.as_va_list())
296
+ // CHECK: call void @llvm.va_end
297
+ }
298
+
293
299
--------------------------------------------------------------------------------
294
300
295
301
(source_file
@@ -311,7 +317,35 @@ extern "C" fn printf(
311
317
(pointer_type
312
318
(type_identifier))
313
319
(variadic_parameter))
314
- (block)))
320
+ (block))
321
+ (function_item
322
+ (visibility_modifier)
323
+ (function_modifiers
324
+ (extern_modifier
325
+ (string_literal
326
+ (string_content))))
327
+ (identifier)
328
+ (parameters
329
+ (parameter
330
+ (identifier)
331
+ (pointer_type
332
+ (primitive_type)))
333
+ (variadic_parameter
334
+ (mutable_specifier)
335
+ (identifier)))
336
+ (primitive_type)
337
+ (block
338
+ (line_comment)
339
+ (call_expression
340
+ (identifier)
341
+ (arguments
342
+ (identifier)
343
+ (call_expression
344
+ (field_expression
345
+ (identifier)
346
+ (field_identifier))
347
+ (arguments))))
348
+ (line_comment))))
315
349
316
350
================================================================================
317
351
Use declarations
You can’t perform that action at this time.
0 commit comments