package pfff

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file info_code.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
(* Yoann Padioleau
 *
 * Copyright (C) 2012 Facebook
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * version 2.1 as published by the Free Software Foundation, with the
 * special exception on linking described in file license.txt.
 * 
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the file
 * license.txt for more details.
 *)

(*****************************************************************************)
(* Prelude *)
(*****************************************************************************)
(*
 * history:
 *  - was in main_codestat.ml
 * 
 * Example of project information:
 *  - http://www.gnu.org/manual/blurbs.html
 *)


(*****************************************************************************)
(* Types *)
(*****************************************************************************)

type info_txt = Outline.outline
 (* old: (string * string list) list *)

(*****************************************************************************)
(* IO *)
(*****************************************************************************)

let load file =
  Outline.parse_outline file

(* old:
  let xs = 
    Common.cat file
    +> List.map (Str.global_replace (Str.regexp "#.*") "" )
    +> List.map (Str.global_replace (Str.regexp "\\*+ -----.*") "" )
    +> Common.exclude Common.is_blank_string 
  in
  let xxs = Common.split_list_regexp "^\\*+ " xs in
  xxs +> List.map (fun (s, body) ->
    if s =~ "^\\*+ \\([^ ]+\\)[ \t]*$"
    then 
      let dir = Common.matched1 s in
      dir, body
    else 
      failwith (spf "wrong format in %s, entry: %s" file s)
  )

*)
OCaml

Innovation. Community. Security.