Created basic test for parser

This commit is contained in:
2022-08-12 11:55:17 -05:00
parent f4f19a809a
commit 2019c67bbb
5 changed files with 93 additions and 3 deletions

View 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

View File

@@ -0,0 +1,6 @@
:arf
author "Sasha Koshka"
license "GPLv3"
require "someModule"
require "otherModule"
---