From 1923f97649f745738c351c0ba8c98f2c7e7fe20d Mon Sep 17 00:00:00 2001 From: Gabriele Pappalardo Date: Mon, 20 Dec 2021 18:58:16 +0100 Subject: [PATCH] fix for files with ending comments and EOF (#2) --- lib/scanner.mll | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/scanner.mll b/lib/scanner.mll index a2ae0f5..af7e44e 100644 --- a/lib/scanner.mll +++ b/lib/scanner.mll @@ -140,11 +140,13 @@ rule next_token = parse and single_line_comment = parse | "\r\n" | "\n" { Lexing.new_line lexbuf; () } + | eof { () } | _ { single_line_comment lexbuf } and multi_line_comment = parse | "*/" { () } | "\n" | "\r\n" { Lexing.new_line lexbuf; multi_line_comment lexbuf } + | eof { () } | _ { multi_line_comment lexbuf } and character c = parse | ['''] { CHAR(c) }