On 04.07.22 19:20, Jakub Jelinek wrote: > Perhaps you could avoid some code duplication by doing it like: > bool close_paren = gfc_match ("val )") == MATCH_YES; > if (close_paren || gfc_match ("val , ") == MATCH_YES) Done! Good idea! I was thinking of things like ...peek_char() but that takes the next char and not the last one; but your method works. >> + else if (!has_modifiers >> + && gfc_match ("%e )", &step) == MATCH_YES) >> + { >> + if ((step->expr_type == EXPR_FUNCTION >> + || step->expr_type == EXPR_VARIABLE) >> + && strcmp (step->symtree->name, "step") == 0) >> + { >> + gfc_current_locus = old_loc; >> + gfc_match ("step ("); >> + has_error = true; >> + } > I think the above should accept even > linear (v : step (1) + 0) or linear (v : step (1, 2, 3) * 1) > which is desirable, because step then will be some other operation (hope > folding isn't performed yet). Well, it does. In that case expr_type == EXPR_OP. I added the latter to the C/C++ and the Fortran testcase. >> + !!$omp declare simd linear (x : ref, step (1)) linear (y : step (2), uval) > Are all these !! intentional? No – just a missed undo after debugging. It worked/works after changing it back to '!'. Revised version attached. Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955