Title: [91494] trunk/Source/WebCore
Revision
91494
Author
[email protected]
Date
2011-07-21 13:23:41 -0700 (Thu, 21 Jul 2011)

Log Message

<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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (91493 => 91494)


--- trunk/Source/WebCore/ChangeLog	2011-07-21 20:12:46 UTC (rev 91493)
+++ trunk/Source/WebCore/ChangeLog	2011-07-21 20:23:41 UTC (rev 91494)
@@ -1,3 +1,18 @@
+2011-07-21  David Kilzer  <[email protected]>
+
+        <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  <[email protected]>
 
         Remove LegacyDefaultOptionalArguments flag from FileAPI

Modified: trunk/Source/WebCore/html/parser/create-html-entity-table (91493 => 91494)


--- trunk/Source/WebCore/html/parser/create-html-entity-table	2011-07-21 20:12:46 UTC (rev 91493)
+++ trunk/Source/WebCore/html/parser/create-html-entity-table	2011-07-21 20:23:41 UTC (rev 91494)
@@ -111,12 +111,12 @@
 """)
 
 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 @@
     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("""};
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to