Processes a NEXT statement that terminates a loop :return: A FlowSignal indicating that a loop has been processed
(self)
| 1282 | return FlowSignal(ftype=FlowSignal.LOOP_BEGIN,floop_var=loop_variable) |
| 1283 | |
| 1284 | def __nextstmt(self): |
| 1285 | """Processes a NEXT statement that terminates |
| 1286 | a loop |
| 1287 | |
| 1288 | :return: A FlowSignal indicating that a loop |
| 1289 | has been processed |
| 1290 | |
| 1291 | """ |
| 1292 | |
| 1293 | self.__advance() # Advance past NEXT token |
| 1294 | |
| 1295 | # Process the loop variable initialisation |
| 1296 | loop_variable = self.__token.lexeme # Save lexeme of |
| 1297 | # the current token |
| 1298 | |
| 1299 | if loop_variable.endswith('$'): |
| 1300 | raise SyntaxError('Syntax error: Loop variable is not numeric' + |
| 1301 | ' in line ' + str(self.__line_number)) |
| 1302 | |
| 1303 | return FlowSignal(ftype=FlowSignal.LOOP_REPEAT,floop_var=loop_variable) |
| 1304 | |
| 1305 | def __ongosubstmt(self): |
| 1306 | """Process the ON-GOSUB/GOTO statement |
no test coverage detected