diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-01-13 16:06:17 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-01-18 10:58:11 +0100 |
commit | 6c2caf9fbb9d346cfb20cd5c83875fdff77e584c (patch) | |
tree | 4d0fe816584e8f351ed0f1da8be0b9ccf1c5635f /types.c | |
parent | 725bb75b7b66dd1e0a381908e831cede0402cb6e (diff) |
source: refactor source file handling
- Move source object pointer into program entity which is referenced by
each function
- Move lineinfo related routines into source.c and use them from lexer.c
since lineinfo encoding does not belong into the lexical analyzer.
- Implement initial infrastructure for detecting source file type,
this is required later to differentiate between plaintext and
precompiled bytecode files
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'types.c')
-rw-r--r-- | types.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -248,7 +248,6 @@ ucv_free(uc_value_t *uv, bool retain) } uc_chunk_free(&function->chunk); - uc_source_put(function->source); break; case UC_CLOSURE: @@ -951,7 +950,7 @@ ucv_object_length(uc_value_t *uv) uc_value_t * -ucv_function_new(const char *name, size_t srcpos, uc_source_t *source, uc_program_t *program) +ucv_function_new(const char *name, size_t srcpos, uc_program_t *program) { size_t namelen = 0; uc_function_t *fn; @@ -969,7 +968,6 @@ ucv_function_new(const char *name, size_t srcpos, uc_source_t *source, uc_progra fn->nargs = 0; fn->nupvals = 0; fn->srcpos = srcpos; - fn->source = uc_source_get(source); fn->program = program; fn->vararg = false; |