Skip to content

Commit c41c79f

Browse files
committed
fix signature of text_of_raw
1 parent 14c32c1 commit c41c79f

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

glical_kernel.ml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
(* Licence: ISC *)
66
(* ********************************************************************* *)
77

8-
(** Important note: this library needs OCaml >= 4.1.0 *)
9-
108
type location = int * int
119
and name = string
1210
and key = string
@@ -40,7 +38,7 @@ let syntax_error s ln cn = raise (Syntax_error (sprintf "(%d:%d): %s." ln cn s))
4038
let syntax_assert b s ln cn = if not b then syntax_error s ln cn
4139

4240
(** http://tools.ietf.org/html/rfc5545#section-3.3.11 (TEXT) *)
43-
let text_of_raw (label:string) = function
41+
let text_of_raw = function
4442
| `Raw((ln, cn) as location, s) ->
4543
let sl = String.length s in
4644
let open Buffer in
@@ -77,8 +75,8 @@ let text_of_raw (label:string) = function
7775
feeds read by this program do comply with RFC 5545. *)
7876
| c -> add_char b c; loop accu (i+1)
7977
in
80-
label, `Text(location, List.rev (loop [] 0))
81-
| x -> label, x
78+
`Text(location, List.rev (loop [] 0))
79+
| x -> x
8280

8381
let lex_ical s =
8482
let name = Buffer.create 42

glical_kernel.mli

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ val iter :
9494
(([> `Raw of location * string ] as 'a) Ical.element -> unit) ->
9595
'a Ical.t -> unit
9696

97+
(** *)
9798
val sort : (([> `Raw of location * string ] as 'a) Ical.element -> 'a Ical.element -> int) ->
9899
'a Ical.t -> 'a Ical.t
99100

@@ -130,18 +131,17 @@ val is_nonempty_block : 'a Ical.element -> bool
130131

131132
(* Value formats *)
132133
(* ******************************************************************** *)
133-
(** [text_of_raw label value] converts [`Raw(loc, s)] to [`Text(loc,sl)]
134+
(** [text_of_raw] converts [`Raw(loc, s)] to [`Text(loc,sl)]
134135
where [sl] is the list of text values in [s]. Note that it is a list
135136
because in iCalendar a label can be associated with multiple values.
136-
Note that [loc] isn't changed, and [sl] is a [string list].
137+
Note that [loc] isn't changed.
137138
This conversion interpretes backslash-escaped characters and
138139
commas, the latter are used for separating multiple values.
139140
(http://tools.ietf.org/html/rfc5545#section-3.3.11) *)
140141
val text_of_raw :
141-
string ->
142142
([> `Raw of location * string
143143
| `Text of location * string list ] as 'a)
144-
-> string * 'a
144+
-> 'a
145145

146146

147147
(** A module to represent date-time values. Since there are way

0 commit comments

Comments
 (0)