Add block scoping and statement/expression distinction
Implement strict block scoping and distinguish between statements and expressions. This change introduces hierarchical scopes for functions and blocks, enforces that `def` is a statement with no return value, and prevents statements from appearing in expression positions or as the last element of a block. A new example `design-flaw.myc` is added to demonstrate the uninitialized variable issue solved by these changes.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
(do
|
||||
(do
|
||||
(def x "hh")
|
||||
(if false (def x "hh"))
|
||||
)
|
||||
(print x)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user