aboutsummaryrefslogtreecommitdiff
path: root/src/repl.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-03 15:19:59 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-03 15:19:59 -0400
commit8d173710fe8cfd96bd54f9dd1cf0eccacfdd6e73 (patch)
treee93cf2ad599ed1378366303d1162a60fec5090db /src/repl.c
parentcedae3039c8d67568b5ac35833c10cbfc1c7cb23 (diff)
Deprecate heap_strf
Diffstat (limited to 'src/repl.c')
-rw-r--r--src/repl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/repl.c b/src/repl.c
index ae12427a..2f5c60f6 100644
--- a/src/repl.c
+++ b/src/repl.c
@@ -63,14 +63,14 @@ void repl(void)
code = GC_strdup(line);
while ((len=getline(&line, &buf_size, stdin)) >= 0) {
if (len == 1) break;
- code = heap_strf("%s%s", code, line);
+ code = String(code, line);
printf("\x1b[33;1m..\x1b[m ");
fflush(stdout);
}
} else {
- code = heap_strf("func main(): >> %s", code);
+ code = String("func main(): >> ", code);
}
- ast_t *ast = parse_file(heap_strf("<code>%s", code), &on_err);
+ ast_t *ast = parse_file(String("<code>", code), &on_err);
ast_t *doctest = Match(Match(Match(ast, Block)->statements->ast, FunctionDef)->body, Block)->statements->ast;
if (doctest->tag == DocTest) doctest->__data.DocTest.skip_source = 1;
run(env, doctest);