aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/token.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-05-08 06:34:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-05-27 08:35:29 +0200
commita5bf818ebb55e4e27eb0f067664fd4db70284267 (patch)
tree2c0699ba4827cee34161db3da7ec8f94a6175ea9 /libbuild2/token.hxx
parentfce9782a330e8f701a8df0b5200e5b78e97ec4b5 (diff)
Initial support for parsing and dumping recipes
Diffstat (limited to 'libbuild2/token.hxx')
-rw-r--r--libbuild2/token.hxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/libbuild2/token.hxx b/libbuild2/token.hxx
index e11b880..bd176b5 100644
--- a/libbuild2/token.hxx
+++ b/libbuild2/token.hxx
@@ -152,6 +152,20 @@ namespace build2
inline ostream&
operator<< (ostream& o, const token& t) {t.printer (o, t, true); return o;}
+ // Note: these are currently only used for sanity checks.
+ //
+ inline bool
+ operator== (const token& x, const token& y)
+ {
+ return x.type == y.type && x.value == y.value;
+ }
+
+ inline bool
+ operator!= (const token& x, const token& y)
+ {
+ return !(x == y);
+ }
+
// Context-dependent lexing (see lexer_mode for details).
//
struct lexer_mode_base