Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static XMLTNGToken * handle_state_data(XMLTNGToker *toker) {
- char *p = [toker currentPosition];
- char *start = p;
- char *end = [toker endPosition];
- bool eof = false;
- XMLTNGToken *token;
- if (*p == '<') {
- return parse_markup(toker);
- }
- if ((p = memchr(p, '<', end - p)) == NULL) {
- eof = true;
- p = end;
- }
- if (eof) {
- //points past the document on purpose
- [toker setCurrentPosition:p + 1];
- } else {
- //we want the current position sitting at the <
- [toker setCurrentPosition:p];
- }
- return [XMLTNGTokenCharacters tokenForCharacters:start length:p - start];
- }
Add Comment
Please, Sign In to add comment