mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-31 19:28:15 +00:00
type_check_visitor fixes, array access and function call syntax change
This commit is contained in:
parent
f7080ba856
commit
c1dec6a0d1
16 changed files with 426 additions and 311 deletions
|
|
@ -1,29 +1,29 @@
|
|||
decl flow_control_test : Unit -> Unit
|
||||
def flow_control_test = {
|
||||
if ((a < b) || (a == b)) && (b < c) then IO.print x
|
||||
if ((a < b) || (a == b)) && (b < c) then IO.print: x
|
||||
elif x < 0 then {
|
||||
; ++x
|
||||
; IO.print y
|
||||
; IO.print: y
|
||||
} else {
|
||||
return {}
|
||||
}
|
||||
|
||||
while (a > 0) && (!array.is_empty ()) do {
|
||||
while (a > 0) && (!array.is_empty:) do {
|
||||
; --a
|
||||
; array->pop
|
||||
; array.pop:
|
||||
}
|
||||
|
||||
while x < 10 do
|
||||
x += x + 3
|
||||
|
||||
for i in 0..y do {
|
||||
; IO.print i
|
||||
; IO.print: i
|
||||
}
|
||||
|
||||
for & i & j in (& 0..y & 0..k) do {
|
||||
; IO.print 1
|
||||
; IO.print 2
|
||||
; IO.print 128
|
||||
; IO.print: 1
|
||||
; IO.print: 2
|
||||
; IO.print: 128
|
||||
}
|
||||
|
||||
loop {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue