aboutsummaryrefslogtreecommitdiff
path: root/src/compile/statements.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-08-24 17:13:48 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-08-24 17:13:48 -0400
commit2245c883680ccfbe545f230d6b68c38ce54bceb6 (patch)
tree2a861d7482bcf0f30c07483e6adc287f83e8090a /src/compile/statements.c
parent476bacc27671de92e8fdbc5b2a904bbf8bc80377 (diff)
Shift some code around.
Diffstat (limited to 'src/compile/statements.c')
-rw-r--r--src/compile/statements.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compile/statements.c b/src/compile/statements.c
index 8649b978..ee70fdea 100644
--- a/src/compile/statements.c
+++ b/src/compile/statements.c
@@ -23,6 +23,13 @@
typedef ast_t *(*comprehension_body_t)(ast_t *, ast_t *);
public
+Text_t with_source_info(env_t *env, ast_t *ast, Text_t code) {
+ if (code.length == 0 || !ast || !ast->file || !env->do_source_mapping) return code;
+ int64_t line = get_line_number(ast->file, ast->start);
+ return Texts("\n#line ", String(line), "\n", code);
+}
+
+public
Text_t compile_inline_block(env_t *env, ast_t *ast) {
if (ast->tag != Block) return compile_statement(env, ast);