2013-10-20 12:42:00 -04:00
|
|
|
typedef struct _py_lexer_str_buf_t {
|
|
|
|
bool free; // free src_beg when done
|
|
|
|
const char *src_beg; // beginning of source
|
|
|
|
const char *src_cur; // current location in source
|
|
|
|
const char *src_end; // end (exclusive) of source
|
2013-12-21 13:17:45 -05:00
|
|
|
} mp_lexer_str_buf_t;
|
2013-10-20 12:42:00 -04:00
|
|
|
|
|
|
|
typedef struct _py_lexer_file_buf_t {
|
|
|
|
FIL fp;
|
|
|
|
char buf[20];
|
|
|
|
uint16_t len;
|
|
|
|
uint16_t pos;
|
2013-12-21 13:17:45 -05:00
|
|
|
} mp_lexer_file_buf_t;
|
2013-10-20 12:42:00 -04:00
|
|
|
|
2013-12-21 13:17:45 -05:00
|
|
|
mp_lexer_t *mp_lexer_new_from_str_len(const char *src_name, const char *str, uint len, bool free_str, mp_lexer_str_buf_t *sb);
|
|
|
|
mp_lexer_t *mp_lexer_new_from_file(const char *filename, mp_lexer_file_buf_t *fb);
|