Add semicolons back
This commit is contained in:
@ -126,7 +126,9 @@ along with GCC; see the file COPYING3. If not see
|
||||
%type <elna::boot::variable_declaration *> formal_parameter
|
||||
%type <std::shared_ptr<elna::boot::top_type>> type_expression;
|
||||
%type <elna::boot::traits_expression *> traits_expression;
|
||||
%type <elna::boot::expression *> expression operand unary;
|
||||
%type <elna::boot::expression *> expression operand;
|
||||
%type <elna::boot::unary_expression *> unary_expression;
|
||||
%type <elna::boot::binary_expression *> binary_expression;
|
||||
%type <std::vector<elna::boot::expression *>> expressions actual_parameter_list;
|
||||
%type <elna::boot::designator_expression *> designator_expression;
|
||||
%type <elna::boot::assign_statement *> assign_statement;
|
||||
@ -321,8 +323,11 @@ operand:
|
||||
| call_expression { $$ = $1; }
|
||||
| "(" expression ")" { $$ = $2; }
|
||||
expression:
|
||||
unary { $$ = $1; }
|
||||
| expression "*" expression
|
||||
unary_expression { $$ = $1; }
|
||||
| binary_expression { $$ = $1; }
|
||||
| operand { $$ = $1; }
|
||||
binary_expression:
|
||||
expression "*" expression
|
||||
{
|
||||
$$ = new elna::boot::binary_expression(elna::boot::make_position(@2), $1, $3,
|
||||
elna::boot::binary_operator::multiplication);
|
||||
@ -402,7 +407,7 @@ expression:
|
||||
$$ = new elna::boot::binary_expression(elna::boot::make_position(@2), $1, $3,
|
||||
elna::boot::binary_operator::shift_right);
|
||||
}
|
||||
unary:
|
||||
unary_expression:
|
||||
"@" operand
|
||||
{
|
||||
$$ = new elna::boot::unary_expression(elna::boot::make_position(@1), $2,
|
||||
@ -418,7 +423,6 @@ unary:
|
||||
$$ = new elna::boot::unary_expression(elna::boot::make_position(@1), $2,
|
||||
elna::boot::unary_operator::minus);
|
||||
}
|
||||
| operand { $$ = $1; }
|
||||
expressions:
|
||||
expression "," expressions
|
||||
{
|
||||
@ -449,11 +453,15 @@ statement:
|
||||
| if_statement { $$ = $1; }
|
||||
| call_expression { $$ = $1; }
|
||||
statements:
|
||||
statement statements
|
||||
statement ";" statements
|
||||
{
|
||||
std::swap($$, $2);
|
||||
std::swap($$, $3);
|
||||
$$.emplace($$.cbegin(), $1);
|
||||
}
|
||||
| statement
|
||||
{
|
||||
$$.push_back($1);
|
||||
}
|
||||
| /* no statements */ {}
|
||||
statement_part:
|
||||
"begin" statements { std::swap($$, $2); }
|
||||
@ -520,15 +528,14 @@ constant_definition: identifier_definition "=" literal
|
||||
$$ = new elna::boot::constant_definition(elna::boot::make_position(@1), $1.first, $1.second, $3);
|
||||
}
|
||||
constant_definitions:
|
||||
constant_definition constant_definitions
|
||||
constant_definition ";" constant_definitions
|
||||
{
|
||||
std::swap($$, $2);
|
||||
std::swap($$, $3);
|
||||
$$.emplace($$.cbegin(), std::move($1));
|
||||
}
|
||||
| constant_definition { $$.emplace_back(std::move($1)); }
|
||||
| /* no constant definitions */ {}
|
||||
constant_part:
|
||||
/* no constant definitions */ {}
|
||||
| "const" {}
|
||||
{}
|
||||
| "const" constant_definitions { std::swap($$, $2); }
|
||||
type_definition: identifier_definition "=" type_expression
|
||||
{
|
||||
|
Reference in New Issue
Block a user