package phylogenetics

  1. Overview
  2. Docs
Algorithms and datastructures for phylogenetics

Install

dune-project
 Dependency

Authors

Maintainers

Sources

phylogenetics-0.3.0.tbz
sha256=de867d7cc017a8e434dab43ef16f0f6495973892cd7b6a8446b18e79393704a8
sha512=0209538caf94be47eabcaa25399c54849bd4fa0fc79e0579acee27f46ef3b72aa50e17bdb48fed8e86674d4caee6c1c4c423833a2757db12e2a6cc28234510de

doc/src/phylogenetics/newick_ast.ml.html

Source file newick_ast.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
type tag = string * string

type t = {
  name : string option ;
  tags : tag list ;
  parent_branch : float option ;
  children : t list ;
}

type error_desc = {
  offset : int ;
  line : int ;
  column : int ;
  msg : string ;
}

let string_of_error_desc e =
  Printf.sprintf "Error at line %d, column %d: %s" e.line e.column e.msg

type error = [`Newick_parser_error of error_desc]

let mkerror lexbuf msg =
  let pos = Lexing.lexeme_start_p lexbuf in
  let line = pos.pos_lnum in
  let column = pos.pos_cnum - pos.pos_bol + 1 in
  let offset = pos.pos_cnum in
  `Newick_parser_error { offset ; line ; column ; msg }

let string_of_error (`Newick_parser_error ed) = string_of_error_desc ed