Commit 9823128 1 parent 76dabf6 commit 9823128 Copy full SHA for 9823128
File tree 3 files changed +4
-10
lines changed
3 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -34,13 +34,14 @@ let by_code f c c' =
34
34
let parse s =
35
35
let buf = Parse_buffer. create s in
36
36
let accept = Parse_buffer. accept buf in
37
- let accept2 = Parse_buffer. accept2 buf in
38
37
let eos () = Parse_buffer. eos buf in
39
38
let test2 = Parse_buffer. test2 buf in
40
39
let get () = Parse_buffer. get buf in
41
40
let rec regexp () = regexp' [ branch () ]
42
41
and regexp' left =
43
- if accept2 '\\' '|' then regexp' (branch () :: left) else Re. alt (List. rev left)
42
+ if Parse_buffer. accept_s buf {| \|| }
43
+ then regexp' (branch () :: left)
44
+ else Re. alt (List. rev left)
44
45
and branch () = branch' []
45
46
and branch' left =
46
47
if eos () || test2 '\\' '|' || test2 '\\' ')'
@@ -69,7 +70,7 @@ let parse s =
69
70
if accept '('
70
71
then (
71
72
let r = regexp () in
72
- if not (accept2 '\\' ')' ) then raise Parse_error ;
73
+ if not (Parse_buffer. accept_s buf { | \) | } ) then raise Parse_error ;
73
74
Re. group r)
74
75
else if accept '`'
75
76
then Re. bos
Original file line number Diff line number Diff line change @@ -21,12 +21,6 @@ let accept t c =
21
21
r
22
22
;;
23
23
24
- let accept2 t c c' =
25
- let r = test2 t c c' in
26
- if r then t.pos < - t.pos + 2 ;
27
- r
28
- ;;
29
-
30
24
let get t =
31
25
let r = t.str.[t.pos] in
32
26
t.pos < - t.pos + 1 ;
Original file line number Diff line number Diff line change @@ -10,6 +10,5 @@ val test : t -> char -> bool
10
10
val test2 : t -> char -> char -> bool
11
11
val get : t -> char
12
12
val accept : t -> char -> bool
13
- val accept2 : t -> char -> char -> bool
14
13
val accept_s : t -> string -> bool
15
14
val integer : t -> int option
You can’t perform that action at this time.
0 commit comments