Work towards refactoring tokenizer to be a real object

This commit is contained in:
ridiculousfish
2012-11-21 17:48:35 -08:00
parent e73be48d96
commit f545fb2491
12 changed files with 123 additions and 169 deletions

View File

@@ -143,7 +143,6 @@ static void write_part(const wchar_t *begin,
int cut_at_cursor,
int tokenize)
{
tokenizer tok;
wcstring out;
wchar_t *buff;
size_t pos;
@@ -155,9 +154,8 @@ static void write_part(const wchar_t *begin,
buff = wcsndup(begin, end-begin);
// fwprintf( stderr, L"Subshell: %ls, end char %lc\n", buff, *end );
out.clear();
for (tok_init(&tok, buff, TOK_ACCEPT_UNFINISHED);
tok_has_next(&tok);
tokenizer_t tok(buff, TOK_ACCEPT_UNFINISHED);
for (; tok_has_next(&tok);
tok_next(&tok))
{
if ((cut_at_cursor) &&