on master help sign in
#7, rename peekAt to peek_at, for consistency
commit539ba4e517377232728ed68dea79e2ef02ec6acd authorNeil Mitchell <ndmitchell@gmail.com> dateThu 15 Dec 2016, 08:29 (10 years ago) parente06e524
1 file changed+8−8
cbits/hexml.c+8−8
cbits/hexml.c+8−8
@@ -249,8 +249,8 @@ static inline bool is_space(char c) { return is(c, tag_space); }
249249/////////////////////////////////////////////////////////////////////
250250// PARSER COMBINATORS
251251
252−static inline char peekAt(const document* d, int i) { return d->cursor[i]; }
253−static inline char peek(const document* d) { return peekAt(d, 0); }
252+static inline char peek_at(const document* d, int i) { return d->cursor[i]; }
253+static inline char peek(const document* d) { return peek_at(d, 0); }
254254static inline void skip(document* d, int i) { d->cursor += i; }
255255static inline char get(document* d) { char c = peek(d); skip(d, 1); return c; }
256256
@@ -405,7 +405,7 @@ static inline void parse_tag(document* d)
405405 if (d->error_message != NULL) return;
406406
407407 c = peek(d);
408− if ((c == '/' || c == '?') && peekAt(d, 1) == '>')
408+ if ((c == '/' || c == '?') && peek_at(d, 1) == '>')
409409 {
410410 skip(d, 2);
411411 me->nodes = start_length(0, 0);
@@ -429,7 +429,7 @@ static inline void parse_tag(document* d)
429429 me->inner.length = start_end(me->inner.start, doc_position(d)).length;
430430
431431 if (d->error_message != NULL) return;
432− if (peek(d) == '<' && peekAt(d, 1) == '/')
432+ if (peek(d) == '<' && peek_at(d, 1) == '/')
433433 {
434434 skip(d, 2);
435435 if (d->end - d->cursor >= me->name.length &&
@@ -461,16 +461,16 @@ static str parse_content(document* d)
461461 {
462462 break;
463463 }
464− else if (peekAt(d, 1) == '/')
464+ else if (peek_at(d, 1) == '/')
465465 {
466466 // have found a </
467467 break;
468468 }
469− else if (peekAt(d, 1) == '!' && peekAt(d, 2) == '-' && peekAt(d, 3) == '-')
469+ else if (peek_at(d, 1) == '!' && peek_at(d, 2) == '-' && peek_at(d, 3) == '-')
470470 {
471471 skip(d, 3);
472472 // you can't reuse the two '-' characters for the closing as well
473− if (peekAt(d, 0) == '\0' || peekAt(d, 1) == '\0')
473+ if (peek_at(d, 0) == '\0' || peek_at(d, 1) == '\0')
474474 {
475475 set_error(d, "Didn't get a closing comment");
476476 return start_end(0, 0);
@@ -484,7 +484,7 @@ static str parse_content(document* d)
484484 return start_end(0, 0);
485485 }
486486 skip(d, 1);
487− if (peekAt(d, -3) == '-' && peekAt(d, -2))
487+ if (peek_at(d, -3) == '-' && peek_at(d, -2))
488488 break;
489489 }
490490 }