aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2011-05-18 21:22:22 +0200
committerSebastian Parborg <darkdefende@gmail.com>2011-05-18 21:22:22 +0200
commit57fe69bdc8c50fcc45f98976e74921c11e04492c (patch)
treeaea489e707e0a9ffd63e4180d3acbd228202cc57
parentAdded a simple CLI (diff)
downloadebuildgen-57fe69bdc8c50fcc45f98976e74921c11e04492c.tar.gz
ebuildgen-57fe69bdc8c50fcc45f98976e74921c11e04492c.tar.bz2
ebuildgen-57fe69bdc8c50fcc45f98976e74921c11e04492c.zip
Added support for #if 0 out commenting
-rw-r--r--scanfiles.py8
-rw-r--r--test.h8
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):
diff --git a/test.h b/test.h
index 1676292..44a5f2b 100644
--- a/test.h
+++ b/test.h
@@ -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"