From 58a46b46e6f2697d7fd7d7ace421611d38380cf0 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Wed, 29 Mar 2023 21:35:53 +0200 Subject: [PATCH] cleanup notes --- core_parsing.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core_parsing.cpp b/core_parsing.cpp index da625f4..6e6c5e1 100644 --- a/core_parsing.cpp +++ b/core_parsing.cpp @@ -874,6 +874,9 @@ parse_decl(B32 is_global) { Ast_Expr *expr = parse_expr(); result = ast_const(tname, tname->intern_val, expr); + // @cleanup: consider simplifying lambdas, removing AST_LAMBDA_EXPR and + // implementing actual parse_lambda or something. Probably needs less + // ambigious syntax. if (expr->kind == AST_LAMBDA_EXPR) { auto a = (Ast_Lambda *)expr; if (a->scope || is_flag_set(flags, AST_FOREIGN)) { @@ -885,6 +888,10 @@ parse_decl(B32 is_global) { } } else if (token_match(TK_StringLit, TK_DoubleColon)) { + + // @cleanup: consider simplifying lambdas, removing AST_LAMBDA_EXPR and + // implementing actual parse_lambda or something. Probably needs less + // ambigious syntax. Ast_Lambda *expr = (Ast_Lambda *)parse_expr(); if (expr->kind != AST_LAMBDA_EXPR) { compiler_error(tname, "Operator overload is required to be a lambda function");