int Sexp::next_token(char **begin, const char *end, const char n) { char c = 0; do { c = **begin; ++(*begin); } while (isspace(c)); if (*begin >= end) { return -1; } if (c == n) { return 1; } else { --(*begin); return 0; } }
void Sexp::comment(char **begin, const char *end) { const int r = next_token(begin, end, ';'); if (r == 1) { while (*begin < end) { const char c = **begin; ++(*begin); if (c == '\r' || c == '\n') { break; } } return comment(begin, end); } }
扬帆大鱼
相关分类