This commit is contained in:
iko 2024-05-17 23:30:50 +03:00
parent 9054a6736b
commit 996ab8bc20
Signed by untrusted user: iko
GPG Key ID: 82C257048D1026F2
2 changed files with 42 additions and 3 deletions

View File

@ -532,17 +532,51 @@
==
:: Blok
::
+$ blok (lest stat)
+$ blok [body=(lest stat) ret=(unit ret)]
++ print-blok
|= [=blok]
^- tape
%- zing
%+ join "\0a"
(turn blok print-stat)
%+ weld
(turn body.blok print-stat)
?~ ret.blok ~
~[(print-ret u.ret.blok)]
++ parse-blok
%+ knee *blok
|.
(most wss parse-stat)
;~ plug
(most wss parse-stat)
::
%- punt
;~ pfix
wss
parse-ret
==
==
:: ret
::
+$ ret exprlist
++ print-ret
|= =ret
^- tape
%- zing
:~
"return "
(print-exprlist ret)
==
++ parse-ret
%+ knee *ret
|.
%+ cook
|= [[* =exprlist] *] exprlist
;~ plug
;~ (glue wss)
(jest 'return')
parse-exprlist
==
(punt (just ';'))
==
:: Helpers
::
++ commaed

View File

@ -44,3 +44,8 @@ foo = {
3.0, 3.1416, 314.16e-2, 0.31416E1, 34e1,
0x0.1E, 0xA23p-4, 0xA23p-4, 0X1.921FB54442D18P+1, 0x1.fp10
}
do
foo = 1
return 8, foo;
end