mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-15 19:38:44 +00:00
grammar refactoring: build_visitor fixed & visitors tested
This commit is contained in:
parent
3c2d496a85
commit
e4802896bd
35 changed files with 118128 additions and 91770 deletions
|
|
@ -1,22 +1,14 @@
|
|||
decl flow_control_test : Unit -> Unit
|
||||
def flow_control_test = {
|
||||
// if && || a < b
|
||||
// || a == b
|
||||
// && b < c
|
||||
// && c > 10
|
||||
|
||||
if ((a < b) || (a == b)) && (b < c)
|
||||
then IO.print x
|
||||
elif x < 0
|
||||
then {
|
||||
if ((a < b) || (a == b)) && (b < c) then IO.print x
|
||||
elif x < 0 then {
|
||||
; ++x
|
||||
; IO.print y
|
||||
} else {
|
||||
return {}
|
||||
}
|
||||
|
||||
while (a > 0) && (!array.is_empty)
|
||||
do {
|
||||
while (a > 0) && (!array.is_empty) do {
|
||||
; --a
|
||||
; array.pop
|
||||
}
|
||||
|
|
@ -28,9 +20,7 @@ def flow_control_test = {
|
|||
; IO.print i
|
||||
}
|
||||
|
||||
for & i & j
|
||||
in (& 0..y & 0..k)
|
||||
do { // TODO: decide ??? does it work (like auto zip) ???
|
||||
for & i & j in (& 0..y & 0..k) do {
|
||||
; IO.print 1
|
||||
; IO.print 2
|
||||
; IO.print 128
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue