Validate every individual prerelease identifier, determine it's type and add it to collection.
| 108 | |
| 109 | /// Validate every individual prerelease identifier, determine it's type and add it to collection. |
| 110 | void prerelease_hook_impl(string& id, Prerelease_identifiers& prerelease) { |
| 111 | if (id.empty()) throw Parse_error("version identifier cannot be empty"); |
| 112 | Id_type t = Id_type::alnum; |
| 113 | if (is_identifier_numeric(id)) { |
| 114 | t = Id_type::num; |
| 115 | if (check_for_leading_0(id)) { |
| 116 | throw Parse_error("numeric identifiers cannot have leading 0"); |
| 117 | } |
| 118 | } |
| 119 | prerelease.push_back(Prerelease_identifier(id, t)); |
| 120 | id.clear(); |
| 121 | } |
| 122 | |
| 123 | /// Validate every individual build identifier and add it to collection. |
| 124 | void build_hook_impl(string& id, Parser_state& pstate, Build_identifiers& build, |
no test coverage detected