canonversion ::= [1-9] [0-9] | '0.' [1-9] [0-9] | '0.0.' [1-9] [0-9]
| 183 | // | '0.' [1-9] [0-9]* |
| 184 | // | '0.0.' [1-9] [0-9]* |
| 185 | bool isCanonVersion(std::string_view V) { |
| 186 | if (V.empty()) |
| 187 | return false; |
| 188 | |
| 189 | // canonversion ::= [1-9] [0-9]* | '0.' [1-9] [0-9]* | '0.0.' [1-9] [0-9]* |
| 190 | for (int I = 0; I < 3; I++) { |
| 191 | if (V[0] >= '1' && V[0] <= '9') { |
| 192 | size_t End = parseNumeric(V); |
| 193 | return End == V.size(); |
| 194 | } |
| 195 | if (!tryRead("0."sv, V) || V.empty()) |
| 196 | return false; |
| 197 | } |
| 198 | |
| 199 | return false; |
| 200 | } |
| 201 | |
| 202 | // Validates a dot-separated pre-release or build identifier segment. |
| 203 | // Each identifier is [0-9A-Za-z-]+. |
no test coverage detected