diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-11-21 22:09:35 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-11-21 22:09:35 -0800 |
commit | a3a7c4879998f434e6bc5667ad9943f7f9e6aa74 (patch) | |
tree | 86e67a808599af834757cd42c16c80385796597f /tokenizer.h | |
parent | f545fb2491d36e02dc6c4005ada86be8678bba78 (diff) |
Modify tokenizer to store last token in a wcstring
Diffstat (limited to 'tokenizer.h')
-rw-r--r-- | tokenizer.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tokenizer.h b/tokenizer.h index 4d4deacc..7c2b71dc 100644 --- a/tokenizer.h +++ b/tokenizer.h @@ -10,6 +10,7 @@ #define FISH_TOKENIZER_H #include <wchar.h> +#include "common.h" /** Token types @@ -72,13 +73,12 @@ struct tokenizer_t const wchar_t *buff; /** A copy of the original string */ const wchar_t *orig_buff; - /** A pointer to the last token*/ - wchar_t *last; + /** The last token */ + wcstring last_token; /** Type of last token*/ int last_type; - /** Length of last token*/ - size_t last_len; + /** Offset of last token*/ size_t last_pos; /** Whether there are more tokens*/ @@ -128,7 +128,7 @@ int tok_last_type(tokenizer_t *tok); /** Returns the last token string. The string should not be freed by the caller. */ -wchar_t *tok_last(tokenizer_t *tok); +const wchar_t *tok_last(tokenizer_t *tok); /** Returns the type of quote from the last TOK_QSTRING |