MCPcopy Create free account
hub / github.com/drone/envsubst / parseCasingFunc

Method parseCasingFunc

parse/parse.go:339–353  ·  view source on GitHub ↗

parses the ${param,} string function parses the ${param,,} string function parses the ${param^} string function parses the ${param^^} string function

(name string)

Source from the content-addressed store, hash-verified

337// parses the ${param^} string function
338// parses the ${param^^} string function
339func (t *Tree) parseCasingFunc(name string) (Node, error) {
340 node := new(FuncNode)
341 node.Param = name
342
343 t.scanner.accept = acceptCasingFunc
344 t.scanner.mode = scanIdent
345 switch t.scanner.scan() {
346 case tokenIdent:
347 node.Name = t.scanner.string()
348 default:
349 return nil, ErrBadSubstitution
350 }
351
352 return node, t.consumeRbrack()
353}
354
355// parses the ${#param} string function
356func (t *Tree) parseLenFunc() (Node, error) {

Callers 1

parseFuncMethod · 0.95

Calls 3

consumeRbrackMethod · 0.95
scanMethod · 0.80
stringMethod · 0.80

Tested by

no test coverage detected