summaryrefslogtreecommitdiff
path: root/src/io/line.hpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-10-19 22:22:08 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-10-26 14:21:48 -0700
commit6800761863dd45b6055768febc6ace6a20120dc7 (patch)
tree73b416ca6507d9bb4f950252d55ead8e8cda34b5 /src/io/line.hpp
parent0edf563dfc14a2b9db33a92f0eced28950bdf1aa (diff)
downloadtmwa-6800761863dd45b6055768febc6ace6a20120dc7.tar.gz
tmwa-6800761863dd45b6055768febc6ace6a20120dc7.tar.bz2
tmwa-6800761863dd45b6055768febc6ace6a20120dc7.tar.xz
tmwa-6800761863dd45b6055768febc6ace6a20120dc7.zip
New ast module for for npc parsing
Will eventually put most/all parsers there.
Diffstat (limited to 'src/io/line.hpp')
-rw-r--r--src/io/line.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/io/line.hpp b/src/io/line.hpp
index 8244c5e..5572e98 100644
--- a/src/io/line.hpp
+++ b/src/io/line.hpp
@@ -41,6 +41,9 @@ namespace io
uint16_t line, column;
AString message_str(ZString cat, ZString msg) const;
+ AString note_str(ZString msg) const { return message_str("note"_s, msg); }
+ AString warning_str(ZString msg) const { return message_str("warning"_s, msg); }
+ AString error_str(ZString msg) const { return message_str("error"_s, msg); }
void message(ZString cat, ZString msg) const;
void note(ZString msg) const { message("note"_s, msg); }
void warning(ZString msg) const { message("warning"_s, msg); }
@@ -64,12 +67,22 @@ namespace io
LineChar begin, end;
AString message_str(ZString cat, ZString msg) const;
+ AString note_str(ZString msg) const { return message_str("note"_s, msg); }
+ AString warning_str(ZString msg) const { return message_str("warning"_s, msg); }
+ AString error_str(ZString msg) const { return message_str("error"_s, msg); }
void message(ZString cat, ZString msg) const;
void note(ZString msg) const { message("note"_s, msg); }
void warning(ZString msg) const { message("warning"_s, msg); }
void error(ZString msg) const { message("error"_s, msg); }
};
+ template<class T>
+ struct Spanned
+ {
+ T data;
+ LineSpan span;
+ };
+
class LineReader
{
protected: