mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-15 19:38:44 +00:00
operator prescendence added
This commit is contained in:
parent
93ac5f8e33
commit
e62144feac
11 changed files with 328 additions and 26 deletions
|
|
@ -1,33 +1,32 @@
|
|||
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
|
||||
; x += 1
|
||||
; IO.print: y
|
||||
} else {
|
||||
return {}
|
||||
}
|
||||
|
||||
while (a > 0) && (!array.is_empty:) do {
|
||||
; --a
|
||||
while (a > 0) && not: (array.is_empty:) do {
|
||||
; a -= 1
|
||||
; array.pop:
|
||||
}
|
||||
|
||||
while x < 10 do
|
||||
x += x + 3
|
||||
while x < 10 do x +=. x + 3
|
||||
|
||||
for i in 0..y do {
|
||||
for i in 0--y do {
|
||||
; IO.print: i
|
||||
}
|
||||
|
||||
for & i & j in (& 0..y & 0..k) do {
|
||||
for & i & j in & 0--y & 0--k do { // ??
|
||||
; IO.print: 1
|
||||
; IO.print: 2
|
||||
; IO.print: 128
|
||||
}
|
||||
|
||||
loop {
|
||||
; ++y
|
||||
; y += 1
|
||||
if y > 100 then
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue