@@ -203,7 +203,7 @@ omit_redundant_modes = utils.omit_redundant_modes
203203if args .full :
204204 omit_redundant_modes = lambda gcode_iter : gcode_iter # bypass
205205
206- def write (gcodes , modal_params = tuple (), comment = None ):
206+ def write (gcodes , modal_params = tuple (), comment = None , macro = None ):
207207 """
208208 Write to output, while enforcing the flags:
209209 args.singles
@@ -234,6 +234,8 @@ def write(gcodes, modal_params=tuple(), comment=None):
234234 line_list .append (block_str )
235235 if comment :
236236 line_list .append (str (comment ))
237+ if macro :
238+ line_list .append (str (macro ))
237239 line_str = ' ' .join (line_list )
238240 if line_str or not args .rm_blanks :
239241 print (line_str )
@@ -309,7 +311,7 @@ for line_str in args.infile.readlines():
309311
310312 else :
311313 if args .full :
312- write (effective_gcodes , comment = line .comment )
314+ write (effective_gcodes , comment = line .comment , macro = line . macro )
313315 else :
314- write (line .block .gcodes , modal_params = line .block .modal_params , comment = line .comment )
316+ write (line .block .gcodes , modal_params = line .block .modal_params , comment = line .comment , macro = line . macro )
315317 machine .process_block (line .block )
0 commit comments