aboutsummaryrefslogtreecommitdiff
path: root/qtmips_cli
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-08-22 13:47:41 +0200
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-08-22 13:47:41 +0200
commit6c09f661b83dd13a8403243c1441efa5c4900538 (patch)
treefe32eed92f284d08455461c02c158226d760ac4c /qtmips_cli
parenta385be02219abc1fd751908e559286dc1a370e12 (diff)
downloadqtmips-6c09f661b83dd13a8403243c1441efa5c4900538.tar.gz
qtmips-6c09f661b83dd13a8403243c1441efa5c4900538.tar.bz2
qtmips-6c09f661b83dd13a8403243c1441efa5c4900538.zip
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 <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_cli')
-rw-r--r--qtmips_cli/main.cpp12
1 files changed, 1 insertions, 11 deletions
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();
}