Allow enumeration field types
This commit is contained in:
@@ -10,6 +10,7 @@ program;
|
||||
(* - true and false boolean literals. *)
|
||||
(* - the number of local variables is not limited. *)
|
||||
(* - #size(T). *)
|
||||
(* - Support enumerations as record field type. *)
|
||||
|
||||
type
|
||||
(**
|
||||
@@ -2032,9 +2033,6 @@ var
|
||||
result: ^ElnaTreeTraitExpression;
|
||||
token_kind: Word;
|
||||
begin
|
||||
printf("# Comment\n\0");
|
||||
fflush(nil);
|
||||
|
||||
result := malloc(ElnaTreeTraitExpression_size());
|
||||
result^.kind := ElnaTreeKind.trait_expression;
|
||||
|
||||
@@ -2709,14 +2707,14 @@ begin
|
||||
elsif parser_node^.kind = ElnaTreeKind.field_access_expression then
|
||||
field_access_expression := parser_node;
|
||||
expression_type := field_access_expression^.type_decoration;
|
||||
designator_base := field_access_expression^.aggregate;
|
||||
aggregate_type := designator_base^.type_decoration;
|
||||
|
||||
if expression_type^.kind = ElnaTypeKind.enumeration then
|
||||
if aggregate_type = nil then
|
||||
first_instruction := elna_tac_enumeration_value(field_access_expression, operand_type, operand_value, operand_length);
|
||||
is_address^ := 0
|
||||
else
|
||||
designator_base := field_access_expression^.aggregate;
|
||||
first_instruction := elna_tac_designator(designator_base, symbol_table, is_address, operand_type, operand_value, operand_length);
|
||||
aggregate_type := designator_base^.type_decoration;
|
||||
|
||||
field_count := aggregate_type^.length;
|
||||
current_field := aggregate_type^.members;
|
||||
|
||||
Reference in New Issue
Block a user