Support compound statements
This commit is contained in:
@ -58,6 +58,12 @@ namespace elna::source
|
||||
return *this;
|
||||
}
|
||||
|
||||
text_iterator text_iterator::operator+(std::size_t step)
|
||||
{
|
||||
auto result = *this;
|
||||
return ++result;
|
||||
}
|
||||
|
||||
bool text_iterator::operator==(const text_iterator& that) const noexcept
|
||||
{
|
||||
return this->m_buffer == that.m_buffer;
|
||||
@ -309,6 +315,11 @@ namespace elna::source
|
||||
|
||||
tokens.emplace_back(token::type::factor_operator, _operator.c_str(), iterator.position());
|
||||
}
|
||||
else if (*iterator == ':' && iterator + 1 != text_end && *(iterator + 1) == '=')
|
||||
{
|
||||
tokens.emplace_back(token::type::assignment, iterator.position());
|
||||
++iterator;
|
||||
}
|
||||
else
|
||||
{
|
||||
return source_result(unexpected_character{ std::string{ *iterator }, iterator.position() });
|
||||
|
Reference in New Issue
Block a user