cleanup notes
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user