diff options
Diffstat (limited to 'libsolidity/parsing')
-rw-r--r-- | libsolidity/parsing/Scanner.cpp | 7 | ||||
-rw-r--r-- | libsolidity/parsing/Scanner.h | 4 | ||||
-rw-r--r-- | libsolidity/parsing/Token.h | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/libsolidity/parsing/Scanner.cpp b/libsolidity/parsing/Scanner.cpp index 6115101e..3623f23f 100644 --- a/libsolidity/parsing/Scanner.cpp +++ b/libsolidity/parsing/Scanner.cpp @@ -327,7 +327,12 @@ Token::Value Scanner::scanMultiLineDocComment() if (isLineTerminator(m_char)) { skipWhitespace(); - if (!m_source.isPastEndOfInput(1) && m_source.get(0) == '*' && m_source.get(1) != '/') + if (!m_source.isPastEndOfInput(1) && m_source.get(0) == '*' && m_source.get(1) == '*') + { // it is unknown if this leads to the end of the comment + addCommentLiteralChar('*'); + advance(); + } + else if (!m_source.isPastEndOfInput(1) && m_source.get(0) == '*' && m_source.get(1) != '/') { // skip first '*' in subsequent lines if (charsAdded) addCommentLiteralChar('\n'); diff --git a/libsolidity/parsing/Scanner.h b/libsolidity/parsing/Scanner.h index 65de8bd4..d6b48c6f 100644 --- a/libsolidity/parsing/Scanner.h +++ b/libsolidity/parsing/Scanner.h @@ -80,6 +80,8 @@ public: void reset() { m_position = 0; } + std::string const& source() const { return m_source; } + ///@{ ///@name Error printing helper functions /// Functions that help pretty-printing parse errors @@ -102,6 +104,8 @@ public: explicit Scanner(CharStream const& _source = CharStream(), std::string const& _sourceName = "") { reset(_source, _sourceName); } + std::string source() const { return m_source.source(); } + /// Resets the scanner as if newly constructed with _source and _sourceName as input. void reset(CharStream const& _source, std::string const& _sourceName); /// Resets scanner to the start of input. diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h index 3ce0f424..c6d050bb 100644 --- a/libsolidity/parsing/Token.h +++ b/libsolidity/parsing/Token.h @@ -147,7 +147,6 @@ namespace solidity K(Const, "constant", 0) \ K(Continue, "continue", 0) \ K(Contract, "contract", 0) \ - K(Default, "default", 0) \ K(Do, "do", 0) \ K(Else, "else", 0) \ K(Enum, "enum", 0) \ @@ -208,7 +207,6 @@ namespace solidity T(TypesEnd, NULL, 0) /* used as type enum end marker */ \ \ /* Literals */ \ - K(NullLiteral, "null", 0) \ K(TrueLiteral, "true", 0) \ K(FalseLiteral, "false", 0) \ T(Number, NULL, 0) \ @@ -223,12 +221,14 @@ namespace solidity K(After, "after", 0) \ K(Case, "case", 0) \ K(Catch, "catch", 0) \ + K(Default, "default", 0) \ K(Final, "final", 0) \ K(In, "in", 0) \ K(Inline, "inline", 0) \ K(Interface, "interface", 0) \ K(Let, "let", 0) \ K(Match, "match", 0) \ + K(NullLiteral, "null", 0) \ K(Of, "of", 0) \ K(Pure, "pure", 0) \ K(Relocatable, "relocatable", 0) \ |