|
|
@ -256,9 +256,6 @@ bool Lexer::consumeValue() |
|
|
|
|
|
|
|
|
|
|
|
bool Lexer::consumeComment() |
|
|
|
bool Lexer::consumeComment() |
|
|
|
{ |
|
|
|
{ |
|
|
|
size_t column = m_column; |
|
|
|
|
|
|
|
std::string comment; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ignore(); // ;
|
|
|
|
ignore(); // ;
|
|
|
|
|
|
|
|
|
|
|
|
static std::unordered_set<char> exit = { |
|
|
|
static std::unordered_set<char> exit = { |
|
|
@ -275,18 +272,9 @@ bool Lexer::consumeComment() |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
comment += character; |
|
|
|
|
|
|
|
ignore(); |
|
|
|
ignore(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Trim comment
|
|
|
|
|
|
|
|
comment.erase(comment.begin(), |
|
|
|
|
|
|
|
std::find_if(comment.begin(), comment.end(), [](char c) { return !std::isspace(c); })); |
|
|
|
|
|
|
|
comment.erase(std::find_if(comment.rbegin(), comment.rend(), [](char c) { return !std::isspace(c); }).base(), |
|
|
|
|
|
|
|
comment.end()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_tokens.push_back({ Token::Type::Comment, m_line, column, comment }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|