Sorted out some folders for the docs

This commit is contained in:
2023-02-16 21:44:06 +11:00
committed by GitHub
parent 329d085beb
commit 0b885d0a30
15 changed files with 30 additions and 65 deletions

View File

@@ -1,6 +1,6 @@
# Compiling Toy
This tutorial is a sub-section of [Embedding Toy](embedding-toy) that has been spun off into it's own page for the sake of brevity/sanity. It's recommended that you read the main article first.
This tutorial is a sub-section of [Embedding Toy](deep-dive/embedding-toy) that has been spun off into it's own page for the sake of brevity/sanity. It's recommended that you read the main article first.
The exact phases outlined here are entirely implementation-dependent - that is, they aren't required, and are simply how the canonical version of Toy works.

View File

@@ -1,6 +1,6 @@
# Embedding Toy
This tutorial assumes that you've managed to embed Toy into your program by following the tutorial [Building Toy](building-toy).
This tutorial assumes that you've managed to embed Toy into your program by following the tutorial [Building Toy](deep-dive/building-toy).
Here, we'll look at some ways in which you can utilize Toy's C API within your host program.

View File

@@ -41,24 +41,35 @@ print tally(); //3
# Getting Started
* [Quick Start Guide](quick-start-guide)
* [Types](types)
* [About Library](about-library)
* [Standard Library](standard-library)
* [Runner Library](runner-library)
* [Game Engine](game-engine)
# Full C API
* Coming Soon! (check out the [Embedding Toy](embedding-toy) page for a brief description for now)
* [Quick Start Guide](geting-started/quick-start-guide)
* [Types](geting-started/types)
* [About Library](geting-started/about-library)
* [Standard Library](geting-started/standard-library)
* [Runner Library](geting-started/runner-library)
* [Game Engine](geting-started/game-engine)
# Deep Dive
* [Theorizing Toy](theorizing-toy)
* [Building Toy](building-toy)
* [Embedding Toy](embedding-toy)
* [Compiling Toy](compiling-toy)
* [Developing Toy](developing-toy)
* [Testing Toy](testing-toy)
* [Roadmap](roadmap)
* [Theorizing Toy](deep-dive/theorizing-toy)
* [Building Toy](deep-dive/building-toy)
* [Embedding Toy](deep-dive/embedding-toy)
* [Compiling Toy](deep-dive/compiling-toy)
* [Developing Toy](deep-dive/developing-toy)
* [Testing Toy](deep-dive/testing-toy)
* [Roadmap](deep-dive/roadmap)
# Full C API
* [toy_ast_node.h]
* [toy_common.h]
* [toy_compiler.h]
* [toy_interpreter.h]
* [toy_lexer.h]
* [toy_literal_array.h]
* [toy_literal_dictionary.h]
* [toy_literal.h]
* [toy_memory.h]
* [toy_parser.h]
* [toy_refstring.h]
* [toy_scope.h]

View File

@@ -1,46 +0,0 @@
# Timer Library
The timer library offers a series of utility functions for generating and manipulating timers, which can be used for recording or initiating timed events. Please be aware that "timers" are opaque objects, which must be destroyed when you're done with them, otherwise you'll have a memory leak in your program.
These functions are implemented by the host program, so they may not all be provided by default.
The timer library can usually be accessed with the `import` keyword:
```
import timer;
```
## startTimer()
This function returns an `opaque` timer object, representing the point in time when the function was called.
## _stopTimer(self: opaque)
This function returns an `opaque` timer object, representing the duration between when the `self` argument was created, and when this function was called.
## createTimer(seconds: int, microseconds: int)
This function returns an `opaque` timer object, with seconds and microseconds set to the given values. To give a negative value between 0 and -1, give a negative value for microseconds (negative 0 is not a thing in Toy).
Please note that `microseconds` has upper and lower bounds of -1,000,000 to 1,000,000. Also, if seconds has a non-zero value, then microseconds has a lower bounds of 0 instead.
## _getTimerSeconds(self: opaque)
This function returns an integer value, representing the seconds value of the timer object.
## _getTimerMicroseconds(self: opaque)
This function returns an integer value, representing the seconds value of the timer object.
## _compareTimer(self: opaque, other: opaque)
This function returns an `opaque` timer object, representing the duration between the `self` and `other` arguments. The return value may be negative.
## _timerToString(self: opaque)
This function returns a string representation of the `self` argument, which can be casted into other basic [types](types).
## _destroyTimer(self: opaque)
This function cleans up the memory of the `self` timer object.