File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -146,10 +146,6 @@ This generates:
146
146
#### Smart reconstruction
147
147
The pretty-printer intelligently handles alternations and optional fields:
148
148
``` ocaml
149
- let%mikmatch date_format = {| digit{4} '-' digit{2} '-' digit{2} ' ' digit{2} ':' digit{2} ':' digit{2} |}
150
-
151
- type date = {%mikmatch| (date_format as date) |}
152
-
153
149
type mode =
154
150
[ `A
155
151
| `B
@@ -159,6 +155,8 @@ type mode =
159
155
let mk_mode = function "a" -> `A | "b" -> `B | _ -> `Other
160
156
let pp_mode fmt mode = Format.fprintf fmt @@ match mode with `A -> "a" | `B -> "b" | `Other -> "other"
161
157
158
+ let%mikmatch date_format = {| digit{4} '-' digit{2} '-' digit{2} ' ' digit{2} ':' digit{2} ':' digit{2} |}
159
+
162
160
type log = {%mikmatch|
163
161
(date_format as date)
164
162
" [" (upper+ as level) "]"
Original file line number Diff line number Diff line change @@ -520,10 +520,6 @@ let test_mixed_matching _ =
520
520
assert_raises (Failure " File tests/test_ppx_regexp.ml, lines 512-514, characters 24-33: String did not match any regex." ) (fun () ->
521
521
no_default_case " c" )
522
522
523
- let % mikmatch date_format = {| digit{4 } '-' digit{2 } '-' digit{2 } ' ' digit{2 } ':' digit{2 } ':' digit{2 } | }
524
-
525
- type date = {% mikmatch| (date_format as date) | }
526
-
527
523
type mode =
528
524
[ `A
529
525
| `B
@@ -532,6 +528,7 @@ type mode =
532
528
533
529
let mk_mode = function "a" -> `A | "b" -> `B | _ -> `Other
534
530
let pp_mode fmt mode = Format. fprintf fmt @@ match mode with `A -> " a" | `B -> " b" | `Other -> " other"
531
+ let % mikmatch date_format = {| digit{4 } '-' digit{2 } '-' digit{2 } ' ' digit{2 } ':' digit{2 } ':' digit{2 } | }
535
532
536
533
type log =
537
534
{% mikmatch| (date_format as date)
You can’t perform that action at this time.
0 commit comments