From 6c09f661b83dd13a8403243c1441efa5c4900538 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Thu, 22 Aug 2019 13:47:41 +0200 Subject: In include, use content from editor if file is already open. This allows to assemble from modified include files without need to save their content the first. Signed-off-by: Pavel Pisa --- qtmips_cli/main.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'qtmips_cli') diff --git a/qtmips_cli/main.cpp b/qtmips_cli/main.cpp index 08696b4..b318f13 100644 --- a/qtmips_cli/main.cpp +++ b/qtmips_cli/main.cpp @@ -334,18 +334,8 @@ bool assemble(QtMipsMachine &machine, MsgReport &msgrep, QString filename) { sasm.setup(mem, &symtab, 0x80020000); - QFile input_file(filename); - if (!input_file.open(QIODevice::ReadOnly)) { - cout << "cannot open filename " << filename.toLocal8Bit().data() << endl; + if (!sasm.process_file(filename)) return false; - } - - QTextStream in(&input_file); - for (int ln = 1; !in.atEnd(); ln++) { - QString line = in.readLine(); - sasm.process_line(line, filename, ln); - } - input_file.close(); return sasm.finish(); } -- cgit v1.2.3