(e *hclsyntax.FunctionCallExpr)
| 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 | |
| 224 | func 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])} |
no test coverage detected