MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / isLowercaseKebabString

Function isLowercaseKebabString

lib/validator/component_name.cpp:65–73  ·  view source on GitHub ↗

words ::= ( '-' ) first-word ::= [a-z] [0-9a-z] word ::= [0-9a-z]+

Source from the content-addressed store, hash-verified

63// first-word ::= [a-z] [0-9a-z]*
64// word ::= [0-9a-z]+
65bool isLowercaseKebabString(std::string_view Input) {
66 if (Input.empty() || !islower(Input[0]))
67 return false;
68 for (char C : Input) {
69 if (C != '-' && !islower(C) && !isdigit(C))
70 return false;
71 }
72 return Input.back() != '-' && Input.find("--"sv) == Input.npos;
73}
74
75bool isEOF(std::string_view Input) { return Input.empty(); }
76

Callers 2

parsePkgPathFunction · 0.85
parseMethod · 0.85

Calls 3

backMethod · 0.80
emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected