Improve syntax analysis for iteration macros