diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-04 03:34:37 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-04 03:34:37 -0400 |
commit | 1cc33531ea7cf82e41b1ed49bf8ffc5afea084e4 (patch) | |
tree | 0ecd593b7ca164743bb9a4addf70ec76072288ce /src/error.cc | |
parent | 28da097fc245340b316539c5533d470d82f19965 (diff) | |
download | fork-ledger-1cc33531ea7cf82e41b1ed49bf8ffc5afea084e4.tar.gz fork-ledger-1cc33531ea7cf82e41b1ed49bf8ffc5afea084e4.tar.bz2 fork-ledger-1cc33531ea7cf82e41b1ed49bf8ffc5afea084e4.zip |
Simplified the textual parser, and improved metadata support.
Diffstat (limited to 'src/error.cc')
-rw-r--r-- | src/error.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/error.cc b/src/error.cc index 68a2d844..dbda8c30 100644 --- a/src/error.cc +++ b/src/error.cc @@ -50,21 +50,21 @@ string file_context(const path& file, std::size_t line) return buf.str(); } -string line_context(const string& line, - istream_pos_type pos, - istream_pos_type end_pos) +string line_context(const string& line, + std::size_t pos, + std::size_t end_pos) { std::ostringstream buf; buf << " " << line << "\n"; - if (pos != istream_pos_type(0)) { + if (pos != 0) { buf << " "; - if (end_pos == istream_pos_type(0)) { - for (istream_pos_type i = 0; i < pos; i += 1) + if (end_pos == 0) { + for (std::size_t i = 0; i < pos; i += 1) buf << " "; buf << "^"; } else { - for (istream_pos_type i = 0; i < end_pos; i += 1) { + for (std::size_t i = 0; i < end_pos; i += 1) { if (i >= pos) buf << "^"; else |