summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes3
-rw-r--r--lex/lexer.mll2
2 files changed, 4 insertions, 1 deletions
diff --git a/Changes b/Changes
index 123c033648..2d2c90be0f 100644
--- a/Changes
+++ b/Changes
@@ -386,6 +386,9 @@ OCaml 5.1.0
used in any context where a character set is expected.
(Nicolás Ojeda Bär, Martin Jambon, review by Sébastien Hinderer)
+- #12147: ocamllex: Allow carriage returns at the end of line directives.
+ (SeungCheol Jung, review by Nicolás Ojeda Bär)
+
- #11718: ocamlyacc: OCaml-style comments are now supported, in addition to
the C-style comments already supported. The syntax is the same as that used
in OCaml code.
diff --git a/lex/lexer.mll b/lex/lexer.mll
index 83111badc1..ca6f170713 100644
--- a/lex/lexer.mll
+++ b/lex/lexer.mll
@@ -137,7 +137,7 @@ rule main = parse
main lexbuf }
| "#" [' ' '\t']* (['0'-'9']+ as num) [' ' '\t']*
('\"' ([^ '\010' '\013' '\"']* as name) '\"')?
- [^ '\010' '\013']* '\010'
+ [^ '\010' '\013']* '\013'* '\010'
{ update_loc lexbuf name (int_of_string num);
main lexbuf
}