add functions and variables name

This commit is contained in:
2023-02-25 23:34:15 +00:00
parent 636101f1fa
commit 6ef6e051e6
23 changed files with 414 additions and 97 deletions

19
src/typeof.go Normal file
View File

@@ -0,0 +1,19 @@
package main
func typeof(val any) string {
switch val.(type) {
case number:
return "number"
case string:
return "string"
case nil:
return "null"
case bool:
return "boolean"
case Callable:
return "function"
case builtinFunc:
return "function"
}
return "unknown"
}