I am not sure what the problem is but I keep receiving this error when I try to use a while statement in my code.
Invalid token \'while\' in class,
There's nothing wrong with the while, it's something above it that's the problem. Check for mismatched braces and semicolons in a comment or something like that.