much stdlib docs

This commit is contained in:
Aidan 2020-07-19 14:37:20 -07:00
parent b941df68e1
commit ee39de01fd
No known key found for this signature in database
GPG key ID: 327711E983899316
9 changed files with 228 additions and 74 deletions

View file

@ -22,7 +22,17 @@ import (
"gitlab.com/whom/shs/log"
)
func decl_func(input *ast.Token, vars ast.VarTable, funcs ast.FuncTable) *ast.Token {
/* Takes 3 arguments: name, list of arg names, and logic form
* DOES NOT EVALUATE THE LOGIC FORM
* adds an anonymous function to the FuncTable under the name specified
* anonymous function will expect the args declared in arg2 and expand them in arg3
* Then evaluates and returns result of arg3. This constitutes a function call
*
* Example:
* (func foo (x) (print x))
* (foo 4) -> prints 4
*/
func DeclFunc(input *ast.Token, vars ast.VarTable, funcs ast.FuncTable) *ast.Token {
name := input
if name.Tag != ast.SYMBOL {
log.Log(log.ERR,