MCPcopy Create free account
hub / github.com/RetiredWizard/PyDOS / list

Method list

PyBasic/program.py:64–81  ·  view source on GitHub ↗

Lists the program

(self, strt_line, end_line, infile, tmpfile)

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.95

Calls 2

line_numbersMethod · 0.95
getprogramMethod · 0.95

Tested by

no test coverage detected