Skip to content

Commit cfbfbe7

Browse files
committed
fix: range parsing on emacs
1 parent 3d35a61 commit cfbfbe7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/emacs.ml

+7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ module Re = Core
2525
exception Parse_error
2626
exception Not_supported
2727

28+
let by_code f c c' =
29+
let c = Char.code c in
30+
let c' = Char.code c' in
31+
Char.chr (f c c')
32+
;;
33+
2834
let parse s =
2935
let buf = Parse_buffer.create s in
3036
let accept = Parse_buffer.accept buf in
@@ -105,6 +111,7 @@ let parse s =
105111
then Re.char c :: Re.char '-' :: s
106112
else (
107113
let c' = char () in
114+
let c' = by_code Int.max c c' in
108115
bracket (Re.rg c c' :: s))
109116
else bracket (Re.char c :: s))
110117
and char () =

0 commit comments

Comments
 (0)