Created basic test for parser
This commit is contained in:
41
tests/parser/full/main.arf
Normal file
41
tests/parser/full/main.arf
Normal file
@@ -0,0 +1,41 @@
|
||||
:arf
|
||||
author "Sasha Koshka"
|
||||
license "GPLv3"
|
||||
require "io"
|
||||
---
|
||||
|
||||
# this is a global variable
|
||||
data wn helloText:String "Hello, world!"
|
||||
|
||||
# this is a struct definition
|
||||
type rr Greeter:Obj
|
||||
# "Hi." is a string constant. all Greeters will be initialized with a
|
||||
# pointer to it. I don't know really it depends on what I decide that
|
||||
# a String type even is.
|
||||
wr text:String "Hi."
|
||||
"sdfdsf" "ahh"
|
||||
"asdf"
|
||||
|
||||
# this is a function
|
||||
func rr main
|
||||
> argc:Int
|
||||
> argv:{String}
|
||||
< status:Int 0
|
||||
---
|
||||
let greeter:Greeter:mut
|
||||
greeter.setText helloText
|
||||
greeter.greet
|
||||
|
||||
# this is a member function
|
||||
func rr greet
|
||||
@ greeter:{Greeter}
|
||||
---
|
||||
io.println greeter.text
|
||||
|
||||
# this is mutator member function
|
||||
func rr setText
|
||||
@ greeter:{Greeter}
|
||||
> text:String
|
||||
---
|
||||
greeter.text.set text
|
||||
|
||||
6
tests/parser/meta/meta.arf
Normal file
6
tests/parser/meta/meta.arf
Normal file
@@ -0,0 +1,6 @@
|
||||
:arf
|
||||
author "Sasha Koshka"
|
||||
license "GPLv3"
|
||||
require "someModule"
|
||||
require "otherModule"
|
||||
---
|
||||
Reference in New Issue
Block a user