Initial commit
This commit is contained in:
commit
ff01213da4
22
.gitignore
vendored
Normal file
22
.gitignore
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
# If you prefer the allow list template instead of the deny list, see community template:
|
||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
||||
#
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
/arfc/arfc
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
|
||||
# Go workspace file
|
||||
go.work
|
3
examples/basic/main.arf
Normal file
3
examples/basic/main.arf
Normal file
@ -0,0 +1,3 @@
|
||||
:arf
|
||||
|
||||
func rr main
|
41
examples/full/main.arf
Normal file
41
examples/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
|
||||
|
11
examples/tokens/general.arf
Normal file
11
examples/tokens/general.arf
Normal file
@ -0,0 +1,11 @@
|
||||
:arf
|
||||
require io
|
||||
---
|
||||
|
||||
func rr main
|
||||
> argc:Int
|
||||
> argv:{String}
|
||||
< status:Int
|
||||
---
|
||||
io.println [io.readln]
|
||||
= status 0
|
13
examples/tokens/literals.arf
Normal file
13
examples/tokens/literals.arf
Normal file
@ -0,0 +1,13 @@
|
||||
:arf
|
||||
---
|
||||
|
||||
data:{Int 6}
|
||||
-39480 398 29 0x3AFe3 0b10001010110 0o666
|
||||
|
||||
func rr literals
|
||||
---
|
||||
= stringLiteral:String "skadjlsakdj"
|
||||
= intArrayLiteral:{Int 3} 2398
|
||||
-2938 324
|
||||
= runeLiteral:Rune 'a'
|
||||
= floatArrayLiteral:{F64 5} 3248.23 0.324 -94.29
|
Reference in New Issue
Block a user