MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Parse

Function Parse

tensorflow/lite/delegates/gpu/gl/compiler/variable_accessor.cc:31–52  ·  view source on GitHub ↗

Parse the following regex manually name(\[index\])?(\.field)?

Source from the content-addressed store, hash-verified

29// Parse the following regex manually
30// name(\[index\])?(\.field)?
31VariableReference Parse(absl::string_view input) {
32 VariableReference ref;
33 auto start_index = input.find('[');
34 if (start_index != std::string::npos) {
35 auto end_index = input.rfind(']');
36 if (end_index == std::string::npos) {
37 return ref;
38 }
39 ref.index = input.substr(start_index + 1, end_index - start_index - 1);
40 ref.name = input.substr(0, start_index);
41 ref.field = input.substr(end_index + 1);
42 } else {
43 auto dot = input.find('.');
44 if (dot != std::string::npos) {
45 ref.name = input.substr(0, dot);
46 ref.field = input.substr(dot);
47 } else {
48 ref.name = input;
49 }
50 }
51 return ref;
52}
53
54} // namespace variable_accessor_internal
55

Callers 15

MainFunction · 0.85
RealMainFunction · 0.85
RunFunction · 0.85
RunFunction · 0.85
ParseFlagsFunction · 0.85
mainFunction · 0.85
ParseTestFlagsFunction · 0.85
ParseMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 1

findMethod · 0.45

Tested by 15

ParseTestFlagsFunction · 0.68
TESTFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
InitKernelTestFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68