This repository has been archived on 2024-02-27. You can view files and clone it, but cannot push or open issues or pull requests.
arf/tests/parser/func/main.arf

135 lines
1.5 KiB
Plaintext
Raw Normal View History

:arf
---
2022-08-25 13:46:35 -06:00
func ro aBasicExternal
> someInput:Int:mut
2022-09-27 12:17:15 -06:00
< someOutput:Int 4
---
external
2022-08-25 13:46:35 -06:00
func ro bMethod
@ bird:{Bird}
> someInput:Int:mut
2022-09-27 12:17:15 -06:00
< someOutput:Int 4
---
external
func ro cBasicPhrases
---
fn 329 983 07
[fn 329 983 07]
[fn
329
983
071]
fn [gn
329 983
071] 123
func ro dArgumentTypes
---
2022-10-04 15:13:08 -06:00
[bird tree butterfly.wing 'hello world'
grass:Int:mut:8]
func ro eMath
> x:Int
> y:Int
< z:Int
---
++ x
-- y
2022-09-03 18:32:27 -06:00
= z [+ [* 0372 00] 98 x [/ 9832 y] 930]
2022-09-03 18:32:27 -06:00
== 4 4
! true
~ 0b01
~= x
% 873 32
= 5 5
!= 4 4
<= 4 98
< 4 98
<< 0x0F 4
<<= x 4
>= 98 4
> 98 4
>> 0xF0 4
>>= x 4
2022-08-25 13:46:35 -06:00
| 0b01 0b10
|= x 0b10
& 0b110 0b011
&= x 0b011
&& true true
|| true false
func ro fReturnDirection
< err:Error
---
someFunc 498 2980 90 -> thing:Int err
otherFunc -> thing err:Error
[fn
329
983
071] -> thing:Int err
func ro gControlFlow
---
defer
something
otherThing
if condition
something
if condition
something
elseif
[otherThing]
else
finalThing
while [< x 432]
something
switch value
: 324
something
[: 93284]
otherThing
: 9128 34738 7328
multipleCases
:
[defaultThing]
for index:Size element:Int someArray
something
someNextThing
justMakingSureBlockParsingWorks
[if condition]
if condition
nestedThing
else
otherThing
else
if condition
nestedThing
else
otherThing
2022-09-29 00:18:47 -06:00
func ro hDataInit
---
= x:Int 3
# loc is a reference, similar to * in C
= y:{Int} [loc x]
= z:Int:8 (398 9 2309 983 -2387
2022-09-27 12:17:15 -06:00
478 555 123)
= bird:Bird (
2022-09-27 12:17:15 -06:00
(99999)
324)