commit 655827f6727939a4c073d9895c26e84d7438d3a9 Author: Kayne Ruse Date: Sat Oct 19 21:08:09 2024 +1100 Initial commit with a few basic files diff --git a/README.md b/README.md new file mode 100644 index 0000000..5cb2266 --- /dev/null +++ b/README.md @@ -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). + diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..ccf3c08 --- /dev/null +++ b/docs/index.md @@ -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) + diff --git a/docs/operators.md b/docs/operators.md new file mode 100644 index 0000000..75d0193 --- /dev/null +++ b/docs/operators.md @@ -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. | + + diff --git a/docs/reserved-words.md b/docs/reserved-words.md new file mode 100644 index 0000000..1b77c7c --- /dev/null +++ b/docs/reserved-words.md @@ -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 +``` +