package atd

  1. Overview
  2. Docs

Source file doc_lexer.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# 1 "atd/src/doc_lexer.mll"
 
  open Doc_types

  let close_paragraph a1 a2 a3 =
    let a2 =
      match String.concat "" (List.rev a3) with
          "" -> a2
        | s -> Text s :: a2
    in
    match List.rev a2 with
        [] -> a1
      | l -> Paragraph l :: a1

# 16 "atd/src/doc_lexer.ml"
let __ocaml_lex_tables = {
  Lexing.lex_base =
   "\000\000\248\255\249\255\005\000\010\000\012\000\001\000\003\000\
    \004\000\255\255\006\000\008\000\014\000\253\255\001\000\009\000\
    \011\000\020\000\025\000\249\255\011\000\030\000\036\000\012\000\
    \013\000\255\255\254\255\014\000\250\255\050\000\248\255\250\255\
    \015\000\016\000\056\000\002\000\253\255\019\000\020\000\255\255\
    \021\000\254\255\022\000\024\000\026\000\249\255";
  Lexing.lex_backtrk =
   "\004\000\255\255\255\255\003\000\004\000\004\000\007\000\007\000\
    \255\255\255\255\000\000\001\000\002\000\255\255\255\255\255\255\
    \255\255\005\000\255\255\255\255\004\000\003\000\002\000\004\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \005\000\005\000\004\000\005\000\255\255\005\000\255\255\255\255\
    \255\255\255\255\003\000\255\255\255\255\255\255";
  Lexing.lex_default =
   "\003\000\000\000\000\000\003\000\255\255\255\255\255\255\255\255\
    \255\255\000\000\255\255\255\255\255\255\000\000\255\255\255\255\
    \255\255\255\255\021\000\000\000\255\255\021\000\255\255\255\255\
    \255\255\000\000\000\000\255\255\000\000\034\000\000\000\000\000\
    \255\255\255\255\034\000\255\255\000\000\255\255\255\255\000\000\
    \255\255\000\000\255\255\255\255\255\255\000\000";
  Lexing.lex_trans =
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\005\000\004\000\013\000\042\000\005\000\255\255\255\255\
    \000\000\000\000\255\255\004\000\017\000\005\000\004\000\004\000\
    \013\000\005\000\000\000\014\000\000\000\017\000\017\000\000\000\
    \005\000\017\000\022\000\022\000\000\000\255\255\022\000\255\255\
    \255\255\000\000\004\000\255\255\005\000\022\000\022\000\000\000\
    \000\000\022\000\000\000\000\000\017\000\000\000\000\000\000\000\
    \000\000\022\000\000\000\036\000\033\000\000\000\255\255\035\000\
    \000\000\255\255\255\255\000\000\022\000\255\255\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\031\000\000\000\000\000\000\000\000\000\000\000\
    \255\255\000\000\000\000\000\000\007\000\000\000\000\000\009\000\
    \000\000\255\255\000\000\000\000\000\000\000\000\000\000\000\000\
    \025\000\000\000\000\000\000\000\000\000\000\000\000\000\039\000\
    \000\000\000\000\000\000\000\000\000\000\023\000\000\000\000\000\
    \000\000\000\000\255\255\006\000\011\000\001\000\008\000\010\000\
    \255\255\009\000\255\255\012\000\016\000\015\000\012\000\015\000\
    \028\000\024\000\026\000\028\000\044\000\043\000\037\000\015\000\
    \038\000\040\000\041\000\043\000\255\255\044\000\020\000\045\000\
    \000\000\000\000\000\000\255\255\000\000\000\000\000\000\000\000\
    \000\000\027\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\032\000\
    \000\000\000\000\000\000\000\000\000\000\255\255\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \002\000\000\000\000\000\000\000\000\000\255\255\000\000\000\000\
    \000\000\000\000\002\000\000\000\002\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\
    \000\000\019\000\000\000\000\000\000\000\000\000\255\255\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\030\000\000\000\000\000\000\000\000\000\000\000\
    \255\255";
  Lexing.lex_check =
   "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\000\000\000\000\014\000\035\000\000\000\003\000\003\000\
    \255\255\255\255\003\000\004\000\004\000\005\000\005\000\004\000\
    \012\000\005\000\255\255\012\000\255\255\017\000\017\000\255\255\
    \000\000\017\000\018\000\018\000\255\255\003\000\018\000\021\000\
    \021\000\255\255\004\000\021\000\005\000\022\000\022\000\255\255\
    \255\255\022\000\255\255\255\255\017\000\255\255\255\255\255\255\
    \255\255\018\000\255\255\029\000\029\000\255\255\021\000\029\000\
    \255\255\034\000\034\000\255\255\022\000\034\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\029\000\255\255\255\255\255\255\255\255\255\255\
    \034\000\255\255\255\255\255\255\000\000\255\255\255\255\007\000\
    \255\255\003\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \023\000\255\255\255\255\255\255\255\255\255\255\255\255\037\000\
    \255\255\255\255\255\255\255\255\255\255\018\000\255\255\255\255\
    \255\255\255\255\021\000\000\000\006\000\000\000\007\000\008\000\
    \003\000\010\000\003\000\011\000\015\000\004\000\016\000\005\000\
    \020\000\023\000\024\000\027\000\032\000\033\000\029\000\017\000\
    \037\000\038\000\040\000\042\000\034\000\043\000\018\000\044\000\
    \255\255\255\255\255\255\021\000\255\255\255\255\255\255\255\255\
    \255\255\022\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\029\000\
    \255\255\255\255\255\255\255\255\255\255\034\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \000\000\255\255\255\255\255\255\255\255\003\000\255\255\255\255\
    \255\255\255\255\004\000\255\255\005\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\017\000\255\255\255\255\255\255\
    \255\255\018\000\255\255\255\255\255\255\255\255\021\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\029\000\255\255\255\255\255\255\255\255\255\255\
    \034\000";
  Lexing.lex_base_code =
   "";
  Lexing.lex_backtrk_code =
   "";
  Lexing.lex_default_code =
   "";
  Lexing.lex_trans_code =
   "";
  Lexing.lex_check_code =
   "";
  Lexing.lex_code =
   "";
}

