MCPcopy Create free account
hub / github.com/GoogleChrome/webstatus.dev / parseFunctionCallType

Function parseFunctionCallType

util/cmd/check_tfvars/main.go:217–233  ·  view source on GitHub ↗
(e *hclsyntax.FunctionCallExpr)

Source from the content-addressed store, hash-verified

215 return parseFunctionCallType(e)
216 case *hclsyntax.ScopeTraversalExpr:
217 //nolint:exhaustruct
218 return &TypeSchema{Kind: kindPrimitive}
219 default:
220 panic(fmt.Sprintf("unsupported type expression %T", expr))
221 }
222}
223
224func parseFunctionCallType(e *hclsyntax.FunctionCallExpr) *TypeSchema {
225 if len(e.Args) != 1 {
226 return nil
227 }
228 switch e.Name {
229 case kindObject:
230 return parseObjectCons(e.Args[0])
231 case kindMap:
232 //nolint:exhaustruct
233 return &TypeSchema{Kind: kindMap, ValueType: parseTypeExpr(e.Args[0])}
234 case kindList, "set":
235 //nolint:exhaustruct
236 return &TypeSchema{Kind: kindList, ValueType: parseTypeExpr(e.Args[0])}

Callers 1

parseTypeExprFunction · 0.85

Calls 2

parseObjectConsFunction · 0.85
parseTypeExprFunction · 0.85

Tested by

no test coverage detected