aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compile.c2
-rw-r--r--docs/langs.md2
-rw-r--r--examples/base64/base64.tm4
-rw-r--r--examples/ini/ini.tm2
-rw-r--r--examples/tomodeps/tomodeps.tm4
-rw-r--r--examples/wrap/wrap.tm2
-rw-r--r--test/lang.tm2
-rw-r--r--types.c2
8 files changed, 10 insertions, 10 deletions
diff --git a/compile.c b/compile.c
index 7331483b..ddba6774 100644
--- a/compile.c
+++ b/compile.c
@@ -3722,7 +3722,7 @@ CORD compile(env_t *env, ast_t *ast)
}
case TextType: {
const char *lang = Match(value_t, TextType)->lang;
- if (lang && streq(f->field, "text_content")) {
+ if (lang && streq(f->field, "text")) {
CORD text = compile_to_pointer_depth(env, f->fielded, 0, false);
return CORD_all("((Text_t)", text, ")");
} else if (streq(f->field, "length")) {
diff --git a/docs/langs.md b/docs/langs.md
index 96c026f1..ed5e3496 100644
--- a/docs/langs.md
+++ b/docs/langs.md
@@ -36,7 +36,7 @@ page := $HTML"
Hello $username! How are you?
</body></html>
"
-say(page.text_content)
+say(page.text)
```
What we _don't_ want to happen is to get a page that looks like:
diff --git a/examples/base64/base64.tm b/examples/base64/base64.tm
index 6979b157..4e4cc8b1 100644
--- a/examples/base64/base64.tm
+++ b/examples/base64/base64.tm
@@ -65,7 +65,7 @@ lang Base64:
return Text.from_bytes(b64:decode_bytes() or return none)
func decode_bytes(b64:Base64 -> [Byte]?):
- bytes := b64.text_content:bytes()
+ bytes := b64.text:bytes()
output := &[Byte(0) for _ in bytes.length/4 * 3]
src := Int64(1)
dest := Int64(1)
@@ -94,4 +94,4 @@ func main(input=(/dev/stdin), decode=no):
say(b:decode_text()!)
else:
text := input:read()!
- say(Base64.parse(text)!.text_content)
+ say(Base64.parse(text)!.text)
diff --git a/examples/ini/ini.tm b/examples/ini/ini.tm
index 46c25860..9b27e8cb 100644
--- a/examples/ini/ini.tm
+++ b/examples/ini/ini.tm
@@ -7,7 +7,7 @@ _HELP := "
"
func parse_ini(path:Path -> {Text,{Text,Text}}):
- text := path:read() or exit("Could not read INI file: $\[31;1]$(path.text_content)$\[]")
+ text := path:read() or exit("Could not read INI file: $\[31;1]$(path.text)$\[]")
sections := @{:Text,@{Text,Text}}
current_section := @{:Text,Text}
diff --git a/examples/tomodeps/tomodeps.tm b/examples/tomodeps/tomodeps.tm
index 3ff48f98..48c026e9 100644
--- a/examples/tomodeps/tomodeps.tm
+++ b/examples/tomodeps/tomodeps.tm
@@ -66,9 +66,9 @@ func _printable_name(dep:Dependency -> Text):
is File(f):
f = f:relative()
if f:exists():
- return "$(f.text_content)"
+ return "$(f.text)"
else:
- return "$(\x1b)[31;1m$(f.text_content) (not found)$(\x1b)[m"
+ return "$(\x1b)[31;1m$(f.text) (not found)$(\x1b)[m"
func _draw_tree(dep:Dependency, dependencies:{Dependency,{Dependency}}, already_printed:@{Dependency}, prefix="", is_last=yes):
if already_printed:has(dep):
diff --git a/examples/wrap/wrap.tm b/examples/wrap/wrap.tm
index b6cf1403..94d752bd 100644
--- a/examples/wrap/wrap.tm
+++ b/examples/wrap/wrap.tm
@@ -82,7 +82,7 @@ func main(files:[Path], width=80, inplace=no, min_split=3, rewrap=yes, hyphen=UN
files = [(/dev/stdin)]
for file in files:
- text := file:read() or exit("Could not read file: $(file.text_content)")
+ text := file:read() or exit("Could not read file: $(file.text)")
if rewrap:
text = unwrap(text)
diff --git a/test/lang.tm b/test/lang.tm
index 5d8c619e..777a05b3 100644
--- a/test/lang.tm
+++ b/test/lang.tm
@@ -28,7 +28,7 @@ func main():
>> HTML.HEADER[1]
= $HTML"<"
- >> HTML.HEADER.text_content
+ >> HTML.HEADER.text
= "<!DOCTYPE HTML>"
>> user := "I <3 hax"
diff --git a/types.c b/types.c
index cee1db9b..3b0fd9b0 100644
--- a/types.c
+++ b/types.c
@@ -639,7 +639,7 @@ type_t *get_field_type(type_t *t, const char *field_name)
case PointerType:
return get_field_type(Match(t, PointerType)->pointed, field_name);
case TextType: {
- if (Match(t, TextType)->lang && streq(field_name, "text_content"))
+ if (Match(t, TextType)->lang && streq(field_name, "text"))
return Type(TextType);
else if (streq(field_name, "length")) return INT_TYPE;
return NULL;