aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-07-25 21:56:36 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-07-25 21:56:36 +0200
commit18afea306114de303161f4aa044fb9842db1b10c (patch)
tree483e8dc928d577b0ada6ae61be0cc6aa2a63eabe /src/common
parent5f37d25310d282c0370f082328b5268e344b131c (diff)
Support soa in generics
Diffstat (limited to 'src/common')
-rw-r--r--src/common/ast.odin20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/common/ast.odin b/src/common/ast.odin
index 4f1b25d..267c84d 100644
--- a/src/common/ast.odin
+++ b/src/common/ast.odin
@@ -207,6 +207,26 @@ unwrap_pointer_expr :: proc(expr: ^ast.Expr) -> (^ast.Expr, int, bool) {
return expr, n, true
}
+array_is_soa :: proc(array: ast.Array_Type) -> bool {
+ if array.tag != nil {
+ if basic, ok := array.tag.derived.(^ast.Basic_Directive);
+ ok && basic.name == "soa" {
+ return true
+ }
+ }
+ return false
+}
+
+dynamic_array_is_soa :: proc(array: ast.Dynamic_Array_Type) -> bool {
+ if array.tag != nil {
+ if basic, ok := array.tag.derived.(^ast.Basic_Directive);
+ ok && basic.name == "soa" {
+ return true
+ }
+ }
+ return false
+}
+
expr_contains_poly :: proc(expr: ^ast.Expr) -> bool {
if expr == nil {
return false