parser.py: Toggling loop flag after repeat statement is done