diff options
Diffstat (limited to 'unix')
-rw-r--r-- | unix/file.c | 1 | ||||
-rw-r--r-- | unix/main.c | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/unix/file.c b/unix/file.c index eef3378d80..e15e82775c 100644 --- a/unix/file.c +++ b/unix/file.c @@ -91,6 +91,7 @@ static mp_obj_t fdfile_make_new(mp_obj_t type_in, int n_args, const mp_obj_t *ar static const mp_method_t rawfile_type_methods[] = { { "read", &mp_stream_read_obj }, { "readall", &mp_stream_readall_obj }, + { "readline", &mp_stream_unbuffered_readline_obj}, { "write", &mp_stream_write_obj }, { "close", &fdfile_close_obj }, { NULL, NULL }, diff --git a/unix/main.c b/unix/main.c index e96ee28464..d89f39da70 100644 --- a/unix/main.c +++ b/unix/main.c @@ -37,14 +37,20 @@ static void execute_from_lexer(mp_lexer_t *lex, mp_parse_input_kind_t input_kind return; } - mp_parse_node_t pn = mp_parse(lex, input_kind); - mp_lexer_free(lex); + qstr parse_exc_id; + const char *parse_exc_msg; + mp_parse_node_t pn = mp_parse(lex, input_kind, &parse_exc_id, &parse_exc_msg); if (pn == MP_PARSE_NODE_NULL) { // parse error + mp_lexer_show_error_pythonic_prefix(lex); + printf("%s: %s\n", qstr_str(parse_exc_id), parse_exc_msg); + mp_lexer_free(lex); return; } + mp_lexer_free(lex); + //printf("----------------\n"); //parse_node_show(pn, 0); //printf("----------------\n"); |