diff options
| author | gingerBill <bill@gingerbill.org> | 2018-09-09 13:48:33 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-09-09 13:48:33 +0100 |
| commit | 12902821d63973e49f34fe5826f1069ca4ea605b (patch) | |
| tree | de0d95adc10257b85c52c361b00b25f49412cb87 /src/parser.cpp | |
| parent | f5549f6bde21c2378700770eae5ab7bba46a3671 (diff) | |
Make diverging procedure types different from ones without a return type
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index f0c5d0769..8476d4332 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -866,7 +866,7 @@ Ast *ast_poly_type(AstFile *f, Token token, Ast *type, Ast *specialization) { } -Ast *ast_proc_type(AstFile *f, Token token, Ast *params, Ast *results, u64 tags, ProcCallingConvention calling_convention, bool generic, bool no_return) { +Ast *ast_proc_type(AstFile *f, Token token, Ast *params, Ast *results, u64 tags, ProcCallingConvention calling_convention, bool generic, bool diverging) { Ast *result = alloc_ast_node(f, Ast_ProcType); result->ProcType.token = token; result->ProcType.params = params; @@ -874,7 +874,7 @@ Ast *ast_proc_type(AstFile *f, Token token, Ast *params, Ast *results, u64 tags, result->ProcType.tags = tags; result->ProcType.calling_convention = calling_convention; result->ProcType.generic = generic; - result->ProcType.no_return = no_return; + result->ProcType.diverging = diverging; return result; } @@ -2621,13 +2621,13 @@ Ast *parse_block_stmt(AstFile *f, b32 is_when) { -Ast *parse_results(AstFile *f, bool *no_return) { +Ast *parse_results(AstFile *f, bool *diverging) { if (!allow_token(f, Token_ArrowRight)) { return nullptr; } if (allow_token(f, Token_Not)) { - if (no_return) *no_return = true; + if (diverging) *diverging = true; return nullptr; } @@ -2667,7 +2667,7 @@ ProcCallingConvention string_to_calling_convention(String s) { Ast *parse_proc_type(AstFile *f, Token proc_token) { Ast *params = nullptr; Ast *results = nullptr; - bool no_return = false; + bool diverging = false; ProcCallingConvention cc = ProcCC_Invalid; if (f->curr_token.kind == Token_String) { @@ -2691,7 +2691,7 @@ Ast *parse_proc_type(AstFile *f, Token proc_token) { expect_token(f, Token_OpenParen); params = parse_field_list(f, nullptr, FieldFlag_Signature, Token_CloseParen, true, true); expect_token_after(f, Token_CloseParen, "parameter list"); - results = parse_results(f, &no_return); + results = parse_results(f, &diverging); u64 tags = 0; parse_proc_tags(f, &tags); @@ -2717,7 +2717,7 @@ Ast *parse_proc_type(AstFile *f, Token proc_token) { } } end: - return ast_proc_type(f, proc_token, params, results, tags, cc, is_generic, no_return); + return ast_proc_type(f, proc_token, params, results, tags, cc, is_generic, diverging); } Ast *parse_var_type(AstFile *f, bool allow_ellipsis, bool allow_type_token) { |