File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -48,15 +48,15 @@ let parse_lid s =
48
48
match i, c with
49
49
| 0 , ('a' .. 'z' | '_' ) -> ()
50
50
| 0 , _ -> assert false
51
- | _ , ('a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' ) -> ()
51
+ | _ , ('a' .. 'z' | 'A' .. 'Z' | '_' | '\' ' | ' 0' .. '9' ) -> ()
52
52
| _ -> assert false )
53
53
in
54
54
let assert_uid =
55
55
String. iteri ~f: (fun i c ->
56
56
match i, c with
57
57
| 0 , 'A' .. 'Z' -> ()
58
58
| 0 , _ -> assert false
59
- | _ , ('a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' ) -> ()
59
+ | _ , ('a' .. 'z' | 'A' .. 'Z' | '_' | '\' ' | ' 0' .. '9' ) -> ()
60
60
| _ -> assert false )
61
61
in
62
62
let rec check = function
Original file line number Diff line number Diff line change @@ -695,3 +695,27 @@ let t s =
695
695
(Deriving_Json_lexer.init_lexer (Lexing.from_string s));;
696
696
val t : string -> t * t = <fun>
697
697
|}]
698
+
699
+ ;;
700
+ type id' = int [@@deriving json]
701
+ [%%expect {|
702
+
703
+ type id' = int[@@deriving json]
704
+ include
705
+ struct
706
+ let _ = fun (_ : id') -> ()
707
+ let rec (id'_of_json : Deriving_Json_lexer.lexbuf -> id') =
708
+ fun buf -> Deriving_Json.Json_int.read buf
709
+ let _ = id'_of_json
710
+ let rec (id'_to_json : Buffer.t -> id' -> unit) =
711
+ fun buf -> fun a -> Deriving_Json.Json_int.write buf a
712
+ let _ = id'_to_json
713
+ let (id'_json : id' Deriving_Json.t) =
714
+ Deriving_Json.make id'_to_json id'_of_json
715
+ let _ = id'_json
716
+ end[@@ocaml.doc "@inline"][@@merlin.hide ];;
717
+ type id' = int
718
+ val id'_of_json : Deriving_Json_lexer.lexbuf -> id' = <fun>
719
+ val id'_to_json : Buffer.t -> id' -> unit = <fun>
720
+ val id'_json : id' Deriving_Json.t = <abstr>
721
+ |}]
You can’t perform that action at this time.
0 commit comments