Allow escaping of '$' with '$$'.
This commit is contained in:
parent
46851e27fa
commit
e343ba3689
2 changed files with 6 additions and 2 deletions
|
|
@ -136,7 +136,11 @@ func expandSigil(input string, vars map[string][]string) ([]string, int) {
|
|||
c, w := utf8.DecodeRuneInString(input)
|
||||
var offset int
|
||||
var varname string
|
||||
if c == '{' {
|
||||
|
||||
// escaping of "$" with "$$"
|
||||
if c == '$' {
|
||||
return []string{"$"}, 2
|
||||
} else if c == '{' {
|
||||
j := strings.IndexRune(input[w:], '}')
|
||||
if j < 0 {
|
||||
return []string{"$" + input}, len(input)
|
||||
|
|
|
|||
2
parse.go
2
parse.go
|
|
@ -232,7 +232,7 @@ func parseTargets(p *parser, t token) parserStateFun {
|
|||
return parseTargets
|
||||
}
|
||||
|
||||
// Consumed one or more strings followed by a first ':'.
|
||||
// Consume one or more strings followed by a first ':'.
|
||||
func parseAttributesOrPrereqs(p *parser, t token) parserStateFun {
|
||||
switch t.typ {
|
||||
case tokenNewline:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue