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/full/main.arf

36 lines
559 B
Plaintext
Raw Normal View History

2022-08-12 10:55:17 -06:00
:arf
author "Sasha Koshka"
license "GPLv3"
require "io"
---
# this is a global variable
2022-10-04 15:07:31 -06:00
data pv helloText:String 'Hello, world!'
2022-08-12 10:55:17 -06:00
# this is a struct definition
objt ro Greeter:Obj
2022-10-04 15:07:31 -06:00
rw text:String 'Hi.'
2022-08-12 10:55:17 -06:00
# this is a function
func ro main
> arguments:{String ..}
< status:Int 0
---
= greeter:Greeter:mut
greeter.setText helloText
greeter.greet
2022-08-12 10:55:17 -06:00
# this is a member function
func ro greet
@ greeter:{Greeter}
---
io.println greeter.text
2022-08-12 10:55:17 -06:00
# this is mutator member function
func ro setText
@ greeter:{Greeter}
> text:String
---
greeter.text.set text
2022-08-12 10:55:17 -06:00