File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -267,10 +267,14 @@ static inline void skip_white(const char **pch)
267267 * pch = ch ;
268268}
269269
270+ /**
271+ * Advance `ch` past spaces/NULs until we hit a comment marker or the first
272+ * non-whitespace character. Leaves `ch` unchanged if already on content.
273+ */
270274static inline const char * skip_to_comment_or_nonwhite (const char * ch )
271275{
272276 while (ch < eof && (* ch == ' ' || * ch == '\t' || * ch == '\0' )) {
273- if (commentChar && * ch == commentChar ) break ;
277+ if (commentChar && * ch == commentChar ) break ; // comment char might be space or tab
274278 ch ++ ;
275279 }
276280 return ch ;
@@ -301,15 +305,17 @@ static inline bool eol(const char **pch)
301305 return eol_one_r && * * pch == '\r' ;
302306}
303307
304-
308+ /**
309+ * Walk to the start of the next line (or `eof` if none) by skipping the
310+ * current line's contents and its newline sequence.
311+ */
305312static inline const char * skip_line (const char * ch , const char * eof ) {
306313 while (ch < eof && * ch != '\n' && * ch != '\r' )
307314 ch ++ ;
308315 if (ch < eof && eol (& ch )) ch ++ ;
309316 return ch ;
310317}
311318
312-
313319/**
314320 * Return True iff `ch` is a valid field terminator character: either a field
315321 * separator or a newline.
You can’t perform that action at this time.
0 commit comments