facebookarchive / pfff

Tools for code analysis, visualizations, or style-preserving source transformation.
http://github.com/facebook/pfff/wiki/Main
Other
2.44k stars 204 forks source link

Fatal error: exception Common.Todo #162

Open dbeecham opened 5 years ago

dbeecham commented 5 years ago
$ pfff -parse_c .
PARSING: ./src/x.c
PARSING: ./src/y.c
PARSING: ./src/z.c
Cpp(PragmaAndCo(()))
PB: Ast_c_build, on ./src/z.c (exn = Common.Todo)
Fatal error: exception Common.Todo

same thing with codegraph:

$ codegraph -lang c -build .
Using /usr/local/share/pfff//data/cpp_stdlib/macros.h macro file

step0: parsing
Cpp(PragmaAndCo(()))
PB: Ast_c_build, on [...]/src/z.c (exn = Common.Todo)
(ONCE) PARSE ERROR with [...]/src/z.c, exn = Common.Todo
Fatal error: exception Common.Todo
aryx commented 5 years ago

Yes -parse_c is very rudimentary. You may want -parse_cpp instead. I wrote -parse_c by using the C++ parser in pfff with its very complicated ast_cpp.ml file and converting only the subset of C I need from ast_cpp.ml to ast_c_simple.ml. The error means the constructs from ast_cpp.ml has no correspondance in ast_c_simple.ml