mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-04 00:56:31 +02:00
Add proper docs
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# YesNt Documentation
|
||||
|
||||
YesNt is a line-based, interpreted scripting language inspired by assembly.
|
||||
Each line is one statement. There are no multi-line expressions.
|
||||
|
||||
## Guides
|
||||
|
||||
| Document | Description |
|
||||
| ------------------------------------------- | ---------------------------------------------------- |
|
||||
| [Language Reference](language-reference.md) | Every statement, token, and operator in the language |
|
||||
| [Library API](library-api.md) | How to embed the interpreter in a C# project |
|
||||
| [Editor](editor.md) | How to use the terminal code editor |
|
||||
|
||||
## Quick start
|
||||
|
||||
### Running a script from the command line
|
||||
|
||||
```bash
|
||||
dotnet run --project YesNt.Interpreter.App -- path/to/script.ynt
|
||||
```
|
||||
|
||||
### Hello world
|
||||
|
||||
```ynt
|
||||
print_line Hello, world!
|
||||
```
|
||||
|
||||
### Variables and output
|
||||
|
||||
```ynt
|
||||
var name = Alice
|
||||
print_line Hello, ${name}!
|
||||
```
|
||||
|
||||
### Functions
|
||||
|
||||
```ynt
|
||||
func greet:
|
||||
var msg = Hello, ${name}!
|
||||
print_line ${msg}
|
||||
return
|
||||
|
||||
var name = Bob
|
||||
call greet
|
||||
```
|
||||
|
||||
Script files use the `.ynt` extension by convention.
|
||||
Reference in New Issue
Block a user