aboutsummaryrefslogtreecommitdiff
path: root/src/compile/statements.c
diff options
context:
space:
mode:
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);