Initial commit with a few basic files

This commit is contained in:
2024-10-19 21:08:09 +11:00
commit 655827f672
4 changed files with 97 additions and 0 deletions

6
README.md Normal file
View File

@@ -0,0 +1,6 @@
This git branch is the documentation and specification for The Toy Programming Language version 2.x, which can be found at [https://github.com/Ratstail91/Toy](https://github.com/Ratstail91/Toy).
Toy v2.x is still under active development, so this documentation will change and evolve over time, and may not reflect the current reference implementation.
The docs can be found [here](docs/index.md).

11
docs/index.md Normal file
View File

@@ -0,0 +1,11 @@
# Introduction
[![Continuous Integration v2.x](https://github.com/Ratstail91/Toy/actions/workflows/continuous-integration-v2.yml/badge.svg)](https://github.com/Ratstail91/Toy/actions/workflows/continuous-integration-v2.yml)
The Toy Programming Language is an imperative, bytecode-interpreted, embeddable scripting language. Rather than functioning independently, it serves as part of another program, the "host". This design allows for straightforward customization by both the host's developers and end users, achieved by exposing program logic through text files.
The reference implementation can be found on [GitHub](https://github.com/Ratstail91/Toy).
[Reserved Words](reserved-words.md)
[Operators](operators.md)

40
docs/operators.md Normal file
View File

@@ -0,0 +1,40 @@
# Operators
The following table lists the recognized operators, and their uses.
| Symbol | Description |
| --- | --- |
| `+` | Add. TODO |
| `-` | Subtract. TODO |
| `*` | Multiply. TODO |
| `/` | Divide. TODO |
| `%` | Modulo. TODO |
| `=` | Assign. TODO |
| `+=` | Add Assign. TODO |
| `-=` | Subtract Assign. TODO |
| `*=` | Multiply Assign. TODO |
| `/=` | Divide Assign. TODO |
| `%=` | Modulo Assign. TODO |
| `++` | Increment. TODO |
| `--` | Decrement. TODO |
| `==` | Compare Equal. TODO |
| `!=` | Compare Not Equal. TODO |
| `<` | Compare Less. TODO |
| `<=` | Compare Less Equal. TODO |
| `>` | Compare Greater. TODO |
| `>=` | Compare Greater Equal. TODO |
| `(` `)` | Parenthesis. TODO |
| `[` `]` | Brackets. TODO |
| `{` `}` | Braces. TODO |
| `&&` | And. TODO |
| `\|\|` | Or. TODO |
| `!` | Not. TODO |
| `?` `:` | Ternary. TODO |
| `:` | Colon. TODO |
| `.` | Dot. TODO |
| `..` | Concatenate. TODO |
| `...` | Rest. TODO |
| `&` | Ampersand. Not used. |
| `\|` | Pipe. Not used. |

40
docs/reserved-words.md Normal file
View File

@@ -0,0 +1,40 @@
# Reserved Words
The following list of words have special meaning to the language, so they can't be used as names for variables or functions.
```txt
any
as
assert
bool
break
class
const
continue
do
else
export
false
float
fn
for
foreach
if
import
in
int
null
of
opaque
print
return
string
true
type
typeas
typeof
var
while
yield
```