py/lexer: Provide generic mp_lexer_new_from_file based on mp_reader.
If a port defines MICROPY_READER_POSIX or MICROPY_READER_FATFS then lexer.c now provides an implementation of mp_lexer_new_from_file using the mp_reader_new_file function.
This commit is contained in:
@@ -109,17 +109,13 @@ void user_init(void) {
|
||||
system_init_done_cb(init_done);
|
||||
}
|
||||
|
||||
mp_lexer_t *fat_vfs_lexer_new_from_file(const char *filename);
|
||||
mp_import_stat_t fat_vfs_import_stat(const char *path);
|
||||
|
||||
#if !MICROPY_VFS_FAT
|
||||
mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
|
||||
#if MICROPY_VFS_FAT
|
||||
return fat_vfs_lexer_new_from_file(filename);
|
||||
#else
|
||||
(void)filename;
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
mp_import_stat_t mp_import_stat(const char *path) {
|
||||
#if MICROPY_VFS_FAT
|
||||
|
||||
Reference in New Issue
Block a user