Implement .max and .min type properties

This commit is contained in:
2025-02-16 07:53:31 +01:00
parent b358f8ba27
commit 67e3e97049
4 changed files with 186 additions and 184 deletions

View File

@ -89,12 +89,6 @@ const {
var {
return yy::parser::make_VAR(this->location);
}
array {
return yy::parser::make_ARRAY(this->location);
}
of {
return yy::parser::make_OF(this->location);
}
type {
return yy::parser::make_TYPE(this->location);
}

View File

@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see
%token <std::string> STRING "string"
%token <bool> BOOLEAN
%token IF WHILE DO THEN ELSE ELSIF RETURN
%token CONST VAR PROCEDURE ARRAY OF TYPE RECORD POINTER TO UNION
%token CONST VAR PROCEDURE TYPE RECORD POINTER TO UNION
%token BEGIN_BLOCK END_BLOCK EXTERN DEFER
%token LEFT_PAREN RIGHT_PAREN LEFT_SQUARE RIGHT_SQUARE SEMICOLON DOT COMMA
%token AND OR NOT CAST SHIFT_LEFT SHIFT_RIGHT
@ -414,9 +414,9 @@ statement:
}
| defer_statement { $$ = $1; }
statements:
statement SEMICOLON statements
statement statements
{
std::swap($$, $3);
std::swap($$, $2);
$$.emplace($$.cbegin(), $1);
}
| statement { $$.push_back($1); }
@ -433,7 +433,7 @@ field_list:
}
| field_declaration { $$.emplace_back($1); }
type_expression:
ARRAY INTEGER OF type_expression
LEFT_SQUARE INTEGER RIGHT_SQUARE type_expression
{
$$ = std::make_shared<elna::boot::array_type>(elna::boot::make_position(@1), $4, $2);
}