From 49b70a18de895e138e40670c249e0d6166c825a6 Mon Sep 17 00:00:00 2001
From: Gabriel Dos Reis <gdr@axiomatics.org>
Date: Mon, 16 Jan 2017 18:28:08 -0800
Subject: Remove Fragment::last_indent.

---
 src/include/open-axiom/InputFragment | 4 ----
 src/include/open-axiom/SourceInput   | 2 +-
 src/io/InputFragment.cxx             | 8 +++++---
 3 files changed, 6 insertions(+), 8 deletions(-)

(limited to 'src')

diff --git a/src/include/open-axiom/InputFragment b/src/include/open-axiom/InputFragment
index 41661c67..e55cd0a6 100644
--- a/src/include/open-axiom/InputFragment
+++ b/src/include/open-axiom/InputFragment
@@ -61,10 +61,6 @@ namespace OpenAxiom {
       bool line_continuation() const {
          return not empty() and back().back() == '_';
       }
-      // Return the indentation of the last physical line of this fragment.
-      ColumnIndex last_indent() const {
-         return empty() ? 0 : back().indent;
-      }
       using std::vector<Line>::operator[];
       // Reference a line given by a position into this fragment.
       const Line& operator()(const OpenAxiom::FragmentCursor& pos) const {
diff --git a/src/include/open-axiom/SourceInput b/src/include/open-axiom/SourceInput
index efb4ab8b..ee7fd384 100644
--- a/src/include/open-axiom/SourceInput
+++ b/src/include/open-axiom/SourceInput
@@ -41,7 +41,7 @@ namespace OpenAxiom {
    // -- A source input transform a character stream into a program fragment
    // -- stream, delivering a fragment one at a time.
    struct SourceInput {
-      SourceInput(std::istream& is) : input(is) { }
+      SourceInput(std::istream& is) : input(is), line{ } { }
       // Return the next program fragment from this input source.
       Fragment get();
       
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())
             ;
-- 
cgit v1.2.3