diff options
author | Damien George <damien.p.george@gmail.com> | 2014-02-05 23:57:48 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-02-05 23:57:48 +0000 |
commit | e09ffa1400cf4a9283041833fc56b848a87a4c6c (patch) | |
tree | eff1aa442b8705039aea33cc75075c9171f11593 /py/lexer.h | |
parent | cdcb4906d41f42789f6610047e8ae6aa79a61e47 (diff) |
Search paths properly on import and execute __init__.py if it exists.
Diffstat (limited to 'py/lexer.h')
-rw-r--r-- | py/lexer.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/py/lexer.h b/py/lexer.h index 13fbfb5d3..f41c962e7 100644 --- a/py/lexer.h +++ b/py/lexer.h @@ -136,5 +136,17 @@ bool mp_lexer_is_kind(mp_lexer_t *lex, mp_token_kind_t kind); bool mp_lexer_show_error_pythonic_prefix(mp_lexer_t *lex); bool mp_lexer_show_error_pythonic(mp_lexer_t *lex, const char *msg); -// used to import a module; must be implemented for a specific port -mp_lexer_t *mp_import_open_file(qstr mod_name); +/******************************************************************/ +// platform specific import function; must be implemented for a specific port +// TODO tidy up, rename, or put elsewhere + +//mp_lexer_t *mp_import_open_file(qstr mod_name); + +typedef enum { + MP_IMPORT_STAT_NO_EXIST, + MP_IMPORT_STAT_DIR, + MP_IMPORT_STAT_FILE, +} mp_import_stat_t; + +mp_import_stat_t mp_import_stat(const char *path); +mp_lexer_t *mp_lexer_new_from_file(const char *filename); |