about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-09-30 23:18:55 -0700
committerKartik Agaram <vc@akkartik.com>2018-09-30 23:18:55 -0700
commitcd8395323b06575c38c09092cc03a19a844b65ef (patch)
tree1f00af3abc4a08c1a50410c13d48e958e59e231f /subx
parent69b004f59b145b85803f9072528d0885bac53690 (diff)
downloadmu-cd8395323b06575c38c09092cc03a19a844b65ef.tar.gz
4627
Diffstat (limited to 'subx')
-rw-r--r--subx/011run.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/subx/011run.cc b/subx/011run.cc
index b7cf280f..7a63c159 100644
--- a/subx/011run.cc
+++ b/subx/011run.cc
@@ -148,13 +148,18 @@ void parse(istream& fin, program& out) {
       if (word_data == ".") continue;  // comment token
       if (word_data == "==") {
         flush(out, l);
-        segment s;
         string segment_title;
         lin >> segment_title;
-        if (starts_with(segment_title, "0x"))
+        if (starts_with(segment_title, "0x")) {
+          segment s;
           s.start = parse_int(segment_title);
-        trace(99, "parse") << "new segment from " << HEXWORD << s.start << end();
-        out.segments.push_back(s);
+          trace(99, "parse") << "new segment from 0x" << HEXWORD << s.start << end();
+          out.segments.push_back(s);
+        }
+        else {
+          trace(99, "parse") << "new segment " << segment_title << end();
+          out.segments.push_back(segment());
+        }
         // todo?
         break;  // skip rest of line
       }