diff --git a/_c_api/output.md b/_c_api/output.md deleted file mode 100644 index 6e3b426..0000000 --- a/_c_api/output.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -layout: page ---- - -Watch this space. \ No newline at end of file diff --git a/_c_api/parser.md b/_c_api/parser.md deleted file mode 100644 index 6e3b426..0000000 --- a/_c_api/parser.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -layout: page ---- - -Watch this space. \ No newline at end of file diff --git a/_config.yml b/_config.yml index 5f0e1d3..33611e8 100644 --- a/_config.yml +++ b/_config.yml @@ -2,25 +2,3 @@ title: The Toy Programming Language description: Documentation For The Toy Programming Language keywords: programming,coding author: Kayne Ruse (Ratstail91) - -collections: - getting_started: - output: true - title: Getting Started - permalink: "/:collection/:path/" - tab-order: 1 - toy_api: - output: true - title: Toy API - permalink: "/:collection/:path/" - tab-order: 2 - c_api: - output: true - title: C API - permalink: "/:collection/:path/" - tab-order: 3 - -plugins: - - jekyll-remote-theme - -remote_theme: pixeldroid/programming-pages diff --git a/_getting_started/contributions.md b/_getting_started/contributions.md deleted file mode 100644 index 17f0fe7..0000000 --- a/_getting_started/contributions.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -layout: page -title: Contributions -order: 4 ---- - -Watch this space. diff --git a/_getting_started/quick-start-guide.md b/_getting_started/quick-start-guide.md deleted file mode 100644 index 9c7dad2..0000000 --- a/_getting_started/quick-start-guide.md +++ /dev/null @@ -1,133 +0,0 @@ ---- -layout: page -title: Toy v2 Quick-Start Guide -order: 1 ---- - -# Toy v2 Quick-Start Guide - -To help you start using Toy as fast as possible, here are the most useful elements of the language. Not everything available is listed, but this should let you start coding right away. - -## Keyword 'print' - -The `print` keyword takes one value as a parameter, which is sent to stdout by default, or can be redirected elsewhere using the [output C API](/c_api/output). - -``` -print "Hello World!"; -``` - -## Keyword 'assert' - -The `assert` keyword takes two values as parameters, separated by a comma. If the first value is falsy or `null`, the optional second parameter is sent to stderr by default, or can be redirected elsewhere using the [output C API](/c_api/output). If no second parameter is provided, a generic message is used instead. - -An option to disable the `assert` keyword during compilation is provided in the [parser C API](/c_api/parser). - -``` -//nothing happens -assert 1 < 2; - -//this assert will fail, and output the second parameter -assert null, "Hello world!"; -``` - -## Variables and Types - -Values can be stored in variables, by specifying a name with the `var` keyword. The name can be declared with an optional type, which restricts the type of value that can be stored in the name. If no type is specified, `any` is used instead. - -``` -var answer = 42; - -var question: string = "How many roads must a man walk down?"; -``` - -To make a variable immutable, you can add the `const` keyword after the type when it's declared. If you do, it must be assigned a value. - -``` -var quote: string const = "War. War never changes."; -``` - -The types available in Toy are: - -| type | name | description | -| --- | --- | --- | -| `bool` | boolean | Either `true` or `false`. | -| `int` | integer | Any whole number (32-bits). | -| `float` | float | A decimal number (32-bits), using floating-point arithmetic. | -| `string` | string | A piece of text, supports UTF-8, [in theory](https://github.com/krgamestudios/Toy/issues/174). | -| `array` | array | A series of values stored sequentially in memory. | -| `table` | table | A series key-value pairs stored in such a way that allows for fast lookups. Booleans, functions, opaques and `null` can't be used as keys. | -| `function` | function | A chunk of reusable code that takes zero or more parameters, and returns zero or more results. Functions are declared with the `fn` keyword. | -| `opaque` | opaque | This value is unusable in the script, but can be passed from one imported function to another. | -| `any` | any | The default type when nothing is specified. Theis can hold any value. | - -*Note: Arrays, tables, functions and opaques are not fully implemented at the time of writing, so details may change.* - -## Control Flow - -Choosing an option, or repeating a chunk of code multiple times, is essential for any general purpose language. - -Choosing between two options can be done with the `if-then-else` else statement. If the condition is truthy, the 'then-branch' will be executed. Otherwise, the optional 'else-branch' is executed instead. - -``` -var answer = 42; - -if (answer < 56) { - print "Cod dang it!"; -} -else { - print "Something's fishy here..."; -} -``` - -``` -var challenge = "hard"; - -if (challenge == "hard") { - print "I choose to build a scripting language, not because it's easy, but because it's hard!"; -} - -//the else-branch is optional -``` - -To repeat a certain action, use the `while-then` loop, which repeats the body as long as the condition is true at the beginning of each loop. - -``` -var loops = 0; - -while (loops++ < 8) { - print "These episodes are endless."; -} -``` - -To break out of a loop, you can use the `break` keyword. Alternatively, to restart the loop early, use the `continue` keyword. - -``` -var loops = 0; - -while (true) { - if (++loops < 15532) { - continue; - } - - break; //poor yuki ;_; -} -``` - -*Note: The `for` loop is coming, eventually, but isn't vital right now.* - -## Arrays and Tables - -Watch this space. - -## Functions - -Watch this space. - -## External Libraries and Extending Toy - -Watch this space. - -## Reserved Keywords & Operators - -Watch this space. - diff --git a/_getting_started/syntax-guide.md b/_getting_started/syntax-guide.md deleted file mode 100644 index d7fd5d7..0000000 --- a/_getting_started/syntax-guide.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -layout: page -title: Syntax Guide -order: 2 ---- - -Watch this space. diff --git a/_getting_started/tools.md b/_getting_started/tools.md deleted file mode 100644 index 5c8215e..0000000 --- a/_getting_started/tools.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -layout: page -title: Tools Guide -order: 3 ---- - -Watch this space. diff --git a/_includes/elements/analytics.html b/_includes/analytics.html similarity index 100% rename from _includes/elements/analytics.html rename to _includes/analytics.html diff --git a/_includes/elements/attribution.html b/_includes/elements/attribution.html deleted file mode 100644 index dc24e92..0000000 --- a/_includes/elements/attribution.html +++ /dev/null @@ -1,17 +0,0 @@ -
|
-
-
-
- Available On GitHub
- |
-
| - GH Pages Theme adapted from Programming Pages. - | -
🐔
-