From 046fa543a6e784a683dfafb8dfcf977088a38a46 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 25 Jul 2011 11:56:45 +0200 Subject: [PATCH] isl_stream_read_map: accept "mod" in expressions Signed-off-by: Sven Verdoolaege --- include/isl/stream.h | 2 +- isl_input.c | 3 ++- isl_stream.c | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/isl/stream.h b/include/isl/stream.h index 779c6cf..0abc1fc 100644 --- a/include/isl/stream.h +++ b/include/isl/stream.h @@ -29,7 +29,7 @@ enum isl_token_type { ISL_TOKEN_ERROR = -1, ISL_TOKEN_DEF, ISL_TOKEN_INFTY, ISL_TOKEN_NAN, ISL_TOKEN_MIN, ISL_TOKEN_MAX, ISL_TOKEN_RAT, ISL_TOKEN_TRUE, ISL_TOKEN_FALSE, - ISL_TOKEN_CEILD, ISL_TOKEN_FLOORD, + ISL_TOKEN_CEILD, ISL_TOKEN_FLOORD, ISL_TOKEN_MOD, ISL_TOKEN_STRING, ISL_TOKEN_LAST }; diff --git a/isl_input.c b/isl_input.c index 175c2ec..ce9b04b 100644 --- a/isl_input.c +++ b/isl_input.c @@ -411,7 +411,8 @@ static __isl_give isl_pw_aff *accept_affine_factor(struct isl_stream *s, isl_stream_error(s, tok, "expecting factor"); goto error; } - if (isl_stream_eat_if_available(s, '%')) { + if (isl_stream_eat_if_available(s, '%') || + isl_stream_eat_if_available(s, ISL_TOKEN_MOD)) { isl_dim_free(dim); return affine_mod(s, v, res); } diff --git a/isl_stream.c b/isl_stream.c index c544149..b2406c0 100644 --- a/isl_stream.c +++ b/isl_stream.c @@ -264,6 +264,8 @@ static enum isl_token_type check_keywords(struct isl_stream *s) return ISL_TOKEN_CEILD; if (!strcasecmp(s->buffer, "floord")) return ISL_TOKEN_FLOORD; + if (!strcasecmp(s->buffer, "mod")) + return ISL_TOKEN_MOD; if (!s->keywords) return ISL_TOKEN_IDENT; -- 2.7.4