File tree 2 files changed +9
-6
lines changed 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -8826,7 +8826,7 @@ static void define_builtin_fns(CodeGen *g) {
8826
8826
create_builtin_fn(g, BuiltinFnIdAlignCast, "alignCast", 2);
8827
8827
create_builtin_fn(g, BuiltinFnIdSetAlignStack, "setAlignStack", 1);
8828
8828
create_builtin_fn(g, BuiltinFnIdExport, "export", 2);
8829
- create_builtin_fn(g, BuiltinFnIdExtern, "extern1 ", 2);
8829
+ create_builtin_fn(g, BuiltinFnIdExtern, "extern ", 2);
8830
8830
create_builtin_fn(g, BuiltinFnIdErrorReturnTrace, "errorReturnTrace", 0);
8831
8831
create_builtin_fn(g, BuiltinFnIdAtomicRmw, "atomicRmw", 5);
8832
8832
create_builtin_fn(g, BuiltinFnIdAtomicLoad, "atomicLoad", 3);
Original file line number Diff line number Diff line change @@ -1652,18 +1652,21 @@ static AstNode *ast_parse_primary_type_expr(ParseContext *pc) {
1652
1652
// TODO: This is not in line with the grammar.
1653
1653
// Because the prev stage 1 tokenizer does not parse
1654
1654
// @[a-zA-Z_][a-zA-Z0-9_] as one token, it has to do a
1655
- // hack, where it accepts '@' (IDENTIFIER / KEYWORD_export).
1655
+ // hack, where it accepts '@' (IDENTIFIER / KEYWORD_export /
1656
+ // KEYWORD_extern).
1656
1657
// I'd say that it's better if '@' is part of the builtin
1657
1658
// identifier token.
1658
1659
Token *at_sign = eat_token_if (pc, TokenIdAtSign);
1659
1660
if (at_sign != nullptr ) {
1660
1661
Buf *name;
1661
- Token *token = eat_token_if (pc, TokenIdKeywordExport);
1662
- if (token == nullptr ) {
1662
+ Token *token;
1663
+ if ((token = eat_token_if (pc, TokenIdKeywordExport)) != nullptr ) {
1664
+ name = buf_create_from_str (" export" );
1665
+ } else if ((token = eat_token_if (pc, TokenIdKeywordExtern)) != nullptr ) {
1666
+ name = buf_create_from_str (" extern" );
1667
+ } else {
1663
1668
token = expect_token (pc, TokenIdSymbol);
1664
1669
name = token_buf (token);
1665
- } else {
1666
- name = buf_create_from_str (" export" );
1667
1670
}
1668
1671
1669
1672
AstNode *res = ast_expect (pc, ast_parse_fn_call_arguments);
You can’t perform that action at this time.
0 commit comments