aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-01-25 21:07:37 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2025-01-25 21:07:37 +0200
commit26b79b88ed724d89211e8c3afdebc3c747ef3f67 (patch)
tree07f4d8ffa540b3f215d349c8a424221754b35a2c /src
parente8f78907830c525dccf1f4a5e6f97a15780c54ef (diff)
downloadek-26b79b88ed724d89211e8c3afdebc3c747ef3f67.tar.gz
ek-26b79b88ed724d89211e8c3afdebc3c747ef3f67.zip
allow extern with body to disable name mangling
Diffstat (limited to 'src')
-rw-r--r--src/parser.y8
1 files changed, 8 insertions, 0 deletions
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 ";"