aboutsummaryrefslogtreecommitdiff
path: root/src/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-07 00:04:48 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-07 00:04:48 -0400
commit3554c56b209a1544c69e189ddab3b19b4bf80ae6 (patch)
tree9d494e7b7ec4da3bad49c516b35e98a5829bb81c /src/compile.c
parent4afc7125ab42437e41508d9953a97333f6f87362 (diff)
Add easter egg: `~colorized`
Diffstat (limited to 'src/compile.c')
-rw-r--r--src/compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compile.c b/src/compile.c
index 6cb25de0..40d9ed4e 100644
--- a/src/compile.c
+++ b/src/compile.c
@@ -2775,6 +2775,7 @@ CORD compile(env_t *env, ast_t *ast)
}
case TextJoin: {
const char *lang = Match(ast, TextJoin)->lang;
+ const char *colorize = Match(ast, TextJoin)->colorize ? "yes" : "no";
type_t *text_t = lang ? Table$str_get(*env->types, lang) : TEXT_TYPE;
if (!text_t || text_t->tag != TextType)
@@ -2811,7 +2812,7 @@ CORD compile(env_t *env, ast_t *ast)
if (chunk_t->tag == TextType)
chunk_code = compile(env, chunk->ast);
else
- chunk_code = compile_string(env, chunk->ast, "no");
+ chunk_code = compile_string(env, chunk->ast, colorize);
} else {
code_err(chunk->ast, "I don't know how to convert ", type_to_str(chunk_t), " to ", type_to_str(text_t));
}