Implement character escape sequences

This commit is contained in:
2025-01-22 20:19:26 +01:00
parent 156506e8fa
commit 0dc95d4466
7 changed files with 83 additions and 52 deletions

View File

@ -736,7 +736,7 @@ namespace source
public:
unary_expression(const struct position position, expression *operand,
const unsigned char operation);
const unary_operator operation);
virtual void accept(parser_visitor *visitor) override;
expression& operand();

View File

@ -41,6 +41,8 @@ namespace source
{
public:
using symbol_ptr = std::shared_ptr<info<T>>;
using iterator = typename std::unordered_map<std::string, symbol_ptr>::iterator;
using const_iterator = typename std::unordered_map<std::string, symbol_ptr>::const_iterator;
private:
std::unordered_map<std::string, symbol_ptr> entries;
@ -57,6 +59,26 @@ namespace source
{
}
iterator begin()
{
return entries.begin();
}
iterator end()
{
return entries.end();
}
const_iterator cbegin() const
{
return entries.cbegin();
}
const_iterator cend() const
{
return entries.cend();
}
/**
* Looks for symbol in the table by name. Returns nullptr if the symbol
* can not be found.