scanner: Anchor heredoc-regexes at beginning of line.
This commit is contained in:
parent
89240c3707
commit
13daa63726
@ -440,9 +440,9 @@ func (s *Scanner) scanHeredoc() {
|
|||||||
|
|
||||||
var identRegexp *regexp.Regexp
|
var identRegexp *regexp.Regexp
|
||||||
if identBytes[0] == '-' {
|
if identBytes[0] == '-' {
|
||||||
identRegexp = regexp.MustCompile(fmt.Sprintf(`[[:space:]]*%s\z`, identBytes[1:]))
|
identRegexp = regexp.MustCompile(fmt.Sprintf(`^[[:space:]]*%s\z`, identBytes[1:]))
|
||||||
} else {
|
} else {
|
||||||
identRegexp = regexp.MustCompile(fmt.Sprintf(`[[:space:]]*%s\z`, identBytes))
|
identRegexp = regexp.MustCompile(fmt.Sprintf(`^[[:space:]]*%s\z`, identBytes))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the actual string value
|
// Read the actual string value
|
||||||
|
Loading…
Reference in New Issue
Block a user