Skip to content
Snippets Groups Projects
Commit b88a5f5d authored by Leandro Melo's avatar Leandro Melo Committed by hjk
Browse files

C++: Add Token::isStringLiteral and Token::isCharLiteral


It will be particularly handy when introducing the new C++11
string/char literals: U"abc", u"abc", u8"abc", U'a', u'a'.

Change-Id: Ic250f5a7b999da322debb24fc0171aaef333f356
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 88dcefe0
No related branches found
No related tags found
No related merge requests found
......@@ -37,12 +37,16 @@ enum Kind {
T_FIRST_LITERAL,
T_NUMERIC_LITERAL = T_FIRST_LITERAL,
T_CHAR_LITERAL,
T_FIRST_CHAR_LITERAL,
T_CHAR_LITERAL = T_FIRST_CHAR_LITERAL,
T_WIDE_CHAR_LITERAL,
T_STRING_LITERAL,
T_LAST_CHAR_LITERAL = T_WIDE_CHAR_LITERAL,
T_FIRST_STRING_LITERAL,
T_STRING_LITERAL = T_FIRST_STRING_LITERAL,
T_WIDE_STRING_LITERAL,
T_AT_STRING_LITERAL,
T_ANGLE_STRING_LITERAL,
T_LAST_STRING_LITERAL = T_ANGLE_STRING_LITERAL,
T_LAST_LITERAL = T_ANGLE_STRING_LITERAL,
T_FIRST_OPERATOR,
......@@ -287,6 +291,12 @@ public:
inline bool isLiteral() const
{ return f.kind >= T_FIRST_LITERAL && f.kind <= T_LAST_LITERAL; }
inline bool isCharLiteral() const
{ return f.kind >= T_FIRST_CHAR_LITERAL && f.kind <= T_LAST_CHAR_LITERAL; }
inline bool isStringLiteral() const
{ return f.kind >= T_FIRST_STRING_LITERAL && f.kind <= T_LAST_STRING_LITERAL; }
inline bool isOperator() const
{ return f.kind >= T_FIRST_OPERATOR && f.kind <= T_LAST_OPERATOR; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment