aboutsummaryrefslogtreecommitdiffstats
path: root/Scanner.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-01-05 23:37:43 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-01-05 23:37:43 +0800
commitb4712773d329269b2d6f732a3236f3685aea41fc (patch)
treec1d0ea6cbfffa862d0b7fe770e8ca6f13b128111 /Scanner.cpp
parent7b3f0e549de2ae292ae6dd9fa20165ed36cbc3b8 (diff)
downloaddexon-solidity-b4712773d329269b2d6f732a3236f3685aea41fc.tar
dexon-solidity-b4712773d329269b2d6f732a3236f3685aea41fc.tar.gz
dexon-solidity-b4712773d329269b2d6f732a3236f3685aea41fc.tar.bz2
dexon-solidity-b4712773d329269b2d6f732a3236f3685aea41fc.tar.lz
dexon-solidity-b4712773d329269b2d6f732a3236f3685aea41fc.tar.xz
dexon-solidity-b4712773d329269b2d6f732a3236f3685aea41fc.tar.zst
dexon-solidity-b4712773d329269b2d6f732a3236f3685aea41fc.zip
Fix for sol scanner where empty multiline comment became Natspec comment
Diffstat (limited to 'Scanner.cpp')
-rw-r--r--Scanner.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/Scanner.cpp b/Scanner.cpp
index f22e69bc..1f700d8b 100644
--- a/Scanner.cpp
+++ b/Scanner.cpp
@@ -285,8 +285,6 @@ Token::Value Scanner::scanMultiLineDocComment()
bool endFound = false;
bool charsAdded = false;
- advance(); //consume the last '*' at /**
- skipWhitespaceExceptLF();
while (!isSourcePastEndOfInput())
{
//handle newlines in multline comments
@@ -354,11 +352,22 @@ Token::Value Scanner::scanSlash()
return Token::WHITESPACE;
else if (m_char == '*')
{
- Token::Value comment;
- m_nextSkippedComment.location.start = firstSlashPosition;
- comment = scanMultiLineDocComment();
- m_nextSkippedComment.location.end = getSourcePos();
- m_nextSkippedComment.token = comment;
+ advance(); //consume the last '*' at /**
+ skipWhitespaceExceptLF();
+
+ // special case of a closed normal multiline comment
+ if (!m_source.isPastEndOfInput() && m_source.get(0) == '/')
+ {
+ advance(); //skip the closing slash
+ }
+ else // we actually have a multiline documentation comment
+ {
+ Token::Value comment;
+ m_nextSkippedComment.location.start = firstSlashPosition;
+ comment = scanMultiLineDocComment();
+ m_nextSkippedComment.location.end = getSourcePos();
+ m_nextSkippedComment.token = comment;
+ }
return Token::WHITESPACE;
}
else