MCPcopy Create free account
hub / github.com/cogentcore/core / TranspileExecString

Method TranspileExecString

shell/transpile.go:170–179  ·  view source on GitHub ↗

TranspileExecString returns transpiled tokens assuming Exec code, from a backtick-encoded string, with the given bool indicating whether [Output] is needed.

(str string, output bool)

Source from the content-addressed store, hash-verified

168// from a backtick-encoded string, with the given bool indicating
169// whether [Output] is needed.
170func (sh *Shell) TranspileExecString(str string, output bool) Tokens {
171 if len(str) <= 1 {
172 return nil
173 }
174 ewords, err := ExecWords(str[1 : len(str)-1]) // enclosed string
175 if err != nil {
176 sh.AddError(err)
177 }
178 return sh.TranspileExec(ewords, output)
179}
180
181// TranspileExec returns transpiled tokens assuming Exec code,
182// with the given bools indicating the type of run to execute.

Callers 2

TranspileLineTokensMethod · 0.95
TranspileGoMethod · 0.95

Calls 3

AddErrorMethod · 0.95
TranspileExecMethod · 0.95
ExecWordsFunction · 0.85

Tested by

no test coverage detected