Lines Matching +full:input +full:- +full:value

1 //===- VersionTuple.cpp - Version Number Handling ---------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
41 static bool parseInt(StringRef &input, unsigned &value) { in parseInt() argument
42 assert(value == 0); in parseInt()
43 if (input.empty()) in parseInt()
46 char next = input[0]; in parseInt()
47 input = input.substr(1); in parseInt()
50 value = (unsigned)(next - '0'); in parseInt()
52 while (!input.empty()) { in parseInt()
53 next = input[0]; in parseInt()
56 input = input.substr(1); in parseInt()
57 value = value * 10 + (unsigned)(next - '0'); in parseInt()
63 bool VersionTuple::tryParse(StringRef input) { in tryParse() argument
66 // Parse the major version, [0-9]+ in tryParse()
67 if (parseInt(input, major)) in tryParse()
70 if (input.empty()) { in tryParse()
75 // If we're not done, parse the minor version, \.[0-9]+ in tryParse()
76 if (input[0] != '.') in tryParse()
78 input = input.substr(1); in tryParse()
79 if (parseInt(input, minor)) in tryParse()
82 if (input.empty()) { in tryParse()
87 // If we're not done, parse the micro version, \.[0-9]+ in tryParse()
88 if (!input.consume_front(".")) in tryParse()
90 if (parseInt(input, micro)) in tryParse()
93 if (input.empty()) { in tryParse()
98 // If we're not done, parse the micro version, \.[0-9]+ in tryParse()
99 if (!input.consume_front(".")) in tryParse()
101 if (parseInt(input, build)) in tryParse()
105 if (!input.empty()) in tryParse()