X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tools%2Flttng-gen-tp;fp=tools%2Flttng-gen-tp;h=828bee6e77e72780dddbc25a5689812127353b35;hb=c233fe111bc72058f209cd86a7b0807c3a123dfb;hp=3f28534858b318ae326ffeac67beb5f2febc104b;hpb=bacd78c02130be2d5f5c0eb31bd0fa843c8cd561;p=lttng-ust.git diff --git a/tools/lttng-gen-tp b/tools/lttng-gen-tp index 3f285348..828bee6e 100755 --- 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