From 7a30f71c2409ee5162ba3fbadf29b2f36532c04b Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 19 Feb 2010 13:12:10 +0100 Subject: [PATCH] isl_stream: read "definition" token ":=" --- isl_stream.c | 15 ++++++++++++++- isl_stream.h | 3 ++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/isl_stream.c b/isl_stream.c index f88727a..650b115 100644 --- a/isl_stream.c +++ b/isl_stream.c @@ -188,7 +188,6 @@ static struct isl_token *next_token(struct isl_stream *s, int same_line) c == '^' || c == '=' || c == ',' || - c == ':' || c == ';' || c == '[' || c == ']' || @@ -262,6 +261,20 @@ static struct isl_token *next_token(struct isl_stream *s, int same_line) } return tok; } + if (c == ':') { + int c; + tok = isl_token_new(s->ctx, line, col, old_line != line); + if (!tok) + return NULL; + if ((c = isl_stream_getc(s)) == '=') { + tok->type = ISL_TOKEN_DEF; + return tok; + } + if (c != -1) + isl_stream_ungetc(s, c); + tok->type = ':'; + return tok; + } if (c == '>') { int c; tok = isl_token_new(s->ctx, line, col, old_line != line); diff --git a/isl_stream.h b/isl_stream.h index d83c705..f0c2fe1 100644 --- a/isl_stream.h +++ b/isl_stream.h @@ -20,7 +20,8 @@ enum isl_token_type { ISL_TOKEN_UNKNOWN = 256, ISL_TOKEN_VALUE, ISL_TOKEN_IDENT, ISL_TOKEN_GE, ISL_TOKEN_LE, ISL_TOKEN_GT, ISL_TOKEN_LT, ISL_TOKEN_TO, ISL_TOKEN_AND, - ISL_TOKEN_OR, ISL_TOKEN_EXISTS }; + ISL_TOKEN_OR, ISL_TOKEN_EXISTS, + ISL_TOKEN_DEF }; struct isl_token { enum isl_token_type type; -- 2.7.4