1 (* Function table management *)
3 type pos
= { current_element
: string;
13 | Type
of Ast_c.fullType
14 | Init
of Ast_c.initialiser
15 | InitList
of Ast_c.initialiser
Ast_c.wrap2 list
17 | Param
of Ast_c.parameterType
18 | ParamList
of Ast_c.parameterType
Ast_c.wrap2 list
19 | Expr
of Ast_c.expression
20 | ExprList
of Ast_c.argument
Ast_c.wrap2 list
21 | Decl
of Ast_c.declaration
22 | Field
of Ast_c.field
23 | FieldList
of Ast_c.field list
24 | Stmt
of Ast_c.statement
26 let fcts : (string, param_type list
-> string ref list
-> unit) Hashtbl.t
=
27 Hashtbl.create
11 (* Use prime number *)
29 (* ---------------------------------------------------------------------- *)
30 (* Match management *)
32 let inc_match = ref true
33 let include_match x
= inc_match := x
35 let exited = ref false
36 let exit _
= exited := true
38 let dir () = !Flag.dir
40 (* ---------------------------------------------------------------------- *)
43 let build_link p msg color
=
45 "[[view:%s::face=%s::linb=%d::colb=%d::cole=%d][%s]]"
46 p
.file color p
.line p
.col p
.col_end msg
48 let print_todo ?color
:(color
="ovl-face1") ?msg
:(msg
="") p
=
51 then Printf.sprintf
"%s::%d" p
.file p
.line
53 Printf.printf
"* TODO %s\n" (build_link p
msg color
)
55 let print_link ?color
:(color
="ovl-face2") ?
msg:(msg="") p
=
58 then Printf.sprintf
"%s::%d" p
.file p
.line
60 Printf.printf
"%s\n" (build_link p
msg color
)
62 let print_safe_todo ?color
:(color
="ovl-face1") ?
msg:(msg="") p
=
63 let msg = String.concat
"@(" (Str.split_delim
(Str.regexp_string
"[") msg) in
64 let msg = String.concat
")" (Str.split_delim
(Str.regexp_string
"]") msg) in
65 print_todo ~color
:color ~
msg:msg p
67 let print_safe_link ?color
:(color
="ovl-face2") ?
msg:(msg="") p
=
68 let msg = String.concat
"@(" (Str.split_delim
(Str.regexp_string
"[") msg) in
69 let msg = String.concat
")" (Str.split_delim
(Str.regexp_string
"]") msg) in
70 print_link ~color
:color ~
msg:msg p
73 print_main, print_sec and print_secs
75 let print_main ?color
:(color
="ovl-face1") msg ps
=
79 then Printf.sprintf
"%s::%d" p.file
p.line
80 else Printf.sprintf
"%s %s::%d" msg p.file
p.line
in
81 print_todo ~color
:color ~
msg:oldmsgfmt p
83 let print_sec ?color
:(color
="ovl-face2") msg ps
=
84 print_link ~color
:color ~
msg:msg (List.hd ps
)
86 let print_secs ?color
:(color
="ovl-face2") msg ps
=
87 List.iter
(function i
-> print_link ~color
:color ~
msg:msg i
) ps