Permalink
Browse files

misc

  • Loading branch information...
1 parent a5b6c20 commit 4bdc05418ac2c6f7911b00310fe5f9834489552a pad committed Nov 11, 2010
View
@@ -547,7 +547,7 @@ website:
.PHONY:: tags visual db
tags:
- ./pfff_tags -verbose -lang ml .
+ ./stags -verbose -lang ml .
db:
./pfff_db_light -verbose -lang ml -o DB_LIGHT .
@@ -623,6 +623,12 @@ let index_db1_2 db files =
* do not add it otherwise id will not be a primary key.
*)
| Ast.FinalDef _ -> ()
+ (* do we want to add the NotParsedCorrectly in the db ? It
+ * can be useful in the code visualizer to have all
+ * the elements in a file, including the one that do not
+ * parse.
+ * Note that this id does not have a id_kind for now.
+ *)
| _ ->
let id = db +> add_toplevel2 file (topelem, info_item) in
Common.push2 id all_ids;
@@ -1393,9 +1399,16 @@ let create_db
(*****************************************************************************)
-(* Misc operations *)
+(* Fast db construction *)
(*****************************************************************************)
+(* The goal here is to build a database containing enough context, enough
+ * relevant files, to be able to do interesting global analysis on a file
+ * passed as a parameter to one of our command line program.
+ *)
+let fast_create_db_mem ?phase files_or_dirs =
+ raise Todo
+
(*****************************************************************************)
(* Main entry for Arg *)
(*****************************************************************************)
@@ -12,6 +12,12 @@ val create_db :
Database_php.project ->
Database_php.database
+(* use Include_require_php.recursive_included_files_of_file *)
+val fast_create_db_mem:
+ ?phase:int ->
+ Common.path list ->
+ Database_php.database
+
(* wrapper that makes it easier for some code to not depend on database_php *)
val build_entity_finder:
Database_php.database -> Ast_entity_php.entity_finder
@@ -1016,7 +1016,11 @@ let col_of_id id db =
fullid.EC.column
let kind_of_id id db =
- db.defs.id_kind#assoc id
+ try
+ db.defs.id_kind#assoc id
+ (* probably because of NotParsedCorrectly entities *)
+ with Not_found ->
+ EC.IdMisc
let readable_filename_of_id id db =
let file = filename_of_id id db in

0 comments on commit 4bdc054

Please sign in to comment.