summaryrefslogtreecommitdiffstatshomepage
path: root/py/lexerunix.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-11-16 16:25:06 +1100
committerDamien George <damien.p.george@gmail.com>2016-11-16 18:13:51 +1100
commite5ef15a9d7bead2a60009caedbc128a8906c7ecd (patch)
tree6228f2f42be931bbb7d88f353d9c673be251afd8 /py/lexerunix.c
parent511c083811ca538753dfccc7c908048b2c23bea4 (diff)
downloadmicropython-e5ef15a9d7bead2a60009caedbc128a8906c7ecd.tar.gz
micropython-e5ef15a9d7bead2a60009caedbc128a8906c7ecd.zip
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.
Diffstat (limited to 'py/lexerunix.c')
-rw-r--r--py/lexerunix.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/py/lexerunix.c b/py/lexerunix.c
index e8f8994a6c..9e3755e761 100644
--- a/py/lexerunix.c
+++ b/py/lexerunix.c
@@ -85,12 +85,4 @@ mp_lexer_t *mp_lexer_new_from_fd(qstr filename, int fd, bool close_fd) {
return mp_lexer_new(filename, fb, (mp_lexer_stream_next_byte_t)file_buf_next_byte, (mp_lexer_stream_close_t)file_buf_close);
}
-mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
- int fd = open(filename, O_RDONLY);
- if (fd < 0) {
- return NULL;
- }
- return mp_lexer_new_from_fd(qstr_from_str(filename), fd, true);
-}
-
#endif // MICROPY_HELPER_LEXER_UNIX