Allow escaping of '$' with '$$'.

This commit is contained in:
Daniel Jones 2014-08-04 10:52:31 -07:00
parent 46851e27fa
commit e343ba3689
2 changed files with 6 additions and 2 deletions

View file

@ -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)

View file

@ -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: