summaryrefslogtreecommitdiffstatshomepage
path: root/py/emit.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-18 23:24:36 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-18 23:24:36 +0000
commit08335004cfe95048ee06134a3e49b9fb75639139 (patch)
tree7518a854012938fd70c57b3571a630a142b84f28 /py/emit.h
parentaefe79880f8c5f66132673ccc9be27d2ca29005b (diff)
downloadmicropython-08335004cfe95048ee06134a3e49b9fb75639139.tar.gz
micropython-08335004cfe95048ee06134a3e49b9fb75639139.zip
Add source file name and line number to error messages.
Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
Diffstat (limited to 'py/emit.h')
-rw-r--r--py/emit.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/py/emit.h b/py/emit.h
index fd41764d40..521b43cae2 100644
--- a/py/emit.h
+++ b/py/emit.h
@@ -23,6 +23,7 @@ typedef struct _emit_method_table_t {
bool (*last_emit_was_return_value)(emit_t *emit);
int (*get_stack_size)(emit_t *emit);
void (*set_stack_size)(emit_t *emit, int size);
+ void (*set_line_number)(emit_t *emit, int line);
void (*load_id)(emit_t *emit, qstr qstr);
void (*store_id)(emit_t *emit, qstr qstr);
@@ -119,7 +120,7 @@ extern const emit_method_table_t emit_native_thumb_method_table;
emit_t *emit_pass1_new(qstr qstr___class__);
void emit_pass1_free(emit_t *emit);
emit_t *emit_cpython_new(uint max_num_labels);
-emit_t *emit_bc_new(uint max_num_labels);
+emit_t *emit_bc_new(qstr source_file, uint max_num_labels);
emit_t *emit_native_x64_new(uint max_num_labels);
emit_t *emit_native_thumb_new(uint max_num_labels);