From c213425cf91f7a9f3145177fa13349dc9b4ab56e Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 27 Jan 2021 20:07:39 +0100 Subject: [PATCH] c_2_ast.py - clang arguments -std=c99 (TODO:move to cfg file) --- pEpACIDgen/c_2_ast.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pEpACIDgen/c_2_ast.py b/pEpACIDgen/c_2_ast.py index 0a998f2..551ef06 100644 --- a/pEpACIDgen/c_2_ast.py +++ b/pEpACIDgen/c_2_ast.py @@ -18,7 +18,7 @@ class C2AST: def parse(self, filename, content=None, follow_includes=False): index = clang.cindex.Index.create() - arguments = ["-x", "c", "-I/Users/heck/local-default/include/"] + arguments = [ "-std=c99","-I/Users/heck/local-default/include/"] options = clang.cindex.TranslationUnit.PARSE_SKIP_FUNCTION_BODIES if content: content = [(filename, content)] @@ -57,11 +57,11 @@ class C2AST: } # generic info for all CursorKinds - if str(cursor.get_tokens()): - str_tok = "" - for tok in cursor.get_tokens(): - str_tok += tok.spelling + " " - item["tokens"] = str_tok.rstrip() + # if str(cursor.get_tokens()): + # str_tok = "" + # for tok in cursor.get_tokens(): + # str_tok += tok.spelling + " " + # item["tokens"] = str_tok.rstrip() if str(cursor.kind): item["kind"] = str(cursor.kind)