summaryrefslogtreecommitdiff
path: root/src/io/line.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/line.hpp')
-rw-r--r--src/io/line.hpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/io/line.hpp b/src/io/line.hpp
index 321cdf7..a9e8944 100644
--- a/src/io/line.hpp
+++ b/src/io/line.hpp
@@ -40,11 +40,11 @@ namespace io
// 1-based
uint16_t line, column;
- AString message_str(ZString cat, ZString msg);
- void message(ZString cat, ZString msg);
- void note(ZString msg) { message("note", msg); }
- void warning(ZString msg) { message("warning", msg); }
- void error(ZString msg) { message("error", msg); }
+ AString message_str(ZString cat, ZString msg) const;
+ void message(ZString cat, ZString msg) const;
+ void note(ZString msg) const { message("note", msg); }
+ void warning(ZString msg) const { message("warning", msg); }
+ void error(ZString msg) const { message("error", msg); }
};
// psst, don't tell anyone
@@ -59,6 +59,17 @@ namespace io
}
};
+ struct LineSpan
+ {
+ LineChar begin, end;
+
+ AString message_str(ZString cat, ZString msg) const;
+ void message(ZString cat, ZString msg) const;
+ void note(ZString msg) const { message("note", msg); }
+ void warning(ZString msg) const { message("warning", msg); }
+ void error(ZString msg) const { message("error", msg); }
+ };
+
class LineReader
{
protected: