From a7e1e7a17fa4e0162af70535ed1c28d5e65143f7 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sun, 24 Jan 2010 14:36:02 +0100 Subject: [PATCH] isl_stream_next_token: skip comment lines --- isl_stream.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/isl_stream.c b/isl_stream.c index be5eee2..d22d3fa 100644 --- a/isl_stream.c +++ b/isl_stream.c @@ -157,10 +157,17 @@ struct isl_token *isl_stream_next_token(struct isl_stream *s) s->len = 0; - /* skip spaces */ - while ((c = isl_stream_getc(s)) != -1 && isspace(c)) - /* nothing */ - ; + /* skip spaces and comment lines */ + while ((c = isl_stream_getc(s)) != -1) { + if (c == '#') { + while ((c = isl_stream_getc(s)) != -1 && c != '\n') + /* nothing */ + ; + if (c == -1) + break; + } else if (!isspace(c)) + break; + } line = s->line; col = s->col; -- 2.7.4