diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-08-22 10:20:34 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-08-22 10:20:34 +0200 |
commit | 94f0866683bdf063b30323bac227e11a23110fa2 (patch) | |
tree | c484de46d07f1d0b8fdffb6dd7573f7047e1b2cb /cli/token.ixx | |
parent | c3f7f0c0556270ced988a7adddec885270bc1ea7 (diff) | |
download | cli-94f0866683bdf063b30323bac227e11a23110fa2.tar.gz cli-94f0866683bdf063b30323bac227e11a23110fa2.tar.xz cli-94f0866683bdf063b30323bac227e11a23110fa2.zip |
Add call and template expressions
Also add support for querying the lexer failure state.
Diffstat (limited to 'cli/token.ixx')
-rw-r--r-- | cli/token.ixx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cli/token.ixx b/cli/token.ixx index bcf040a..93db6d8 100644 --- a/cli/token.ixx +++ b/cli/token.ixx @@ -24,7 +24,7 @@ column () const inline Token::Keyword Token:: keyword () const { - return keyword_; + return type_ == t_keyword ? keyword_ : k_invalid; } inline std::string const& Token:: @@ -36,7 +36,7 @@ identifier () const inline Token::Punctuation Token:: punctuation () const { - return punctuation_; + return type_ == t_punctuation ? punctuation_ : p_invalid; } inline std::string const& Token:: @@ -45,6 +45,12 @@ literal () const return str_; } +inline std::string const& Token:: +expression () const +{ + return str_; +} + inline Token:: Token (std::size_t l, std::size_t c) : l_ (l), c_ (c), type_ (t_eos) |