Reviewers: Mads Ager, Søren Gjesse,

Message:
Hopefully my sloppy regex skills don't destroy the world.

Description:
Strip /* */ style comments in js2c.  Saves ~17k of binary size.

Please review this at http://codereview.chromium.org/19012

Affected files:
   M tools/js2c.py


Index: tools/js2c.py
diff --git a/tools/js2c.py b/tools/js2c.py
index  
fb6d6c54a881e20cd60aad60673c9406c9e077e9..d568556ebfcd7df11df10051188cb8ff7635b770
  
100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -50,6 +50,7 @@ def CompressScript(lines):
    # Note that we could easily compress the scripts mode but don't
    # since we want it to remain readable.
    lines = re.sub('//.*\n', '\n', lines) # end-of-line comments
+  lines = re.sub(re.compile(r'/\*.*?\*/', re.DOTALL), '', lines) #  
comments.
    lines = re.sub('\s+\n+', '\n', lines) # trailing whitespace
    return lines




--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to