aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-12-26 17:31:33 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-12-26 17:31:33 -0500
commitacd3f2d39edb2cc306632a19a1eb4b7b0ba02836 (patch)
tree60a05a85ee2ff987991da84666ba941edde3f3af /typecheck.c
parent32cbf7b7c8d9634863af6be9defc8a02c780ff82 (diff)
Add text indexing
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/typecheck.c b/typecheck.c
index 2b5dd701..0bca1e3a 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -779,6 +779,8 @@ type_t *get_type(env_t *env, ast_t *ast)
return Type(OptionalType, table_type->value_type);
else
code_err(indexing->indexed, "This type doesn't have a value type or a default value");
+ } else if (value_t->tag == TextType) {
+ return value_t;
} else {
code_err(ast, "I don't know how to index %T values", indexed_t);
}