X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tools%2Flttng-gen-tp;fp=tools%2Flttng-gen-tp;h=828bee6e77e72780dddbc25a5689812127353b35;hb=e3feda7db3de3530e7c9c511536c36cccf317013;hp=3f28534858b318ae326ffeac67beb5f2febc104b;hpb=cf7b4f7a95b7a4ff78969206944a0ddc77efd6d7;p=lttng-ust.git diff --git a/tools/lttng-gen-tp b/tools/lttng-gen-tp old mode 100644 new mode 100755 index 3f285348..828bee6e --- a/tools/lttng-gen-tp +++ b/tools/lttng-gen-tp @@ -158,9 +158,11 @@ class TemplateFile: self.text = f.read() #Remove # comments (from input and output file - self.text = re.sub("#.*$","",self.text,flags=re.MULTILINE) + removeComments = re.compile("#.*$",flags=re.MULTILINE) + self.text = removeComments.sub("",self.text) #Remove // comments - nolinecomment = re.sub("\/\/.*$","",self.text,flags=re.MULTILINE) + removeLineComment = re.compile("\/\/.*$",flags=re.MULTILINE) + nolinecomment = removeLineComment.sub("",self.text) #Remove all spaces and lines cleantext = re.sub("\s*","",nolinecomment) #Remove multine C style comments