@ -372,7 +372,9 @@ and skip_comments action = parse
(* * We scan source file [file] and record location of each class declaration *)
(* * We scan source file [file] and record location of each class declaration *)
let collect_class_location ( program : JClasspath . program ) ( file : SourceFile . t ) =
let collect_class_location ( program : JClasspath . program ) ( file : SourceFile . t ) =
let cin = In_channel . create ( SourceFile . to_abs_path file ) in
let path = SourceFile . to_abs_path file in
if String . is_suffix path ~ suffix : " .java " then (
let cin = In_channel . create path in
let stack = [] in
let stack = [] in
let record_location ~ classname ~ col ~ line =
let record_location ~ classname ~ col ~ line =
let loc : Location . t = { line ; col ; file } in
let loc : Location . t = { line ; col ; file } in
@ -385,17 +387,18 @@ and skip_comments action = parse
In_channel . close cin )
In_channel . close cin )
with
with
| Failure s ->
| Failure s ->
raise
Logging . debug Capture Verbose " Error parsing source file %s \n %s "
( Failure
( SourceFile . to_abs_path file ) s ;
( Printf . sprintf " Error parsing source file %s \n %s " ( SourceFile . to_abs_path file ) s ) )
In_channel . close cin
| Missing_opening_bracket ->
| Missing_opening_bracket ->
raise
Logging . debug Capture Verbose
( Failure ( Printf . sprintf " Missing opening bracket error while parsing source file %s \n "
" Missing opening bracket error while parsing source file %s \n "
( SourceFile . to_abs_path file ) ) )
( SourceFile . to_abs_path file ) ;
In_channel . close cin
| Missing_opening_parenthesis ->
| Missing_opening_parenthesis ->
rai se
Logging . debug Capture Verbo se
( Failure
" Missing opening parenthesis error while parsing source file %s \n "
( Printf . sprintf " Missing opening parenthesis error while parsing source file %s \n "
( SourceFile . to_abs_path file ) ;
( SourceFile . to_abs_path file ) ) )
In_channel . close cin
)
}
}