From 39dd1ca27da9e9d88ee59565df99ee281e1b3632 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 10 Mar 2025 12:42:45 -0400 Subject: Add `convert` keyword for defining conversions --- ast.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ast.h') diff --git a/ast.h b/ast.h index 2e398125..5ae03bb1 100644 --- a/ast.h +++ b/ast.h @@ -129,7 +129,7 @@ typedef enum { Not, Negative, HeapAllocate, StackReference, Mutexed, Holding, Min, Max, Array, Set, Table, TableEntry, Comprehension, - FunctionDef, Lambda, + FunctionDef, Lambda, ConvertDef, FunctionCall, MethodCall, Block, For, While, If, When, Repeat, @@ -228,6 +228,13 @@ struct ast_s { ast_t *cache; bool is_inline; } FunctionDef; + struct { + arg_ast_t *args; + type_ast_t *ret_type; + ast_t *body; + ast_t *cache; + bool is_inline; + } ConvertDef; struct { arg_ast_t *args; type_ast_t *ret_type; -- cgit v1.2.3