добавил встраиваемые поля в структуры

master2
serr 2025-05-20 20:52:31 +03:00
parent 9517568501
commit 82859598af
2 changed files with 5 additions and 1 deletions

View File

@ -419,7 +419,9 @@ func_declaration:
// struct // struct
declarate_field_list: declarate_field_list:
| arg_declaration | arg_declaration
| IDENTIFIER
| declarate_field_list SEMICOLON arg_declaration | declarate_field_list SEMICOLON arg_declaration
| declarate_field_list SEMICOLON IDENTIFIER
; ;
field: field:

View File

@ -8,6 +8,7 @@ import (
type mile uint; type mile uint;
type BinaryOp func(int, int) int; type BinaryOp func(int, int) int;
type text []string;
type empty struct{ type empty struct{
}; };
@ -18,7 +19,8 @@ type person struct{
}; };
type person2 struct{ type person2 struct{
name,second_name string; name,second_name string;
age int age int;
person
}; };