repl: fix for-loop/if statement duplicate printing bug
							parent
							
								
									96808a0e2a
								
							
						
					
					
						commit
						3aeaa24df6
					
				| 
						 | 
					@ -219,6 +219,13 @@ fn run_repl(workdir string, vrepl_prefix string) {
 | 
				
			||||||
			if temp_line.starts_with('import ') || temp_line.starts_with('#include ') {
 | 
								if temp_line.starts_with('import ') || temp_line.starts_with('#include ') {
 | 
				
			||||||
				temp_source_code = '${temp_line}\n' + r.current_source_code(false)
 | 
									temp_source_code = '${temp_line}\n' + r.current_source_code(false)
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
 | 
									for i, l in r.lines {
 | 
				
			||||||
 | 
										if (l.starts_with('for ') || l.starts_with('if ')) && l.contains('println') {
 | 
				
			||||||
 | 
											r.lines.delete(i)
 | 
				
			||||||
 | 
											break
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				temp_source_code = r.current_source_code(true) + '\n${temp_line}\n'
 | 
									temp_source_code = r.current_source_code(true) + '\n${temp_line}\n'
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			os.write_file(temp_file, temp_source_code)
 | 
								os.write_file(temp_file, temp_source_code)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue