From 2cf7dc12349d50ccb2b85e9db2840f763eedd6dc Mon Sep 17 00:00:00 2001 From: TudbuT Date: Mon, 23 May 2022 12:43:31 +0200 Subject: [PATCH] fix docs --- docs/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/README.md b/docs/README.md index 3f02531..4dd1a55 100644 --- a/docs/README.md +++ b/docs/README.md @@ -70,16 +70,16 @@ To forcefully set the type of an object (this can cause errors if the instance o ## Keywords -- native : Used to import a native function from the interpreter -- func : Used to define a function -- def : Used to define a variable. To use it, the functions ` ::: -> a WHERE a=value` and `= ::: a -> WHERE a=newValue` are generated. -- if : Used to run only if the (popped) value from the top of the stack is truthy -- while : Runs and checks if popped value is truthy. If so, is run. This process is repeated until it is no longer truthy. -- stop: Pops a value, and exits as many blocks as the popped value. -- try : Pops a string or array of strings, and catches any of the errors that these strings match, pushing the error and its message when running the catch block. The catch block is only run if there is an error. -- do : Runs block, and, no matter what, runs the finally block aswell, regardless of any errors in the main block. This is similar to try, but does not need error types to be on the stack, and does neither catch nor push the error if one is thrown. +- `native `: Used to import a native function from the interpreter +- `func `: Used to define a function +- `def `: Used to define a variable. To use it, the functions ` ::: -> a WHERE a=value` and `= ::: a -> WHERE a=newValue` are generated. +- `if `: Used to run block only if the (popped) value from the top of the stack is truthy +- `while `: Runs condition block and checks if popped value is truthy. If so, code block is run. This process is repeated until it is no longer truthy. +- `stop`: Pops a value, and exits as many blocks as the popped value. +- `try `: Pops a string or array of strings, and catches any of the errors that these strings match, pushing the error and its message when running the catch block. The catch block is only run if there is an error. +- `do `: Runs block, and, no matter what, runs the finally block aswell, regardless of any errors in the main block. This is similar to try, but does not need error types to be on the stack, and does neither catch nor push the error if one is thrown. - `{` (yes, this is a keyword name): Reads code until it hits the matching close bracket, pushes an anonymous function onto the stack, able to be called with `fcall ::: a -> WHERE a=function`. -- fork : Runs in a new thread. -- construct <...>: Explained above. +- `fork `: Runs in a new thread. +- `construct <...>`: Explained above. - `with ;`: Pops values, and puts them into variables. The closest name to the semicolon is filled first, then the 2nd closest, etc. - `string! { }`: Pushes a string containing the raw words inside of the block. The words are not executed, but the block ends on the matching curly brace, meaning the number of curly braces inside of the block have to be even. Newlines are handled like spaces, any number of consecutive spaces will only be one space in the final string.