aboutsummaryrefslogtreecommitdiff
path: root/build/token
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-12-12 11:30:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-12-12 11:30:04 +0200
commit257ad3c2c5e633d2fd3f2228021ac3ae8d6d07cb (patch)
treeecfa5df6e8abca5bd483d5498bf84412ae58930e /build/token
parent0dcf07989b4b942f6ff872023b2886b7f698d711 (diff)
Initial buildfile parser implementation
g++-4.9 -std=c++14 -g -I../../.. -o driver driver.cxx ../../../build/lexer.cxx ../../../build/parser.cxx && ./driver
Diffstat (limited to 'build/token')
-rw-r--r--build/token6
1 files changed, 6 insertions, 0 deletions
diff --git a/build/token b/build/token
index bade45c..6f4951c 100644
--- a/build/token
+++ b/build/token
@@ -28,6 +28,12 @@ namespace build
token_punctuation
punctuation () const {assert (t_ == token_type::punctuation); return p_;}
+ bool
+ is (token_punctuation p) const
+ {
+ return t_ == token_type::punctuation && p_ == p;
+ }
+
std::uint64_t line () const {return l_;}
std::uint64_t column () const {return c_;}