diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2011-05-18 21:22:22 +0200 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2011-05-18 21:22:22 +0200 |
commit | 57fe69bdc8c50fcc45f98976e74921c11e04492c (patch) | |
tree | aea489e707e0a9ffd63e4180d3acbd228202cc57 | |
parent | Added a simple CLI (diff) | |
download | ebuildgen-57fe69bdc8c50fcc45f98976e74921c11e04492c.tar.gz ebuildgen-57fe69bdc8c50fcc45f98976e74921c11e04492c.tar.bz2 ebuildgen-57fe69bdc8c50fcc45f98976e74921c11e04492c.zip |
Added support for #if 0 out commenting
-rw-r--r-- | scanfiles.py | 8 | ||||
-rw-r--r-- | test.h | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/scanfiles.py b/scanfiles.py index 26ebb7e..c833ff8 100644 --- a/scanfiles.py +++ b/scanfiles.py @@ -13,8 +13,6 @@ def scandir(dir, filetypes): files += glob.glob(dir + "/*" + filetype) return files -#print(scandir("/home/zed/Desktop/test/smw/", ".cpp")) - #lex stuff begins here def scanincludes(string,global_hfiles,local_hfiles): @@ -28,7 +26,11 @@ def scanincludes(string,global_hfiles,local_hfiles): t_ignore = " \t" def t_comment(t): - r'(/\*(.|\n)*\*/)|(//.*)' + r"(/\*(.|\n)*\*/)|(//.*)" + pass + + def t_if0(t): + r"\#if[ \t]+0(.|\n)*\#endif" pass def t_INCLUDE(t): @@ -6,5 +6,11 @@ #include "wrong.h" sdasdasdasd */ // #include "wrong.h" -#include "last.h" +#include "notlast.h" #include <strings> + +#if 0 +#include <still_wrong.h> +#endif + +#include "last.h" |