package sexplib
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Library for serializing OCaml values to and from S-expressions
Install
dune-project
Dependency
Authors
Maintainers
Sources
sexplib-v0.16.0.tar.gz
sha256=e564d5d1ca157314ba5fd64b4e89fa12c6cba8efee3becf6d09d7d9dda21ac5b
doc/src/sexplib/parser_with_layout.ml.html
Source file parser_with_layout.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 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398type token = | STRING of ( # 53 "src/parser_with_layout.mly" string * (Lexing.position * string) option # 6 "src/parser_with_layout.ml" ) | COMMENT of ( # 54 "src/parser_with_layout.mly" string * Lexing.position option # 11 "src/parser_with_layout.ml" ) | LPAREN | RPAREN | EOF | HASH_SEMI open Parsing let _ = parse_error;; # 2 "src/parser_with_layout.mly" (* Parser: Grammar Specification for Parsing S-expressions *) (* compare to parser.mly *) open Lexing let parse_failure what = let pos = Parsing.symbol_start_pos () in let msg = Printf.sprintf "Sexplib.Parser: failed to parse line %d char %d: %s" pos.pos_lnum (pos.pos_cnum - pos.pos_bol) what in failwith msg module With_pos = struct open Type_with_layout.Parsed let coerce = Src_pos.Absolute.of_lexing let start_pos () = coerce (Parsing.symbol_start_pos ()) let end_pos () = let p = Parsing.symbol_end_pos () in coerce { p with Lexing.pos_cnum = p.Lexing.pos_cnum - 1 } let atom (x, y) = let (pos, y) = match y with | None -> (start_pos (), Some x) | Some (pos, x) -> (coerce pos, Some x) in Atom (pos, x, y) let list ts = List (start_pos (), ts, end_pos ()) let sexp x = Sexp x let comment x = Comment x let sexp_comment cs t = Sexp_comment (start_pos (), cs, t) let plain_comment (x, pos_opt) = let pos = match pos_opt with | None -> start_pos () | Some pos -> coerce pos in Plain_comment (pos, x) end # 70 "src/parser_with_layout.ml" let yytransl_const = [| 259 (* LPAREN *); 260 (* RPAREN *); 0 (* EOF *); 261 (* HASH_SEMI *); 0|] let yytransl_block = [| 257 (* STRING *); 258 (* COMMENT *); 0|] let yylhs = "\255\255\ \006\000\006\000\006\000\008\000\008\000\009\000\009\000\010\000\ \010\000\007\000\007\000\001\000\002\000\002\000\011\000\011\000\ \005\000\005\000\003\000\003\000\004\000\000\000\000\000\000\000\ \000\000\000\000" let yylen = "\002\000\ \001\000\003\000\001\000\001\000\003\000\000\000\002\000\001\000\ \001\000\000\000\002\000\001\000\001\000\001\000\001\000\002\000\ \002\000\001\000\002\000\001\000\002\000\002\000\002\000\002\000\ \002\000\002\000" let yydefred = "\000\000\ \000\000\000\000\000\000\010\000\000\000\000\000\003\000\001\000\ \004\000\010\000\006\000\022\000\008\000\009\000\012\000\014\000\ \013\000\023\000\020\000\015\000\024\000\000\000\025\000\000\000\ \018\000\026\000\000\000\000\000\000\000\019\000\016\000\021\000\ \011\000\017\000\002\000\005\000\007\000" let yydgoto = "\006\000\ \020\000\018\000\021\000\023\000\026\000\013\000\024\000\014\000\ \029\000\015\000\022\000" let yysindex = "\037\000\ \009\255\001\000\007\000\000\000\013\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\019\000\000\000\025\000\ \000\000\000\000\031\000\032\255\009\255\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000" let yyrindex = "\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" let yygindex = "\000\000\ \002\000\000\000\000\000\000\000\000\000\227\255\251\255\235\255\ \000\000\234\255\010\000" let yytablesize = 292 let yytable = "\036\000\ \016\000\033\000\012\000\017\000\028\000\033\000\019\000\037\000\ \007\000\008\000\009\000\010\000\025\000\011\000\027\000\000\000\ \000\000\000\000\030\000\000\000\000\000\000\000\000\000\031\000\ \032\000\000\000\000\000\000\000\031\000\000\000\034\000\007\000\ \008\000\009\000\010\000\035\000\011\000\001\000\002\000\003\000\ \004\000\005\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\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\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\ \007\000\008\000\009\000\010\000\000\000\011\000\007\000\008\000\ \009\000\010\000\000\000\011\000\007\000\008\000\009\000\010\000\ \000\000\011\000\007\000\008\000\009\000\010\000\000\000\011\000\ \007\000\008\000\009\000\010\000\000\000\011\000\007\000\008\000\ \009\000\010\000\000\000\011\000" let yycheck = "\029\000\ \000\000\024\000\001\000\002\000\010\000\028\000\000\000\029\000\ \000\001\001\001\002\001\003\001\000\000\005\001\005\000\255\255\ \255\255\255\255\000\000\255\255\255\255\255\255\255\255\022\000\ \000\000\255\255\255\255\255\255\027\000\255\255\000\000\000\001\ \001\001\002\001\003\001\004\001\005\001\001\000\002\000\003\000\ \004\000\005\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\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\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\001\001\001\002\001\003\001\255\255\005\001\000\001\001\001\ \002\001\003\001\255\255\005\001\000\001\001\001\002\001\003\001\ \255\255\005\001\000\001\001\001\002\001\003\001\255\255\005\001\ \000\001\001\001\002\001\003\001\255\255\005\001\000\001\001\001\ \002\001\003\001\255\255\005\001" let yynames_const = "\ LPAREN\000\ RPAREN\000\ EOF\000\ HASH_SEMI\000\ " let yynames_block = "\ STRING\000\ COMMENT\000\ " let yyact = [| (fun _ -> failwith "parser") ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 0 : string * (Lexing.position * string) option) in Obj.repr( # 75 "src/parser_with_layout.mly" ( With_pos.atom _1 ) # 222 "src/parser_with_layout.ml" : 'sexp_but_no_comment_abs)) ; (fun __caml_parser_env -> let _2 = (Parsing.peek_val __caml_parser_env 1 : 'rev_sexps_abs) in Obj.repr( # 76 "src/parser_with_layout.mly" ( With_pos.list (List.rev _2) ) # 229 "src/parser_with_layout.ml" : 'sexp_but_no_comment_abs)) ; (fun __caml_parser_env -> Obj.repr( # 77 "src/parser_with_layout.mly" ( parse_failure "sexp" ) # 235 "src/parser_with_layout.ml" : 'sexp_but_no_comment_abs)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 0 : string * Lexing.position option) in Obj.repr( # 80 "src/parser_with_layout.mly" ( With_pos.plain_comment _1 ) # 242 "src/parser_with_layout.ml" : 'comment_abs)) ; (fun __caml_parser_env -> let _2 = (Parsing.peek_val __caml_parser_env 1 : 'rev_comments_abs) in let _3 = (Parsing.peek_val __caml_parser_env 0 : 'sexp_but_no_comment_abs) in Obj.repr( # 81 "src/parser_with_layout.mly" ( With_pos.sexp_comment (List.rev _2) _3 ) # 250 "src/parser_with_layout.ml" : 'comment_abs)) ; (fun __caml_parser_env -> Obj.repr( # 84 "src/parser_with_layout.mly" ( [] ) # 256 "src/parser_with_layout.ml" : 'rev_comments_abs)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 1 : 'rev_comments_abs) in let _2 = (Parsing.peek_val __caml_parser_env 0 : 'comment_abs) in Obj.repr( # 85 "src/parser_with_layout.mly" ( _2 :: _1 ) # 264 "src/parser_with_layout.ml" : 'rev_comments_abs)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 0 : 'sexp_but_no_comment_abs) in Obj.repr( # 88 "src/parser_with_layout.mly" ( With_pos.sexp _1 ) # 271 "src/parser_with_layout.ml" : 'sexp_abs)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 0 : 'comment_abs) in Obj.repr( # 89 "src/parser_with_layout.mly" ( With_pos.comment _1 ) # 278 "src/parser_with_layout.ml" : 'sexp_abs)) ; (fun __caml_parser_env -> Obj.repr( # 92 "src/parser_with_layout.mly" ( [] ) # 284 "src/parser_with_layout.ml" : 'rev_sexps_abs)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 1 : 'rev_sexps_abs) in let _2 = (Parsing.peek_val __caml_parser_env 0 : 'sexp_abs) in Obj.repr( # 93 "src/parser_with_layout.mly" ( _2 :: _1 ) # 292 "src/parser_with_layout.ml" : 'rev_sexps_abs)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 0 : 'sexp_abs) in Obj.repr( # 96 "src/parser_with_layout.mly" ( Type_with_layout.relativize _1 ) # 299 "src/parser_with_layout.ml" : Type_with_layout.t_or_comment)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 0 : Type_with_layout.t_or_comment) in Obj.repr( # 99 "src/parser_with_layout.mly" ( Some _1 ) # 306 "src/parser_with_layout.ml" : Type_with_layout.t_or_comment option)) ; (fun __caml_parser_env -> Obj.repr( # 100 "src/parser_with_layout.mly" ( None ) # 312 "src/parser_with_layout.ml" : Type_with_layout.t_or_comment option)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 0 : Type_with_layout.t_or_comment) in Obj.repr( # 103 "src/parser_with_layout.mly" ( [_1] ) # 319 "src/parser_with_layout.ml" : 'rev_sexps_aux)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 1 : 'rev_sexps_aux) in let _2 = (Parsing.peek_val __caml_parser_env 0 : Type_with_layout.t_or_comment) in Obj.repr( # 104 "src/parser_with_layout.mly" ( _2 :: _1 ) # 327 "src/parser_with_layout.ml" : 'rev_sexps_aux)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 1 : 'rev_sexps_aux) in Obj.repr( # 107 "src/parser_with_layout.mly" ( _1 ) # 334 "src/parser_with_layout.ml" : Type_with_layout.t_or_comment list)) ; (fun __caml_parser_env -> Obj.repr( # 108 "src/parser_with_layout.mly" ( [] ) # 340 "src/parser_with_layout.ml" : Type_with_layout.t_or_comment list)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 1 : 'rev_sexps_aux) in Obj.repr( # 111 "src/parser_with_layout.mly" ( List.rev _1 ) # 347 "src/parser_with_layout.ml" : Type_with_layout.t_or_comment list)) ; (fun __caml_parser_env -> Obj.repr( # 112 "src/parser_with_layout.mly" ( [] ) # 353 "src/parser_with_layout.ml" : Type_with_layout.t_or_comment list)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 1 : 'rev_sexps_abs) in Obj.repr( # 116 "src/parser_with_layout.mly" ( List.rev _1 ) # 360 "src/parser_with_layout.ml" : Type_with_layout.Parsed.t_or_comment list)) (* Entry sexp *) ; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0))) (* Entry sexp_opt *) ; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0))) (* Entry sexps *) ; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0))) (* Entry sexps_abs *) ; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0))) (* Entry rev_sexps *) ; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0))) |] let yytables = { Parsing.actions=yyact; Parsing.transl_const=yytransl_const; Parsing.transl_block=yytransl_block; Parsing.lhs=yylhs; Parsing.len=yylen; Parsing.defred=yydefred; Parsing.dgoto=yydgoto; Parsing.sindex=yysindex; Parsing.rindex=yyrindex; Parsing.gindex=yygindex; Parsing.tablesize=yytablesize; Parsing.table=yytable; Parsing.check=yycheck; Parsing.error_function=parse_error; Parsing.names_const=yynames_const; Parsing.names_block=yynames_block } let sexp (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) = (Parsing.yyparse yytables 1 lexfun lexbuf : Type_with_layout.t_or_comment) let sexp_opt (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) = (Parsing.yyparse yytables 2 lexfun lexbuf : Type_with_layout.t_or_comment option) let sexps (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) = (Parsing.yyparse yytables 3 lexfun lexbuf : Type_with_layout.t_or_comment list) let sexps_abs (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) = (Parsing.yyparse yytables 4 lexfun lexbuf : Type_with_layout.Parsed.t_or_comment list) let rev_sexps (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) = (Parsing.yyparse yytables 5 lexfun lexbuf : Type_with_layout.t_or_comment list)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>