MCPcopy Create free account
hub / github.com/cloudwan/gohan / parseCode

Function parseCode

extension/gohanscript/lexer.go:232–249  ·  view source on GitHub ↗
(key string, code interface{})

Source from the content-addressed store, hash-verified

230}
231
232func parseCode(key string, code interface{}) map[string]interface{} {
233 switch c := code.(type) {
234 case string:
235 l := newLexer(c)
236 result := l.parseDict()
237 if l.err != nil {
238 args := map[string]interface{}{}
239 args[key] = c
240 return args
241 }
242 return result
243 case map[string]interface{}:
244 return c
245 case map[interface{}]interface{}:
246 return util.MaybeMap(c)
247 }
248 return map[string]interface{}{key: code}
249}

Callers 1

parserMethod · 0.85

Calls 3

newLexerFunction · 0.85
parseDictMethod · 0.80
MaybeMapMethod · 0.80

Tested by

no test coverage detected