aboutsummaryrefslogtreecommitdiffhomepage
path: root/tokenizer.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-10-06 13:08:57 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-10-06 13:08:57 -0700
commitdd91779442125ca46a434cd94cc51ae32e43bee1 (patch)
treee023ebb7a8a0e6f9c6c4a394158773ced0c98a82 /tokenizer.h
parente58b73179f4727c79465c6f273aef377b9bb8bee (diff)
parentfab7299d49492ce548d4ceed66d3acbd05dd99c7 (diff)
Merge branch 'master' into ast_no_templates
Conflicts: configure.ac exec.cpp
Diffstat (limited to 'tokenizer.h')
-rw-r--r--tokenizer.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/tokenizer.h b/tokenizer.h
index 0f3ff369..dec206a5 100644
--- a/tokenizer.h
+++ b/tokenizer.h
@@ -76,7 +76,7 @@ struct tokenizer_t
wcstring last_token;
/** Type of last token*/
- int last_type;
+ enum token_type last_type;
/** Offset of last token*/
size_t last_pos;
@@ -122,7 +122,7 @@ void tok_next(tokenizer_t *tok);
/**
Returns the type of the last token. Must be one of the values in the token_type enum.
*/
-int tok_last_type(tokenizer_t *tok);
+enum token_type tok_last_type(tokenizer_t *tok);
/**
Returns the last token string. The string should not be freed by the caller.
@@ -147,12 +147,14 @@ int tok_get_pos(const tokenizer_t *tok);
/** Returns the extent of the current token */
size_t tok_get_extent(const tokenizer_t *tok);
+/** Returns the token type after the current one, without adjusting the position. Optionally returns the next string by reference. */
+enum token_type tok_peek_next(tokenizer_t *tok, wcstring *out_next_string);
+
/**
Returns the original string to tokenizer
*/
const wchar_t *tok_string(tokenizer_t *tok);
-
/**
Returns only the first token from the specified string. This is a
convenience function, used to retrieve the first token of a