Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: third_party/WebKit/Source/core/html/parser/create-html-entity-table

Issue 2329463004: ABANDONED CL: Changes needed to make things compile after running rewrite_to_chrome_style tool. (Closed)
Patch Set: More fixes - things build fine at this point. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2010 Google Inc. All rights reserved. 2 # Copyright (c) 2010 Google Inc. All rights reserved.
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 output_file.write("%d,\n" % index[letter]) 192 output_file.write("%d,\n" % index[letter])
193 output_file.write("%d\n" % index['a']) 193 output_file.write("%d\n" % index['a'])
194 output_file.write("""}; 194 output_file.write("""};
195 195
196 static const short lowercaseOffset[] = {\n""") 196 static const short lowercaseOffset[] = {\n""")
197 for letter in string.ascii_lowercase: 197 for letter in string.ascii_lowercase:
198 output_file.write("%d,\n" % index[letter]) 198 output_file.write("%d,\n" % index[letter])
199 output_file.write("%d\n" % entity_count) 199 output_file.write("%d\n" % entity_count)
200 output_file.write("""}; 200 output_file.write("""};
201 201
202 const LChar* HTMLEntityTable::entityString(const HTMLEntityTableEntry& entry) 202 const LChar* HTMLEntityTable::EntityString(const HTMLEntityTableEntry& entry)
203 { 203 {
204 return staticEntityStringStorage + entry.entityOffset; 204 return staticEntityStringStorage + entry.entity_offset;
205 } 205 }
206 206
207 LChar HTMLEntityTableEntry::lastCharacter() const 207 LChar HTMLEntityTableEntry::LastCharacter() const
208 { 208 {
209 return HTMLEntityTable::entityString(*this)[length - 1]; 209 return HTMLEntityTable::EntityString(*this)[length - 1];
210 } 210 }
211 211
212 const HTMLEntityTableEntry* HTMLEntityTable::firstEntryStartingWith(UChar c) 212 const HTMLEntityTableEntry* HTMLEntityTable::FirstEntryStartingWith(UChar c)
213 { 213 {
214 if (c >= 'A' && c <= 'Z') 214 if (c >= 'A' && c <= 'Z')
215 return &staticEntityTable[uppercaseOffset[c - 'A']]; 215 return &staticEntityTable[uppercaseOffset[c - 'A']];
216 if (c >= 'a' && c <= 'z') 216 if (c >= 'a' && c <= 'z')
217 return &staticEntityTable[lowercaseOffset[c - 'a']]; 217 return &staticEntityTable[lowercaseOffset[c - 'a']];
218 return 0; 218 return 0;
219 } 219 }
220 220
221 const HTMLEntityTableEntry* HTMLEntityTable::lastEntryStartingWith(UChar c) 221 const HTMLEntityTableEntry* HTMLEntityTable::LastEntryStartingWith(UChar c)
222 { 222 {
223 if (c >= 'A' && c <= 'Z') 223 if (c >= 'A' && c <= 'Z')
224 return &staticEntityTable[uppercaseOffset[c - 'A' + 1]] - 1; 224 return &staticEntityTable[uppercaseOffset[c - 'A' + 1]] - 1;
225 if (c >= 'a' && c <= 'z') 225 if (c >= 'a' && c <= 'z')
226 return &staticEntityTable[lowercaseOffset[c - 'a' + 1]] - 1; 226 return &staticEntityTable[lowercaseOffset[c - 'a' + 1]] - 1;
227 return 0; 227 return 0;
228 } 228 }
229 229
230 const HTMLEntityTableEntry* HTMLEntityTable::firstEntry() 230 const HTMLEntityTableEntry* HTMLEntityTable::FirstEntry()
231 { 231 {
232 return &staticEntityTable[0]; 232 return &staticEntityTable[0];
233 } 233 }
234 234
235 const HTMLEntityTableEntry* HTMLEntityTable::lastEntry() 235 const HTMLEntityTableEntry* HTMLEntityTable::LastEntry()
236 { 236 {
237 return &staticEntityTable[%s - 1]; 237 return &staticEntityTable[%s - 1];
238 } 238 }
239 239
240 } 240 }
241 """ % entity_count) 241 """ % entity_count)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698