| 299 | } |
| 300 | |
| 301 | AttributeSpec CreateAttribute(const OpDef_AttrDef& attr_def, |
| 302 | const ApiDef::Attr& attr_api_def, |
| 303 | TypeResolver* type_resolver) { |
| 304 | bool iterable = false; |
| 305 | std::pair<Type, Type> types = type_resolver->TypesOf(attr_def, &iterable); |
| 306 | Type var_type = types.first.kind() == Type::GENERIC |
| 307 | ? Type::ClassOf(types.first) |
| 308 | : types.first; |
| 309 | if (iterable) { |
| 310 | var_type = Type::ListOf(var_type); |
| 311 | } |
| 312 | return AttributeSpec( |
| 313 | attr_api_def.name(), |
| 314 | Variable::Create(SnakeToCamelCase(attr_api_def.rename_to()), var_type), |
| 315 | types.first, types.second, ParseDocumentation(attr_api_def.description()), |
| 316 | iterable, |
| 317 | attr_def.has_default_value() ? &attr_def.default_value() : nullptr); |
| 318 | } |
| 319 | |
| 320 | ArgumentSpec CreateOutput(const OpDef_ArgDef& output_def, |
| 321 | const ApiDef::Arg& output_api, |
no test coverage detected