<http://webkit.org/b/64972> Clean up generated HTMLEntityTable.cpp output
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jul 2011 20:23:41 +0000 (20:23 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jul 2011 20:23:41 +0000 (20:23 +0000)
Reviewed by Eric Seidel.

* html/parser/create-html-entity-table:
- Fix duplicate "EntityName" suffix on local variables (changes
  fooSemicolonEntityNameEntityName to fooSemicolonEntityName)
  for all 2138 symbols.
- Add newlines to make source file human-readable (as originally
  intended).
- Add static (const) keywords to local variables that are never
  referenced externally.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@91494 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/parser/create-html-entity-table

index ce3338e..89e3cc4 100644 (file)
@@ -1,3 +1,18 @@
+2011-07-21  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/64972> Clean up generated HTMLEntityTable.cpp output
+
+        Reviewed by Eric Seidel.
+
+        * html/parser/create-html-entity-table:
+        - Fix duplicate "EntityName" suffix on local variables (changes
+          fooSemicolonEntityNameEntityName to fooSemicolonEntityName)
+          for all 2138 symbols.
+        - Add newlines to make source file human-readable (as originally
+          intended).
+        - Add static (const) keywords to local variables that are never
+          referenced externally.
+
 2011-07-21  Mark Pilgrim  <pilgrim@chromium.org>
 
         Remove LegacyDefaultOptionalArguments flag from FileAPI
index 92fb39c..73674a2 100755 (executable)
@@ -111,12 +111,12 @@ namespace {
 """)
 
 for entry in entries:
-    output_file.write("const UChar %sEntityName[] = %s;" % (
+    output_file.write("static const UChar %s[] = %s;\n" % (
         convert_entity_to_cpp_name(entry[ENTITY]),
         convert_entity_to_uchar_array(entry[ENTITY])))
 
 output_file.write("""
-HTMLEntityTableEntry staticEntityTable[%s] = {""" % entity_count)
+static const HTMLEntityTableEntry staticEntityTable[%s] = {\n""" % entity_count)
 
 index = {}
 offset = 0
@@ -124,25 +124,26 @@ for entry in entries:
     letter = entry[ENTITY][0]
     if not index.get(letter):
         index[letter] = offset
-    output_file.write('    { %sEntityName, %s, %s },' % (
+    output_file.write('    { %s, %s, %s },\n' % (
         convert_entity_to_cpp_name(entry[ENTITY]),
         len(entry[ENTITY]),
         convert_value_to_int(entry[VALUE])))
     offset += 1
 
 output_file.write("""};
+
 """)
 
-output_file.write("const HTMLEntityTableEntry* uppercaseOffset[] = {")
+output_file.write("static const HTMLEntityTableEntry* uppercaseOffset[] = {\n")
 for letter in string.ascii_uppercase:
-    output_file.write(offset_table_entry(index[letter]))
-output_file.write(offset_table_entry(index['a']))
+    output_file.write("%s\n" % offset_table_entry(index[letter]))
+output_file.write("%s\n" % offset_table_entry(index['a']))
 output_file.write("""};
 
-const HTMLEntityTableEntry* lowercaseOffset[] = {""")
+static const HTMLEntityTableEntry* lowercaseOffset[] = {\n""")
 for letter in string.ascii_lowercase:
-    output_file.write(offset_table_entry(index[letter]))
-output_file.write(offset_table_entry(entity_count))
+    output_file.write("%s\n" % offset_table_entry(index[letter]))
+output_file.write("%s\n" % offset_table_entry(entity_count))
 output_file.write("""};
 
 }