aboutsummaryrefslogtreecommitdiff
path: root/src/compile/text.h
blob: 510c3ed1d4ae5080452b6275a62c26fffb321c56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// This file defines how to compile text

#pragma once

#include "../ast.h"
#include "../environment.h"
#include "../stdlib/datatypes.h"
#include "../stdlib/text.h"
#include "../util.h"
#include "../types.h"

Text_t compile_text_ast(env_t *env, ast_t *ast);
Text_t compile_text(env_t *env, ast_t *ast, Text_t color);
Text_t compile_text_literal(Text_t literal);
Text_t expr_as_text(Text_t expr, type_t *t, Text_t color);

MACROLIKE Text_t quoted_str(const char *str) { return Text$quoted(Text$from_str(str), false, Text("\"")); }
MACROLIKE Text_t quoted_text(Text_t text) { return Text$quoted(text, false, Text("\"")); }