[tokenization] Exposing some of the scanner's methods in header for use in the Python scanner so it can avoid the additional allocation

This commit is contained in:
Al
2015-03-17 18:38:30 -04:00
parent daf3f8706b
commit f794ef7222
3 changed files with 29 additions and 11 deletions

View File

@@ -8,6 +8,14 @@ extern "C" {
#include "token_types.h"
#include "tokens.h"
typedef struct scanner {
unsigned char *src, *cursor, *start, *end;
} scanner_t;
int scan_token(scanner_t *s);
inline scanner_t scanner_from_string(const char *input);
tokenized_string_t *tokenize(const char *str);