нет возможности вне функций создавать лекс.блоки и выражения

master
serr 2025-05-13 19:20:47 +03:00
parent ede96376b3
commit c2effad863
2 changed files with 4 additions and 4 deletions

View File

@ -42,10 +42,8 @@ program:
; ;
statement: statement:
expr SEMICOLON
| var_declaration SEMICOLON | var_declaration SEMICOLON
| func_declaration | func_declaration
| block
; ;
block: block:
@ -54,6 +52,8 @@ block:
statements_list: statements_list:
| statements_list statement | statements_list statement
| statements_list block
| statements_list expr SEMICOLON
; ;
expr: expr:

View File

@ -15,8 +15,8 @@ func func_without_return_type(a string) {
return a; return a;
} }
a := 1 + 2; func main() {
{
a := 229.162613; a := 229.162613;