mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
add functions and variables name
This commit is contained in:
19
src/typeof.go
Normal file
19
src/typeof.go
Normal 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"
|
||||
}
|
||||
Reference in New Issue
Block a user