package odoc
All checked builds pass sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
OCaml Documentation Generator
Install
dune-project
Dependency
Authors
Maintainers
Sources
odoc-3.2.2.tbz
sha256=d7b9567ec9f2f99c4557999d78e268c97bcb5cab8770b5e74d694f5abd6dffae
sha512=444aedb4bbf132c45a198f73dbd282048a1e76cd4df739f530334f4c575575784e5db49392c798b997db9ae5d429a40a3618de7ffe71e5a60fbb29c67d5a7da2
doc/src/odoc.model/location_.ml.html
Source file location_.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 42include Odoc_parser.Loc let set_end_as_offset_from_start offset span = { span with end_ = { span.start with column = span.start.column + offset } } let point_in_string s offset point = let rec scan_string line column index = if index >= offset then (line, column) else if index >= String.length s then (line, column) else match s.[index] with | '\n' -> scan_string (line + 1) 0 (index + 1) | _ -> scan_string line (column + 1) (index + 1) in let line, column = scan_string 0 0 0 in { line = point.line + line; column = point.column + column } (* Calling this repeatedly on the same string can be optimized, but there is no evidence yet that performance of this is a problem. *) let in_string s ~offset ~length s_span = { s_span with start = point_in_string s offset s_span.start; end_ = point_in_string s (offset + length) s_span.start; } let pp fmt l = Format.fprintf fmt "File \"%s\", " l.file; if l.start.line = l.end_.line then Format.fprintf fmt "line %i, characters %i-%i" l.start.line l.start.column l.end_.column else Format.fprintf fmt "line %i, character %i to line %i, character %i" l.start.line l.start.column l.end_.line l.end_.column let pp_span_start fmt s = Format.fprintf fmt "File \"%s\", line %d, character %d" s.file s.start.line s.start.column let span_equal = ( = )
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>