diff options
author | SeungCheol Jung <scjung.hyu@gmail.com> | 2023-04-27 06:06:15 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-26 23:06:15 +0200 |
commit | 8c1013322a15c09c9253eec8022fd94e366bb4de (patch) | |
tree | c31fc8284a17a11c062eb848fa544fc887f57e71 | |
parent | 9fd4767208663033b7695c3b507239c6197bdded (diff) | |
download | ocaml-8c1013322a15c09c9253eec8022fd94e366bb4de.tar.gz |
ocamllex: Accept line directives ended with CR/LF. (#12146) (#12147)
-rw-r--r-- | Changes | 3 | ||||
-rw-r--r-- | lex/lexer.mll | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -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 } |