MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / splitSedExpressions

Function splitSedExpressions

tools/bash/sed_validation.go:135–154  ·  view source on GitHub ↗
(expr string)

Source from the content-addressed store, hash-verified

133}
134
135func splitSedExpressions(expr string) []string {
136 var parts []string
137 var current strings.Builder
138 inSingle := false
139 for _, ch := range expr {
140 if ch == '\'' {
141 inSingle = !inSingle
142 current.WriteRune(ch)
143 } else if ch == ';' && !inSingle {
144 parts = append(parts, current.String())
145 current.Reset()
146 } else {
147 current.WriteRune(ch)
148 }
149 }
150 if current.Len() > 0 {
151 parts = append(parts, current.String())
152 }
153 return parts
154}
155
156func hasInplaceFlag(command string) bool {
157 for _, token := range Tokenize(command, true) {

Callers 1

Calls 2

StringMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected