| ... | ... | @@ -91,7 +91,7 @@ static Token *ast_parse_break_label(ParseContext *pc); |
| 91 | 91 | static Token *ast_parse_block_label(ParseContext *pc); |
| 92 | 92 | static AstNode *ast_parse_field_init(ParseContext *pc); |
| 93 | 93 | static AstNode *ast_parse_while_continue_expr(ParseContext *pc); |
| 94 | | static AstNode *ast_parse_section(ParseContext *pc); |
| 94 | static AstNode *ast_parse_link_section(ParseContext *pc); |
| 95 | 95 | static Optional<AstNodeFnProto> ast_parse_fn_cc(ParseContext *pc); |
| 96 | 96 | static AstNode *ast_parse_param_decl(ParseContext *pc); |
| 97 | 97 | static AstNode *ast_parse_param_type(ParseContext *pc); |
| ... | ... | @@ -775,7 +775,7 @@ static AstNode *ast_parse_top_level_decl(ParseContext *pc, VisibMod visib_mod) { |
| 775 | 775 | return nullptr; |
| 776 | 776 | } |
| 777 | 777 | |
| 778 | | // FnProto <- FnCC? KEYWORD_fn IDENTIFIER? LPAREN ParamDeclList RPAREN ByteAlign? Section? EXCLAMATIONMARK? (KEYWORD_var / TypeExpr) |
| 778 | // FnProto <- FnCC? KEYWORD_fn IDENTIFIER? LPAREN ParamDeclList RPAREN ByteAlign? LinkSection? EXCLAMATIONMARK? (KEYWORD_var / TypeExpr) |
| 779 | 779 | static AstNode *ast_parse_fn_proto(ParseContext *pc) { |
| 780 | 780 | Token *first = peek_token(pc); |
| 781 | 781 | AstNodeFnProto fn_cc; |
| ... | ... | @@ -806,7 +806,7 @@ static AstNode *ast_parse_fn_proto(ParseContext *pc) { |
| 806 | 806 | expect_token(pc, TokenIdRParen); |
| 807 | 807 | |
| 808 | 808 | AstNode *align_expr = ast_parse_byte_align(pc); |
| 809 | | AstNode *section_expr = ast_parse_section(pc); |
| 809 | AstNode *section_expr = ast_parse_link_section(pc); |
| 810 | 810 | Token *var = eat_token_if(pc, TokenIdKeywordVar); |
| 811 | 811 | Token *exmark = nullptr; |
| 812 | 812 | AstNode *return_type = nullptr; |
| ... | ... | @@ -842,7 +842,7 @@ static AstNode *ast_parse_fn_proto(ParseContext *pc) { |
| 842 | 842 | return res; |
| 843 | 843 | } |
| 844 | 844 | |
| 845 | | // VarDecl <- (KEYWORD_const / KEYWORD_var) IDENTIFIER (COLON TypeExpr)? ByteAlign? Section? (EQUAL Expr)? SEMICOLON |
| 845 | // VarDecl <- (KEYWORD_const / KEYWORD_var) IDENTIFIER (COLON TypeExpr)? ByteAlign? LinkSection? (EQUAL Expr)? SEMICOLON |
| 846 | 846 | static AstNode *ast_parse_var_decl(ParseContext *pc) { |
| 847 | 847 | Token *first = eat_token_if(pc, TokenIdKeywordConst); |
| 848 | 848 | if (first == nullptr) |
| ... | ... | @@ -856,7 +856,7 @@ static AstNode *ast_parse_var_decl(ParseContext *pc) { |
| 856 | 856 | type_expr = ast_expect(pc, ast_parse_type_expr); |
| 857 | 857 | |
| 858 | 858 | AstNode *align_expr = ast_parse_byte_align(pc); |
| 859 | | AstNode *section_expr = ast_parse_section(pc); |
| 859 | AstNode *section_expr = ast_parse_link_section(pc); |
| 860 | 860 | AstNode *expr = nullptr; |
| 861 | 861 | if (eat_token_if(pc, TokenIdEq) != nullptr) |
| 862 | 862 | expr = ast_expect(pc, ast_parse_expr); |
| ... | ... | @@ -1490,8 +1490,8 @@ static AstNode *ast_parse_error_union_expr(ParseContext *pc) { |
| 1490 | 1490 | } |
| 1491 | 1491 | |
| 1492 | 1492 | // SuffixExpr |
| 1493 | | // <- AsyncPrefix PrimaryTypeExpr SuffixOp* FnCallArgumnets |
| 1494 | | // / PrimaryTypeExpr (SuffixOp / FnCallArgumnets)* |
| 1493 | // <- AsyncPrefix PrimaryTypeExpr SuffixOp* FnCallArguments |
| 1494 | // / PrimaryTypeExpr (SuffixOp / FnCallArguments)* |
| 1495 | 1495 | static AstNode *ast_parse_suffix_expr(ParseContext *pc) { |
| 1496 | 1496 | AstNode *async_call = ast_parse_async_prefix(pc); |
| 1497 | 1497 | if (async_call != nullptr) { |
| ... | ... | @@ -1599,7 +1599,7 @@ static AstNode *ast_parse_suffix_expr(ParseContext *pc) { |
| 1599 | 1599 | } |
| 1600 | 1600 | |
| 1601 | 1601 | // PrimaryTypeExpr |
| 1602 | | // <- BUILTININDENTIFIER FnCallArgumnets |
| 1602 | // <- BUILTINIDENTIFIER FnCallArguments |
| 1603 | 1603 | // / CHAR_LITERAL |
| 1604 | 1604 | // / ContainerDecl |
| 1605 | 1605 | // / ErrorSetDecl |
| ... | ... | @@ -1978,7 +1978,7 @@ static AsmOutput *ast_parse_asm_output_item(ParseContext *pc) { |
| 1978 | 1978 | return res; |
| 1979 | 1979 | } |
| 1980 | 1980 | |
| 1981 | | // AsmInput <- COLON AsmInputList AsmCloppers? |
| 1981 | // AsmInput <- COLON AsmInputList AsmClobbers? |
| 1982 | 1982 | static AstNode *ast_parse_asm_input(ParseContext *pc) { |
| 1983 | 1983 | if (eat_token_if(pc, TokenIdColon) == nullptr) |
| 1984 | 1984 | return nullptr; |
| ... | ... | @@ -2011,7 +2011,7 @@ static AsmInput *ast_parse_asm_input_item(ParseContext *pc) { |
| 2011 | 2011 | return res; |
| 2012 | 2012 | } |
| 2013 | 2013 | |
| 2014 | | // AsmCloppers <- COLON StringList |
| 2014 | // AsmClobbers <- COLON StringList |
| 2015 | 2015 | static AstNode *ast_parse_asm_cloppers(ParseContext *pc) { |
| 2016 | 2016 | if (eat_token_if(pc, TokenIdColon) == nullptr) |
| 2017 | 2017 | return nullptr; |
| ... | ... | @@ -2080,8 +2080,8 @@ static AstNode *ast_parse_while_continue_expr(ParseContext *pc) { |
| 2080 | 2080 | return expr; |
| 2081 | 2081 | } |
| 2082 | 2082 | |
| 2083 | | // Section <- KEYWORD_section LPAREN Expr RPAREN |
| 2084 | | static AstNode *ast_parse_section(ParseContext *pc) { |
| 2083 | // LinkSection <- KEYWORD_linksection LPAREN Expr RPAREN |
| 2084 | static AstNode *ast_parse_link_section(ParseContext *pc) { |
| 2085 | 2085 | Token *first = eat_token_if(pc, TokenIdKeywordLinkSection); |
| 2086 | 2086 | if (first == nullptr) |
| 2087 | 2087 | return nullptr; |
| ... | ... | @@ -2742,7 +2742,7 @@ static AstNode *ast_parse_async_prefix(ParseContext *pc) { |
| 2742 | 2742 | return res; |
| 2743 | 2743 | } |
| 2744 | 2744 | |
| 2745 | | // FnCallArgumnets <- LPAREN ExprList RPAREN |
| 2745 | // FnCallArguments <- LPAREN ExprList RPAREN |
| 2746 | 2746 | static AstNode *ast_parse_fn_call_argumnets(ParseContext *pc) { |
| 2747 | 2747 | Token *paren = eat_token_if(pc, TokenIdLParen); |
| 2748 | 2748 | if (paren == nullptr) |