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");