scanner: Anchor heredoc-regexes at beginning of line.

This commit is contained in:
Florian Forster 2018-04-03 16:17:39 +02:00
parent 89240c3707
commit 13daa63726

View File

@ -440,9 +440,9 @@ func (s *Scanner) scanHeredoc() {
var identRegexp *regexp.Regexp
if identBytes[0] == '-' {
identRegexp = regexp.MustCompile(fmt.Sprintf(`[[:space:]]*%s\z`, identBytes[1:]))
identRegexp = regexp.MustCompile(fmt.Sprintf(`^[[:space:]]*%s\z`, identBytes[1:]))
} else {
identRegexp = regexp.MustCompile(fmt.Sprintf(`[[:space:]]*%s\z`, identBytes))
identRegexp = regexp.MustCompile(fmt.Sprintf(`^[[:space:]]*%s\z`, identBytes))
}
// Read the actual string value