aboutsummaryrefslogtreecommitdiff
path: root/src/io
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@axiomatics.org>2017-01-16 18:28:08 -0800
committerGabriel Dos Reis <gdr@axiomatics.org>2017-01-16 18:28:08 -0800
commit49b70a18de895e138e40670c249e0d6166c825a6 (patch)
treec8989445bc0505a0127166e651e87577f013d4f8 /src/io
parent550b22dd50ec1a394d33f63dbf493dff46e3ccb7 (diff)
downloadopen-axiom-49b70a18de895e138e40670c249e0d6166c825a6.tar.gz
Remove Fragment::last_indent.
Diffstat (limited to 'src/io')
-rw-r--r--src/io/InputFragment.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/io/InputFragment.cxx b/src/io/InputFragment.cxx
index 394f670f..e409062d 100644
--- a/src/io/InputFragment.cxx
+++ b/src/io/InputFragment.cxx
@@ -1,5 +1,5 @@
// -*- C++ -*-
-// Copyright (C) 2014-2015, Gabriel Dos Reis.
+// Copyright (C) 2014-2017, Gabriel Dos Reis.
// All rights reserved.
// Written by Gabriel Dos Reis.
//
@@ -72,6 +72,7 @@ namespace OpenAxiom {
// Clean up and dress up the line with indentation information.
static Line& prop_up(Line& line) {
line.indent = indentation(trim_right(line));
+ line.kind = LineKind::Ordinary;
return line;
}
@@ -100,14 +101,15 @@ namespace OpenAxiom {
Fragment fragment;
std::stack<ColumnIndex> indents;
- if (not line.empty()) {
+ if (not line.empty() and line.kind == LineKind::Ordinary) {
indents.push(line.indent);
fragment.push_back(line);
}
while (std::getline(input, line)) {
++line.number;
- if (blank(prop_up(line)))
+ prop_up(line);
+ if (blank(line))
continue; // Don't bother with ignorable comments.
else if (fragment.line_continuation())
;