int i = 0;
struct isl_token *tok;
+ if (isl_stream_next_token_is(s, ']'))
+ return map;
+
while ((tok = next_token(s)) != NULL) {
int new_name = 0;
map = isl_map_add_dims(map, type, 1);
map = set_name(map, type, i, v->v->name);
isl_token_free(tok);
- } else if (tok->type == ISL_TOKEN_IDENT ||
- tok->type == ISL_TOKEN_VALUE ||
- tok->type == '-' ||
- tok->type == '(') {
+ } else {
if (type == isl_dim_param) {
isl_stream_error(s, tok,
"expecting unique identifier");
goto error;
map = isl_map_add_dims(map, type, 1);
map = read_var_def(s, map, type, v);
- } else
- break;
+ }
tok = isl_stream_next_token(s);
if (tok && tok->type == ']' &&
str2 = "[n] -> { [c1] : c1 >= 0 and 3c1 <= -4 + n }";
test_parse_map_equal(ctx, str, str2);
+ str = "{ [i,j] -> [i] : i < j; [i,j] -> [j] : j <= i }";
+ str2 = "{ [i,j] -> [min(i,j)] }";
+ test_parse_map_equal(ctx, str, str2);
+
test_parse_pwqp(ctx, "{ [i] -> i + [ (i + [i/3])/2 ] }");
test_parse_map(ctx, "{ S1[i] -> [([i/10]),i%10] : 0 <= i <= 45 }");
}