Index: third_party/closure_compiler/checker.py |
diff --git a/third_party/closure_compiler/checker.py b/third_party/closure_compiler/checker.py |
index 7dda25fc1fc2cfcfcc88efc11203e29e65cba4ac..5a6db172fb807049e397d2e716fb95bd3c054432 100644 |
--- a/third_party/closure_compiler/checker.py |
+++ b/third_party/closure_compiler/checker.py |
@@ -31,6 +31,7 @@ class FileCache(object): |
class Flattener(object): |
+ _IF_TAGS_REG = "</?if[^>]*?>" |
_INCLUDE_REG = "<include[^>]+src=['\"]([^>]*)['\"]>" |
def __init__(self, file): |
@@ -46,6 +47,11 @@ class Flattener(object): |
else: |
self.index += 1 |
+ # Replace every occurrence of tags like <if expr="..."> and </if> |
+ # with an empty string. |
Dan Beam
2014/08/02 00:04:56
^ i think the code pretty clearly shows this, but
|
+ for i, line in enumerate(self.lines): |
+ self.lines[i] = line[:2] + (re.sub(self._IF_TAGS_REG, "", line[2]),) |
+ |
self.contents = "\n".join(l[2] for l in self.lines) |
# Returns a list of tuples in the format: (file, line number, line contents). |