Lines 4-11
Link Here
|
4 |
|
4 |
|
5 |
(* $Id: pr.ml,v 1.17 2007-04-06 20:58:17 tews Exp $ *) |
5 |
(* $Id: pr.ml,v 1.17 2007-04-06 20:58:17 tews Exp $ *) |
6 |
|
6 |
|
7 |
(* ocamlc options: !-pp "camlp4o q_MLast.cmo" -I `camlp4o -where`!*) |
7 |
(* ocamlc options: !-pp "camlp5o q_MLast.cmo" -I `camlp5 -where`!*) |
8 |
(* ocamldep options: !-pp "camlp4o q_MLast.cmo"!*) |
8 |
(* ocamldep options: !-pp "camlp5o q_MLast.cmo"!*) |
|
|
9 |
|
9 |
|
10 |
|
10 |
module type Tags_param = sig |
11 |
module type Tags_param = sig |
11 |
val add : string -> int * int -> unit |
12 |
val add : string -> int * int -> unit |
Lines 20-26
Link Here
|
20 |
*) |
21 |
*) |
21 |
|
22 |
|
22 |
(* TODO: remove this crap *) |
23 |
(* TODO: remove this crap *) |
23 |
let kludge (a, b) = a.Lexing.pos_cnum, b.Lexing.pos_cnum |
24 |
(*let kludge (a, b) = a.Lexing.pos_cnum, b.Lexing.pos_cnum*) |
|
|
25 |
let kludge loc = (Stdpp.first_pos loc), (Stdpp.last_pos loc) |
24 |
|
26 |
|
25 |
let rec pe_patt ast = |
27 |
let rec pe_patt ast = |
26 |
let loc = kludge (MLast.loc_of_patt ast) in |
28 |
let loc = kludge (MLast.loc_of_patt ast) in |
Lines 125-131
Link Here
|
125 |
| <:str_item< module type $i$ = $mt$ >> |
127 |
| <:str_item< module type $i$ = $mt$ >> |
126 |
-> T.add i loc; pe_module_type_expr mt |
128 |
-> T.add i loc; pe_module_type_expr mt |
127 |
| <:str_item< type $list:ssltl$ >> -> |
129 |
| <:str_item< type $list:ssltl$ >> -> |
128 |
List.iter (fun ((loc,s),_,c,_) -> T.add s (kludge loc); pe_ctyp c) ssltl |
130 |
(*List.iter (fun ((loc,s),_,c,_) -> T.add s (kludge loc); pe_ctyp c) ssltl*) |
|
|
131 |
List.iter (fun td -> |
132 |
let loc,s = td.MLast.tdNam in |
133 |
T.add s (kludge loc); |
134 |
pe_ctyp td.MLast.tdDef |
135 |
) ssltl |
136 |
|
129 |
| <:str_item< value $opt:rf$ $list:pel$ >> -> List.iter (fun (p, _) -> pe_patt p) pel |
137 |
| <:str_item< value $opt:rf$ $list:pel$ >> -> List.iter (fun (p, _) -> pe_patt p) pel |
130 |
| <:str_item< class $list:cd$ >> -> |
138 |
| <:str_item< class $list:cd$ >> -> |
131 |
List.iter (etag_class_info) cd |
139 |
List.iter (etag_class_info) cd |
Lines 179-185
Link Here
|
179 |
-> T.add i loc; pe_module_type_expr mt |
187 |
-> T.add i loc; pe_module_type_expr mt |
180 |
| <:sig_item< open $sl$ >> -> () |
188 |
| <:sig_item< open $sl$ >> -> () |
181 |
| <:sig_item< type $list:ssltl$ >> -> |
189 |
| <:sig_item< type $list:ssltl$ >> -> |
182 |
List.iter (fun ((loc,s),_,c,_) -> T.add s (kludge loc); pe_ctyp c) ssltl |
190 |
(*List.iter (fun ((loc,s),_,c,_) -> T.add s (kludge loc); pe_ctyp c) ssltl*) |
|
|
191 |
List.iter |
192 |
(fun td -> |
193 |
let loc,s = td.MLast.tdNam in |
194 |
T.add s (kludge loc); |
195 |
pe_ctyp td.MLast.tdDef |
196 |
) ssltl |
183 |
| <:sig_item< value $s$ : $t$ >> -> T.add s loc |
197 |
| <:sig_item< value $s$ : $t$ >> -> T.add s loc |
184 |
| <:sig_item< class $list:cd$ >> -> List.iter (etag_class_type_info) cd |
198 |
| <:sig_item< class $list:cd$ >> -> List.iter (etag_class_type_info) cd |
185 |
| <:sig_item< class type $list:cd$ >> -> List.iter etag_class_type_info cd |
199 |
| <:sig_item< class type $list:cd$ >> -> List.iter etag_class_type_info cd |