summaryrefslogtreecommitdiff
path: root/src/parse/lex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/lex.cpp')
-rw-r--r--src/parse/lex.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/parse/lex.cpp b/src/parse/lex.cpp
index 648792e9..78d2aa7e 100644
--- a/src/parse/lex.cpp
+++ b/src/parse/lex.cpp
@@ -578,6 +578,8 @@ uint32_t Lexer::parseEscape(char enclosing)
return '\\';
case '\'':
return '\'';
+ case '"':
+ return '"';
case 'r':
return '\r';
case 'n':
@@ -691,7 +693,21 @@ SERIALISE_TYPE_S(Token, {
::std::ostream& operator<<(::std::ostream& os, const Token& tok)
{
- os << Token::typestr(tok.type()) << "\"" << tok.str() << "\"";
+ os << Token::typestr(tok.type());
+ switch(tok.type())
+ {
+ case TOK_STRING:
+ case TOK_IDENT:
+ case TOK_MACRO:
+ case TOK_LIFETIME:
+ os << "\"" << tok.str() << "\"";
+ break;
+ case TOK_INTEGER:
+ os << tok.intval();
+ break;
+ default:
+ break;
+ }
return os;
}
::std::ostream& operator<<(::std::ostream& os, const Position& p)
@@ -814,6 +830,7 @@ eTokenType TokenStream::lookahead(unsigned int i)
m_lookahead.push_back( this->innerGetToken() );
}
+ DEBUG("lookahead(" << i << ") = " << m_lookahead[i]);
return m_lookahead[i].type();
}