summaryrefslogtreecommitdiff
path: root/src/io/line.hpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-03-16 14:55:57 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-03-24 19:27:09 -0700
commitfe3d4ce758822d65a0a5d617b7b77df2dbc972d8 (patch)
treed048a7e356ba542ebc5647b1aedfce4b8257daa2 /src/io/line.hpp
parentc812c92d1a1835f0bda783e709481188c8d92225 (diff)
downloadtmwa-fe3d4ce758822d65a0a5d617b7b77df2dbc972d8.tar.gz
tmwa-fe3d4ce758822d65a0a5d617b7b77df2dbc972d8.tar.bz2
tmwa-fe3d4ce758822d65a0a5d617b7b77df2dbc972d8.tar.xz
tmwa-fe3d4ce758822d65a0a5d617b7b77df2dbc972d8.zip
Implement new magic frontend using sexpr
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: