From 26b79b88ed724d89211e8c3afdebc3c747ef3f67 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 25 Jan 2025 21:07:37 +0200 Subject: allow extern with body to disable name mangling --- src/parser.y | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/parser.y b/src/parser.y index 45cac92..352a770 100644 --- a/src/parser.y +++ b/src/parser.y @@ -735,6 +735,14 @@ proc $$ = gen_proc($[ID], $[opt_decls], NULL, NULL, src_loc(@$)); ast_set_flags($$, AST_FLAG_EXTERN | AST_FLAG_NOMANGLE); } + | "extern" ID "(" opt_decls ")" body { + $$ = gen_proc($[ID], $[opt_decls], NULL, $[body], src_loc(@$)); + ast_set_flags($$, AST_FLAG_NOMANGLE); + } + | "extern" ID "(" opt_decls "=>" opt_type ")" body { + $$ = gen_proc($[ID], $[opt_decls], $[opt_type], $[body], src_loc(@$)); + ast_set_flags($$, AST_FLAG_NOMANGLE); + } behaviour : type_expand ";" -- cgit v1.3