Implement defer
This commit is contained in:
@ -127,6 +127,9 @@ as {
|
||||
sizeof {
|
||||
return yy::parser::make_SIZEOF(this->location);
|
||||
}
|
||||
defer {
|
||||
return yy::parser::make_DEFER(this->location);
|
||||
}
|
||||
[A-Za-z_][A-Za-z0-9_]* {
|
||||
return yy::parser::make_IDENTIFIER(yytext, this->location);
|
||||
}
|
||||
@ -155,15 +158,12 @@ sizeof {
|
||||
return yy::parser::make_CHARACTER(std::string(&character, 1), this->location);
|
||||
}
|
||||
'\\[0nabtfrv\\'"?]' {
|
||||
std::optional<char> escape = elna::boot::escape_char(yytext[2]);
|
||||
if (escape.has_value())
|
||||
{
|
||||
return yy::parser::make_CHARACTER(std::string(&escape.value(), 1), this->location);
|
||||
}
|
||||
else
|
||||
char escape = elna::boot::escape_char(yytext[2]);
|
||||
if (escape == escape_invalid_char)
|
||||
{
|
||||
REJECT;
|
||||
}
|
||||
return yy::parser::make_CHARACTER(std::string(&escape, 1), this->location);
|
||||
}
|
||||
\"[[:print:]]*\" {
|
||||
std::string result;
|
||||
@ -191,15 +191,12 @@ sizeof {
|
||||
{
|
||||
++current_position;
|
||||
|
||||
std::optional<char> escape = elna::boot::escape_char(*current_position);
|
||||
if (escape.has_value())
|
||||
{
|
||||
result.push_back(escape.value());
|
||||
}
|
||||
else
|
||||
char escape = elna::boot::escape_char(*current_position);
|
||||
if (escape == elna::boot::escape_invalid_char)
|
||||
{
|
||||
REJECT;
|
||||
}
|
||||
result.push_back(escape);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user