scanner: Fix detection of zero-length heredoc anchor.

This commit is contained in:
Florian Forster 2018-04-04 17:09:20 +02:00
parent 8bad6ac32e
commit a68b5db4c3

View File

@ -433,7 +433,7 @@ func (s *Scanner) scanHeredoc() {
// Read the identifier
identBytes := s.src[offs : s.srcPos.Offset-s.lastCharLen]
if len(identBytes) == 0 {
if len(identBytes) == 0 || (len(identBytes) == 1 && identBytes[0] == '-') {
s.err("zero-length heredoc anchor")
return
}