File: ag_indent.ml

package info (click to toggle)
atdgen 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 592 kB
  • ctags: 784
  • sloc: ml: 7,629; makefile: 314; sh: 18
file content (18 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

(*
  Atd_indent extended with annnotations allowing some postprocessing.
*)

type t =
    [
    | `Line of string        (* single line (not indented) *)
    | `Block of t list       (* indented sequence *)
    | `Inline of t list      (* in-line sequence (not indented) *)
    | `Annot of (string * t) (* arbitrary annotation *)
    ]

let rec strip : t -> Atd_indent.t = function
    `Line _ as x -> x
  | `Block l -> `Block (List.map strip l)
  | `Inline l -> `Inline (List.map strip l)
  | `Annot (_, x) -> strip x