MCPcopy Create free account
hub / github.com/crossoverJie/gscript / GetInternalFunction

Function GetInternalFunction

internal_function.go:20–57  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

18var internalFunction map[string]func(v *Visitor, ctx *parser.FunctionCallContext) interface{}
19
20func GetInternalFunction(name string) func(v *Visitor, ctx *parser.FunctionCallContext) interface{} {
21 if internalFunction == nil {
22 internalFunction = map[string]func(v *Visitor, ctx *parser.FunctionCallContext) interface{}{
23 "println": gPrintln,
24 "assertEqual": assertEqual,
25 "append": gAppend,
26 "len": gLen,
27 "cap": gCap,
28 "copy": gCopy,
29 "hash": gHash,
30 "JSON": JSON,
31 "JSONGet": JSONGet,
32 "httpHandle": httpHandle,
33 "httpRun": httpRun,
34 "FprintfJSON": fprintfJSON,
35 "FprintfHTML": fprintfHTML,
36 "GetCurrentTime": getCurrentTime,
37 "Unix": unix,
38 "QueryPath": queryPath,
39 "FormValue": formValue,
40 "PostFormValue": postFormValue,
41 "GetOSArgs": getOSArgs,
42 "Command": command,
43 "WriteFile": writeFile,
44 "Remove": remove,
45 "printf": printf,
46 "sprintf": sprintf,
47 "print": gPrint,
48 "dumpAST": dumpAST,
49 "dumpSymbol": dumpSymbol,
50 "RequestBody": requestBody,
51 "Getwd": getWd,
52 "toByteArray": toByteArray,
53 "toString": toString,
54 }
55 }
56 return internalFunction[name]
57}
58
59func gPrintln(v *Visitor, ctx *parser.FunctionCallContext) interface{} {
60 if ctx.ExpressionList() != nil {

Callers 3

ExitStmReturnMethod · 0.85
VisitFunctionCallMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected