добавил встраиваемые поля в структуры
parent
9517568501
commit
82859598af
|
@ -419,7 +419,9 @@ func_declaration:
|
|||
// struct
|
||||
declarate_field_list:
|
||||
| arg_declaration
|
||||
| IDENTIFIER
|
||||
| declarate_field_list SEMICOLON arg_declaration
|
||||
| declarate_field_list SEMICOLON IDENTIFIER
|
||||
;
|
||||
|
||||
field:
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
type mile uint;
|
||||
type BinaryOp func(int, int) int;
|
||||
type text []string;
|
||||
|
||||
type empty struct{
|
||||
};
|
||||
|
@ -18,7 +19,8 @@ type person struct{
|
|||
};
|
||||
type person2 struct{
|
||||
name,second_name string;
|
||||
age int
|
||||
age int;
|
||||
person
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue