@@ -249,9 +249,9 @@ static inline bool is_space(char c) { return is(c, tag_space); }
249249/////////////////////////////////////////////////////////////////////
250250// PARSER COMBINATORS
251251
252−static inline char peekAt(document* d, int i) { return d->cursor[i]; }
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); }
253254static inline void skip(document* d, int i) { d->cursor += i; }
254−static inline char peek(document* d) { return peekAt(d, 0); }
255255static inline char get(document* d) { char c = peek(d); skip(d, 1); return c; }
256256
257257// Remove whitespace characters from the cursor while they are still whitespace
@@ -310,7 +310,7 @@ static inline void attr_alloc(attr_buffer* b, int ask)
310310 b->alloc = buf2;
311311}
312312
313−void set_error(document* d, char* msg)
313+void set_error(document* d, const char* msg)
314314{
315315 if (d->error_message != NULL) return; // keep the first error message
316316 d->error_message = malloc(strlen(msg)+1);