Revert "Revert "changes for new grammar, fixes""

This reverts commit 03dea59d33.
This commit is contained in:
ProgramSnail 2023-06-08 16:43:23 +03:00
parent 03dea59d33
commit 92a6100349
10 changed files with 59 additions and 5 deletions

View file

@ -106,10 +106,10 @@ namespace var \div {
typeclass \eq =
& var ( == ) : \eq -> \bool
& var ( != ) : \eq -> \bool
& var ( <> ) : \eq -> \bool
namespace var \eq {
def ( != ) : x = not: (self == x)
def ( <> ) : x = not: (self == x)
}
//

11
tests/variables.lang Normal file
View file

@ -0,0 +1,11 @@
decl test-variables : \int -> \unit
def test-variables : a = {
var x = if a < 123 then "aaa" else "bbb"
var y = 543.32 in do-something:
var z = 543.32 in {
for x in 1--10 do print: 111
if scan:[int] < 11 then do-something-another: z "aaa"
}
}