From 7d657b204d1f40c21a0db1dde48907750f94ffa4 Mon Sep 17 00:00:00 2001 From: serr Date: Tue, 20 May 2025 17:50:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=80=D0=B0=D0=B7=D0=BD=D1=8B=D0=B5=20=D1=81=D0=BF=D0=BE=D1=81?= =?UTF-8?q?=D0=BE=D0=B1=D1=8B=20=D0=B4=D0=B5=D0=BA=D0=BB=D0=B0=D1=80=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D0=B8=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D0=B5=D0=BB=D1=8C=D1=81=D0=BA=D0=B8=D1=85=20=D1=82?= =?UTF-8?q?=D0=B8=D0=BF=D0=BE=D0=B2=20=D1=81=D1=82=D1=80=D1=83=D0=BA=D1=82?= =?UTF-8?q?=D1=83=D1=80=20=D0=B8=20=D0=BE=D0=B1=D1=80=D0=B0=D1=89=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BA=20=D0=BF=D0=BE=D0=BB=D1=8E=20=D1=81?= =?UTF-8?q?=D1=82=D1=80=D1=83=D0=BA=D1=82=D1=83=D1=80=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analyzers/test/test.y | 1 + tests/main.go | 1 - tests/test_types.txt | 4 ++++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/analyzers/test/test.y b/analyzers/test/test.y index 50ab97f..67076c0 100644 --- a/analyzers/test/test.y +++ b/analyzers/test/test.y @@ -387,6 +387,7 @@ field_list: struct_literal: any_identifier LBRACE field_list RBRACE { printf("STRUCT LITERAL\n"); } + | any_identifier LBRACE math_expr_or_literals_list RBRACE { printf("STRUCT LITERAL\n"); } // // vars decl diff --git a/tests/main.go b/tests/main.go index 72c3a2b..bc21c4b 100644 --- a/tests/main.go +++ b/tests/main.go @@ -29,7 +29,6 @@ func ujas() (func() func() func() int, int, string) { func main() { a := "Tom" - fmt.Println(a) arr := []int{1, 2, 3} for idx, val := range arr { diff --git a/tests/test_types.txt b/tests/test_types.txt index 5555cb6..9dd6e47 100644 --- a/tests/test_types.txt +++ b/tests/test_types.txt @@ -19,6 +19,10 @@ type person struct{ func main() { + var p models.Person; + + p1 := models.Person{"Tom", 24}; + undefined := person {}; var alice person = person{age: 23, name: "Alice"};