reorganized moo_duputobcstr(), moo_dupbtoucstr(), moo_dupbtouchars(), moo_duputobchars().

renamed add_io_name() to moo_addcioname().
changed input_handler in std.c to set arg->name when opening a file with moo_addcioname().
shortened dbginfo to dbgi.
enhanced the compiler to record the class location in dbgi
This commit is contained in:
hyunghwan.chung
2019-07-10 09:19:38 +00:00
parent b4c6e6a9de
commit b3eb804f87
12 changed files with 251 additions and 223 deletions

View File

@ -595,6 +595,8 @@ struct moo_cunit_class_t
moo_oow_t initv_count;
} var[3];
moo_oow_t dbgi_class_offset;
moo_pooldic_import_data_t pdimp;
moo_method_data_t mth;
};
@ -620,6 +622,7 @@ struct moo_compiler_t
/* input handler */
moo_ioimpl_t impl;
moo_ooch_t* iid; /* input id that represents the current main input file */
/* information about the last meaningful character read.
* this is a copy of curinp->lxc if no ungetting is performed.
@ -1658,18 +1661,26 @@ moo_pfrc_t moo_pf_utf8_seqlen (moo_t* moo, moo_mod_t* mod, moo_ooi_t nargs);
moo_pfrc_t moo_pf_utf8_to_uc (moo_t* moo, moo_mod_t* mod, moo_ooi_t nargs);
moo_pfrc_t moo_pf_uc_to_utf8 (moo_t* moo, moo_mod_t* mod, moo_ooi_t nargs);
/* TODO: remove the following debugging functions */
/* ========================================================================= */
/* debug.c */
/* ========================================================================= */
/* TODO: remove the following dump functions */
void moo_dumpsymtab (moo_t* moo);
void moo_dumpdic (moo_t* moo, moo_oop_dic_t dic, const moo_bch_t* title);
int moo_addfiletodbginfo (moo_t* moo, const moo_ooch_t* file_name, moo_oow_t* start_offset);
int moo_addclasstodbginfo (moo_t* moo, const moo_ooch_t* class_name, moo_oow_t file_offset, moo_oow_t file_line, moo_oow_t* start_offset);
int moo_addmethodtodbginfo (moo_t* moo, moo_oow_t file_offset, moo_oow_t class_offset, const moo_ooch_t* method_name, const moo_oow_t* code_loc_ptr, moo_oow_t code_loc_len, moo_oow_t* start_offset);
int moo_addfiletodbgi (moo_t* moo, const moo_ooch_t* file_name, moo_oow_t* start_offset);
int moo_addclasstodbgi (moo_t* moo, const moo_ooch_t* class_name, moo_oow_t file_offset, moo_oow_t file_line, moo_oow_t* start_offset);
int moo_addmethodtodbgi (moo_t* moo, moo_oow_t file_offset, moo_oow_t class_offset, const moo_ooch_t* method_name, const moo_oow_t* code_loc_ptr, moo_oow_t code_loc_len, moo_oow_t* start_offset);
/* ========================================================================= */
/* comp.c */
/* ========================================================================= */
#if defined(MOO_INCLUDE_COMPILER)
const moo_ooch_t* moo_addcioname (moo_t* moo, const moo_oocs_t* name);
#endif
#if defined(__cplusplus)
}
#endif