aboutsummaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-19 14:29:58 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-19 14:29:58 -0400
commit934b843b1ce4744f8f21b7c590f0e1f31c94f604 (patch)
tree5ca8d6f2a6c1055b8c2aa6e01f45b8e1e435aeff /types.c
parentea6f9797be2b6c1f65cf3b5594f8fb062ba92e9e (diff)
Add .text_content as a field on DSLs instead of a method
Diffstat (limited to 'types.c')
-rw-r--r--types.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/types.c b/types.c
index 8cb534d7..a1935616 100644
--- a/types.c
+++ b/types.c
@@ -586,6 +586,11 @@ type_t *get_field_type(type_t *t, const char *field_name)
switch (t->tag) {
case PointerType:
return get_field_type(Match(t, PointerType)->pointed, field_name);
+ case TextType: {
+ if (Match(t, TextType)->lang && streq(field_name, "text_content"))
+ return Type(TextType);
+ return NULL;
+ }
case StructType: {
auto struct_t = Match(t, StructType);
for (arg_t *field = struct_t->fields; field; field = field->next) {