From: Sven Verdoolaege Date: Sat, 1 May 2010 17:08:46 +0000 (+0200) Subject: isl_stream: accept lexicographic operators X-Git-Tag: isl-0.03~204 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07a960fbafa1ee166f2dfa32ef0139a4f8d90dfb;p=platform%2Fupstream%2Fisl.git isl_stream: accept lexicographic operators --- diff --git a/include/isl_stream.h b/include/isl_stream.h index b3a91f9..b566ae5 100644 --- a/include/isl_stream.h +++ b/include/isl_stream.h @@ -22,6 +22,8 @@ enum isl_token_type { ISL_TOKEN_ERROR = -1, ISL_TOKEN_UNKNOWN = 256, ISL_TOKEN_VALUE, ISL_TOKEN_IDENT, ISL_TOKEN_GE, ISL_TOKEN_LE, ISL_TOKEN_GT, ISL_TOKEN_LT, + ISL_TOKEN_LEX_GE, ISL_TOKEN_LEX_LE, + ISL_TOKEN_LEX_GT, ISL_TOKEN_LEX_LT, ISL_TOKEN_TO, ISL_TOKEN_AND, ISL_TOKEN_OR, ISL_TOKEN_EXISTS, ISL_TOKEN_DEF, ISL_TOKEN_INFTY, ISL_TOKEN_NAN, diff --git a/isl_stream.c b/isl_stream.c index 88670cb..6dcdafd 100644 --- a/isl_stream.c +++ b/isl_stream.c @@ -381,10 +381,16 @@ static struct isl_token *next_token(struct isl_stream *s, int same_line) if ((c = isl_stream_getc(s)) == '=') { tok->type = ISL_TOKEN_GE; return tok; - } + } else if (c == '>') { + if ((c = isl_stream_getc(s)) == '=') { + tok->type = ISL_TOKEN_LEX_GE; + return tok; + } + tok->type = ISL_TOKEN_LEX_GT; + } else + tok->type = ISL_TOKEN_GT; if (c != -1) isl_stream_ungetc(s, c); - tok->type = ISL_TOKEN_GT; return tok; } if (c == '<') { @@ -395,10 +401,16 @@ static struct isl_token *next_token(struct isl_stream *s, int same_line) if ((c = isl_stream_getc(s)) == '=') { tok->type = ISL_TOKEN_LE; return tok; - } + } else if (c == '<') { + if ((c = isl_stream_getc(s)) == '=') { + tok->type = ISL_TOKEN_LEX_LE; + return tok; + } + tok->type = ISL_TOKEN_LEX_LT; + } else + tok->type = ISL_TOKEN_LT; if (c != -1) isl_stream_ungetc(s, c); - tok->type = ISL_TOKEN_LT; return tok; } if (c == '&') {