瀏覽代碼

Check for EOF when scanning file tags

Brad Lewis 3 周之前
父節點
當前提交
8bab146b2d
共有 1 個文件被更改,包括 2 次插入2 次删除
  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)
 	}