let rec paragraph a1 a2 a3 lexbuf =
   __ocaml_lex_paragraph_rec a1 a2 a3 lexbuf 0
and __ocaml_lex_paragraph_rec a1 a2 a3 lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
let
# 27 "atd/src/doc_lexer.mll"
                                 s
# 143 "atd/src/doc_lexer.ml"
= Lexing.sub_lexeme lexbuf (lexbuf.Lexing.lex_start_pos + 1) lexbuf.Lexing.lex_curr_pos in
# 28 "atd/src/doc_lexer.mll"
                        ( paragraph a1 a2 (s :: a3) lexbuf )
# 147 "atd/src/doc_lexer.ml"

  | 1 ->
# 30 "atd/src/doc_lexer.mll"
                        ( let code = inline_verbatim [] lexbuf in
                          let a2 =
                            match String.concat "" (List.rev a3) with
                                "" -> a2
                              | s -> Text s :: a2
                          in
                          let a2 = Code code :: a2 in
                          paragraph a1 a2 [] lexbuf
                        )
# 160 "atd/src/doc_lexer.ml"

  | 2 ->
# 40 "atd/src/doc_lexer.mll"
                        ( let pre = verbatim [] lexbuf in
                          let a1 = close_paragraph a1 a2 a3 in
                          let a1 = Pre pre :: a1 in
                          paragraph a1 [] [] lexbuf
                        )
# 169 "atd/src/doc_lexer.ml"

  | 3 ->
let
# 45 "atd/src/doc_lexer.mll"
                        s
# 175 "atd/src/doc_lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
# 46 "atd/src/doc_lexer.mll"
                        ( paragraph a1 a2 (s :: a3) lexbuf )
# 179 "atd/src/doc_lexer.ml"

  | 4 ->
# 48 "atd/src/doc_lexer.mll"
                        ( paragraph a1 a2 (" " :: a3) lexbuf )
# 184 "atd/src/doc_lexer.ml"

  | 5 ->
# 50 "atd/src/doc_lexer.mll"
                        ( let a1 = close_paragraph a1 a2 a3 in
                          paragraph a1 [] [] lexbuf
                        )
# 191 "atd/src/doc_lexer.ml"

  | 6 ->
# 53 "atd/src/doc_lexer.mll"
                        ( let a1 = close_paragraph a1 a2 a3 in
                          List.rev a1 )
# 197 "atd/src/doc_lexer.ml"

  | 7 ->
let
# 56 "atd/src/doc_lexer.mll"
         c
