diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2015-07-26 00:12:36 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2015-07-26 00:12:36 -0700 |
commit | 4ebaa7b6bd595f37f66f8d77ee836c1e5a4ef647 (patch) | |
tree | ef3a2396c6307afb54697126a5c17f02c35835f4 /src/reader.cpp | |
parent | 618896c0436e6ca70feb2fa317b34171cc4e1a81 (diff) |
Continue migration to the new tokenizer interface
Diffstat (limited to 'src/reader.cpp')
-rw-r--r-- | src/reader.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/reader.cpp b/src/reader.cpp index 5828aba1..0ee2746c 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -2336,7 +2336,7 @@ static void handle_token_history(int forward, int reset) switch (token.type) { case TOK_STRING: - { + { if (token.text.find(data->search_buff) != wcstring::npos) { //debug( 3, L"Found token at pos %d\n", tok_get_pos( &tok ) ); @@ -3087,14 +3087,13 @@ static wchar_t unescaped_quote(const wcstring &str, size_t pos) /* Returns true if the last token is a comment. */ static bool text_ends_in_comment(const wcstring &text) { - token_type last_type = TOK_NONE; tokenizer_t tok(text.c_str(), TOK_ACCEPT_UNFINISHED | TOK_SHOW_COMMENTS | TOK_SQUASH_ERRORS); - while (tok_has_next(&tok)) + tok_t token; + while (tok.next(&token)) { - last_type = tok_last_type(&tok); - tok_next(&tok); + // pass } - return last_type == TOK_COMMENT; + return token.type == TOK_COMMENT; } const wchar_t *reader_readline(int nchars) |