MCPcopy Index your code
hub / github.com/writefreely/writefreely / parseBuild

Function parseBuild

semver.go:186–208  ·  view source on GitHub ↗
(v string)

Source from the content-addressed store, hash-verified

184}
185
186func parseBuild(v string) (t, rest string, ok bool) {
187 if v == "" || v[0] != '+' {
188 return
189 }
190 i := 1
191 start := 1
192 for i < len(v) {
193 if !isIdentChar(v[i]) {
194 return
195 }
196 if v[i] == '.' {
197 if start == i {
198 return
199 }
200 start = i + 1
201 }
202 i++
203 }
204 if start == i {
205 return
206 }
207 return v[:i], v[i:], true
208}
209
210func isIdentChar(c byte) bool {
211 return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' || c == '-'

Callers 1

semParseFunction · 0.85

Calls 1

isIdentCharFunction · 0.85

Tested by

no test coverage detected