aboutsummaryrefslogtreecommitdiff
path: root/ast.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-01-02 20:29:55 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-01-02 20:29:55 -0500
commitb025cf269d2e07e179be4a0e34d936862dc640c2 (patch)
tree6bcce81829436a08dbe4f0101044c0cd07811525 /ast.h
parent500e4e1bd74b45476c4df0f4f9da72fbada9bb18 (diff)
Use `holding` blocks for mutexed data instead of lambdas
Diffstat (limited to 'ast.h')
-rw-r--r--ast.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/ast.h b/ast.h
index 424eced2..173b3178 100644
--- a/ast.h
+++ b/ast.h
@@ -78,6 +78,7 @@ typedef enum {
TableTypeAST,
FunctionTypeAST,
OptionalTypeAST,
+ MutexedTypeAST,
} type_ast_e;
typedef struct tag_ast_s {
@@ -116,7 +117,7 @@ struct type_ast_s {
} FunctionTypeAST;
struct {
type_ast_t *type;
- } OptionalTypeAST;
+ } OptionalTypeAST, MutexedTypeAST;
} __data;
};
@@ -127,7 +128,7 @@ typedef enum {
TextLiteral, TextJoin, PrintStatement,
Declare, Assign,
BinaryOp, UpdateAssign,
- Not, Negative, HeapAllocate, StackReference, Mutexed,
+ Not, Negative, HeapAllocate, StackReference, Mutexed, Holding,
Min, Max,
Array, Set, Table, TableEntry, Comprehension,
FunctionDef, Lambda,
@@ -195,6 +196,9 @@ struct ast_s {
ast_t *value;
} Not, Negative, HeapAllocate, StackReference, Mutexed;
struct {
+ ast_t *mutexed, *body;
+ } Holding;
+ struct {
ast_t *lhs, *rhs, *key;
} Min, Max;
struct {