Allow comparing all pointer types to nil
This commit is contained in:
@ -111,23 +111,14 @@
|
||||
%type <elna::boot::cast_expression *> cast_expression;
|
||||
%%
|
||||
program:
|
||||
type_part constant_part variable_part procedure_part BEGIN_BLOCK optional_statements END_BLOCK DOT
|
||||
constant_part type_part variable_part procedure_part BEGIN_BLOCK optional_statements END_BLOCK DOT
|
||||
{
|
||||
std::vector<elna::boot::definition *> definitions($1.size() + $4.size());
|
||||
std::vector<elna::boot::definition *>::iterator definition = definitions.begin();
|
||||
auto tree = new elna::boot::program(elna::boot::make_position(@5));
|
||||
|
||||
for (auto type : $1)
|
||||
{
|
||||
*definition++ = type;
|
||||
}
|
||||
for (auto procedure : $4)
|
||||
{
|
||||
*definition++ = procedure;
|
||||
}
|
||||
auto tree = new elna::boot::program(elna::boot::make_position(@5), std::move(definitions));
|
||||
|
||||
std::swap(tree->constants, $2);
|
||||
std::swap(tree->constants, $1);
|
||||
std::swap(tree->types , $2);
|
||||
std::swap(tree->variables, $3);
|
||||
std::swap(tree->procedures, $4);
|
||||
std::swap(tree->body, $6);
|
||||
|
||||
driver.tree.reset(tree);
|
||||
|
Reference in New Issue
Block a user