This is a webpage parsing error. Any time you see a character sequence beginning with "&" and ending with semi-colon, there's a good chance that it's html markup. It shows as
while %counter > 0 {
and should be
while %counter > 0 {
and preferably without trying to scrimp on using parenthesis:
while (%counter > 0) {