aboutsummaryrefslogtreecommitdiff
path: root/stm/lexerstm.h
diff options
context:
space:
mode:
authorDamien2013-10-20 17:42:00 +0100
committerDamien2013-10-20 17:42:00 +0100
commitfa2162bc77b22fd135fd059219191ac91449b3fa (patch)
tree07f29c54a32a3b3650917cd22a99184f1aa242e0 /stm/lexerstm.h
parent27fb45eb1c95f9cc02f4ed1b9d573ece0d4c1a18 (diff)
Integrate new lexer stream with stm framework.
Diffstat (limited to 'stm/lexerstm.h')
-rw-r--r--stm/lexerstm.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/stm/lexerstm.h b/stm/lexerstm.h
new file mode 100644
index 000000000..f57d1faa9
--- /dev/null
+++ b/stm/lexerstm.h
@@ -0,0 +1,16 @@
+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
+} py_lexer_str_buf_t;
+
+typedef struct _py_lexer_file_buf_t {
+ FIL fp;
+ char buf[20];
+ uint16_t len;
+ uint16_t pos;
+} py_lexer_file_buf_t;
+
+py_lexer_t *py_lexer_new_from_str_len(const char *src_name, const char *str, uint len, bool free_str, py_lexer_str_buf_t *sb);
+py_lexer_t *py_lexer_new_from_file(const char *filename, py_lexer_file_buf_t *fb);