File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1771,10 +1771,14 @@ def _inline(ins):
17711771
17721772 i = 0
17731773 while i < len (tmp ):
1774- if not tmp [i ] or tmp [ i ][ 0 ] == ';' : # a comment or empty string?
1774+ if not tmp [i ]: # discard empty lines
17751775 tmp .pop (i )
17761776 continue
17771777
1778+ if not tmp [i ] or tmp [i ][0 ] == ';' : # a comment
1779+ i += 1
1780+ continue
1781+
17781782 if tmp [i ][0 ] == '#' : # A preprocessor directive
17791783 i += 1
17801784 continue
@@ -2329,7 +2333,7 @@ def remove_unused_labels(output: List[str]):
23292333 output .pop (i )
23302334
23312335
2332- def emit (mem , optimize = True ):
2336+ def emit (mem : List [ Quad ] , optimize = True ):
23332337 """ Begin converting each quad instruction to asm
23342338 by iterating over the "mem" array, and called its
23352339 associated function. Each function returns an array of
Original file line number Diff line number Diff line change @@ -251,6 +251,8 @@ def main(args=None, emitter=None):
251251 translator .emit_strings ()
252252 # Emits jump tables
253253 translator .emit_jump_tables ()
254+ # Signals end of user code
255+ translator .ic_inline (';; --- end of user code ---' , zxblex .lexer .lineno )
254256
255257 if OPTIONS .emitBackend :
256258 with open_file (OPTIONS .outputFileName , 'wt' , 'utf-8' ) as output_file :
You can’t perform that action at this time.
0 commit comments