Skip to content

alago1/mock_lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mock language

A very simple interpreter written in Rust for learning purposes. The only dependency is on the Rust standard lib and lazy_static crate for a single line.

Examples

Variables

x = 1
y = 2
z = (x + y) / 2
w = (x, y, 3*z, 5)

Functions

func add(x, y) {
    return x + y
}

print(add(1, 2))

If statements

a = true
if (a) {
    print("a is true")
} else {
    print("a is false")
}

Lists

a = (1, 2, 3)
b = (4, 5)
a + b   (new concatenated list)
a | b   (extend list a with b's data)
a@1     (access index)
a@1 = 4 (assign to index)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages