aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-02 20:22:13 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-02 20:22:13 -0400
commit620ebeab8d6040c20c3278acebeafd02a67057a5 (patch)
tree63d9cd54d41d74b2b3f5b870967d3ad2933e5e08 /compile.c
parent337aa911a9027602d47cd56ddbfcde0230a48943 (diff)
Fixing string methods
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 35c5f8f9..a4972b14 100644
--- a/compile.c
+++ b/compile.c
@@ -2679,6 +2679,8 @@ CORD compile(env_t *env, ast_t *ast)
if (lang && streq(f->field, "text_content")) {
CORD text = compile_to_pointer_depth(env, f->fielded, 0, false);
return CORD_all("((Text_t)", text, ")");
+ } else if (streq(f->field, "length")) {
+ return CORD_all("Int64_to_Int((", compile_to_pointer_depth(env, f->fielded, 0, false), ").length)");
}
code_err(ast, "There is no '%s' field on %T values", f->field, value_t);
}