| 2748 | } |
| 2749 | |
| 2750 | CheckedError Parser::StartEnum(const std::string &enum_name, bool is_union, |
| 2751 | EnumDef **dest) { |
| 2752 | auto &enum_def = *new EnumDef(); |
| 2753 | enum_def.name = enum_name; |
| 2754 | enum_def.file = file_being_parsed_; |
| 2755 | enum_def.doc_comment = doc_comment_; |
| 2756 | enum_def.is_union = is_union; |
| 2757 | enum_def.defined_namespace = current_namespace_; |
| 2758 | if (enums_.Add(current_namespace_->GetFullyQualifiedName(enum_name), |
| 2759 | &enum_def)) |
| 2760 | return Error("enum already exists: " + enum_name); |
| 2761 | enum_def.underlying_type.base_type = |
| 2762 | is_union ? BASE_TYPE_UTYPE : BASE_TYPE_INT; |
| 2763 | enum_def.underlying_type.enum_def = &enum_def; |
| 2764 | if (dest) *dest = &enum_def; |
| 2765 | return NoError(); |
| 2766 | } |
| 2767 | |
| 2768 | CheckedError Parser::ParseProtoFields(StructDef *struct_def, bool isextend, |
| 2769 | bool inside_oneof) { |
nothing calls this directly
no test coverage detected