Explorar o código

Merge pull request #5599 from BradLewis/fix/file-tag-eof

Check for EOF when scanning file tags
gingerBill hai 3 semanas
pai
achega
06179fc736
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      core/odin/tokenizer/tokenizer.odin

+ 2 - 2
core/odin/tokenizer/tokenizer.odin

@@ -209,14 +209,14 @@ scan_comment :: proc(t: ^Tokenizer) -> string {
 scan_file_tag :: proc(t: ^Tokenizer) -> string {
 	offset := t.offset - 1
 
-	for t.ch != '\n' {
+	for t.ch != '\n' && t.ch != utf8.RUNE_EOF {
 		if t.ch == '/' {
 			next := peek_byte(t, 0)
 
 			if next == '/' || next == '*' {
 				break
 			}
-		} 
+		}
 		advance_rune(t)
 	}