Lists the program
(self, strt_line, end_line, infile, tmpfile)
| 62 | self.__imp = 'W' |
| 63 | |
| 64 | def list(self, strt_line, end_line, infile, tmpfile): |
| 65 | """Lists the program""" |
| 66 | line_numbers = self.line_numbers() |
| 67 | |
| 68 | for line_number in line_numbers: |
| 69 | if (int(line_number) >= strt_line and int(line_number) <= end_line) or strt_line == -1: |
| 70 | print(line_number, end=' ') |
| 71 | |
| 72 | statement = self.getprogram(line_number,infile,tmpfile) |
| 73 | for token in statement: |
| 74 | # Add in quotes for strings |
| 75 | if token.category == Token.STRING: |
| 76 | print('"' + token.lexeme + '"', end=' ') |
| 77 | |
| 78 | else: |
| 79 | print(token.lexeme, end=' ') |
| 80 | |
| 81 | print() |
| 82 | |
| 83 | def save(self, file, infile, tmpfile): |
| 84 | """Save the program |
no test coverage detected