Selaa lähdekoodia

parser: fix case where multi line string termination error wouldnt show

Jeffrey Morgan 1 vuosi sitten
vanhempi
commit
3b135ac963
1 muutettua tiedostoa jossa 0 lisäystä ja 4 poistoa
  1. 0 4
      parser/parser.go

+ 0 - 4
parser/parser.go

@@ -62,10 +62,6 @@ func Parse(reader io.Reader) ([]Command, error) {
 }
 }
 
 
 func scanModelfile(data []byte, atEOF bool) (advance int, token []byte, err error) {
 func scanModelfile(data []byte, atEOF bool) (advance int, token []byte, err error) {
-	if atEOF || len(data) == 0 {
-		return 0, nil, nil
-	}
-
 	newline := bytes.IndexByte(data, '\n')
 	newline := bytes.IndexByte(data, '\n')
 
 
 	if start := bytes.Index(data, []byte(`"""`)); start >= 0 && start < newline {
 	if start := bytes.Index(data, []byte(`"""`)); start >= 0 && start < newline {