# 203 "atd/src/doc_lexer.ml"
= Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
# 56 "atd/src/doc_lexer.mll"
                        ( paragraph a1 a2 (String.make 1 c :: a3) lexbuf )
# 207 "atd/src/doc_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
      __ocaml_lex_paragraph_rec a1 a2 a3 lexbuf __ocaml_lex_state

and inline_verbatim accu lexbuf =
   __ocaml_lex_inline_verbatim_rec accu lexbuf 18
and __ocaml_lex_inline_verbatim_rec accu lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 66 "atd/src/doc_lexer.mll"
                        ( inline_verbatim ("\\" :: accu) lexbuf )
# 219 "atd/src/doc_lexer.ml"

  | 1 ->
# 67 "atd/src/doc_lexer.mll"
                        ( inline_verbatim ("}}" :: accu) lexbuf )
# 224 "atd/src/doc_lexer.ml"

  | 2 ->
# 68 "atd/src/doc_lexer.mll"
                        ( inline_verbatim (" " :: accu) lexbuf )
# 229 "atd/src/doc_lexer.ml"

  | 3 ->
let
# 69 "atd/src/doc_lexer.mll"
                         s
# 235 "atd/src/doc_lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
# 70 "atd/src/doc_lexer.mll"
                        ( inline_verbatim (s :: accu) lexbuf )
# 239 "atd/src/doc_lexer.ml"

  | 4 ->
let
# 71 "atd/src/doc_lexer.mll"
         c
# 245 "atd/src/doc_lexer.ml"
= Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
# 71 "atd/src/doc_lexer.mll"
                        ( inline_verbatim (String.make 1 c :: accu) lexbuf )
# 249 "atd/src/doc_lexer.ml"

  | 5 ->
# 73 "atd/src/doc_lexer.mll"
                        ( String.concat "" (List.rev accu) )
# 254 "atd/src/doc_lexer.ml"

  | 6 ->
# 75 "atd/src/doc_lexer.mll"
                        ( failwith "Missing `}}'" )
# 259 "atd/src/doc_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
      __ocaml_lex_inline_verbatim_rec accu lexbuf __ocaml_lex_state

and verbatim accu lexbuf =
   __ocaml_lex_verbatim_rec accu lexbuf 29
and __ocaml_lex_verbatim_rec accu lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 84 "atd/src/doc_lexer.mll"
                        ( verbatim ("\\" :: accu) lexbuf )
# 271 "atd/src/doc_lexer.ml"

  | 1 ->
# 85 "atd/src/doc_lexer.mll"
                        ( verbatim ("}}}" :: accu) lexbuf )
# 276 "atd/src/doc_lexer.ml"

  | 2 ->
# 86 "atd/src/doc_lexer.mll"
                        ( verbatim ("        " :: accu) lexbuf )
# 281 "atd/src/doc_lexer.ml"

  | 3 ->
# 87 "atd/src/doc_lexer.mll"
                        ( verbatim ("\n" :: accu) lexbuf )
# 286 "atd/src/doc_lexer.ml"

  | 4 ->
let
# 88 "atd/src/doc_lexer.mll"
                         s
# 292 "atd/src/doc_lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
# 89 "atd/src/doc_lexer.mll"
                        ( verbatim (s :: accu) lexbuf )
# 296 "atd/src/doc_lexer.ml"

  | 5 ->
let
# 90 "atd/src/doc_lexer.mll"
         c
# 302 "atd/src/doc_lexer.ml"
= Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
# 90 "atd/src/doc_lexer.mll"
                        ( verbatim (String.make 1 c :: accu) lexbuf )
# 306 "atd/src/doc_lexer.ml"

  | 6 ->
# 92 "atd/src/doc_lexer.mll"
                        ( String.concat "" (List.rev accu) )
# 311 "atd/src/doc_lexer.ml"

  | 7 ->
# 94 "atd/src/doc_lexer.mll"
                        ( failwith "Missing `}}}'" )
# 316 "atd/src/doc_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
      __ocaml_lex_verbatim_rec accu lexbuf __ocaml_lex_state

;;

# 96 "atd/src/doc_lexer.mll"
 
  let parse_string s =
    let lexbuf = Lexing.from_string s in
    paragraph [] [] [] lexbuf

# 329 "atd/src/doc_lexer.ml"
OCaml

Innovation. Community. Security.