Support Unicode escape characters in string literals ('\uUUUU')

Fixes #638
This commit is contained in:
Alex Beregszaszi
2016-08-04 17:28:48 +01:00
parent b83acfae59
commit aa4593cab3
2 changed files with 45 additions and 0 deletions
+2
View File
@@ -175,6 +175,7 @@ private:
inline void addLiteralChar(char c) { m_nextToken.literal.push_back(c); }
inline void addCommentLiteralChar(char c) { m_nextSkippedComment.literal.push_back(c); }
inline void addLiteralCharAndAdvance() { addLiteralChar(m_char); advance(); }
void addUnicodeChar(unsigned codepoint);
///@}
bool advance() { m_char = m_source.advanceAndGet(); return !m_source.isPastEndOfInput(); }
@@ -185,6 +186,7 @@ private:
inline Token::Value selectToken(char _next, Token::Value _then, Token::Value _else);
bool scanHexByte(char& o_scannedByte);
bool scanUnicode(unsigned& o_codepoint);
/// Scans a single Solidity token.
void scanToken();