ItemizeItem ItemizeTokenizer::next() { ItemizeItem li; while (*i != '\0' && (asc_isspace(*i) || *i == ',')) ++i; if (*i == '\0') return li; li.action = *i; if (*i == '+' || *i == '-') { ++i; } else if (*i == '!') { li.name = ""; ++i; return li; } else { li.action = '+'; } while (*i != '\0' && *i != ',' && asc_isspace(*i)) ++i; if (*i == '\0' || *i == ',') return next(); li.name = i; while (*i != '\0' && *i != ',') ++i; while (i != list && asc_isspace(*(i-1))) --i; if (*i != '\0') { *i = '\0'; ++i; } return li; }
// Note this writes all over str static void split_string_list(StringList & list, ParmString str) { const char * s0 = str; const char * s1; while (true) { while (*s0 != '\0' && asc_isspace(*s0)) ++s0; if (*s0 == '\0') break; s1 = s0; while (!asc_isspace(*s1)) ++s1; String temp(s0,s1-s0); list.add(temp); if (*s1 != '\0') s0 = s1 + 1; } }
bool CheckerString::next_misspelling() { if (off_end(cur_line_)) return false; if (has_repl_) { has_repl_ = false; CharVector word; bool correct = false; // FIXME: This is a hack to avoid trying to check a word with a space // in it. The correct action is to reparse to string and // check each word individually. However doing so involves // an API enhancement in Checker. for (int i = 0; i != real_word_size_; ++i) { if (asc_isspace(*(real_word_begin_ + i))) correct = true; } if (!correct) correct = aspell_speller_check(speller_, &*real_word_begin_, real_word_size_); diff_ += real_word_size_ - tok_.len; tok_.len = real_word_size_; if (!correct) return true; } while ((tok_ = checker_->next_misspelling()).len == 0) { next_line(cur_line_); diff_ = 0; if (off_end(cur_line_)) return false; checker_->process(cur_line_->real.data(), cur_line_->real.size()); } real_word_begin_ = cur_line_->real.begin() + tok_.offset + diff_; real_word_size_ = tok_.len; fix_display_str(); return true; }