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

Unified Diff: third_party/WebKit/Source/build/scripts/make_names.py

Issue 2638233002: Convert make_names and make_event_factory to use json5 config format. (Closed)
Patch Set: fix PLATFORM_EXPORT Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/build/scripts/make_names.py
diff --git a/third_party/WebKit/Source/build/scripts/make_names.py b/third_party/WebKit/Source/build/scripts/make_names.py
index 740c5fa6a0e0a22e0a7eb44099a474639d398d2d..cfb1aa57eaa908aa55f38bbc0cb00afc0a94aa50 100755
--- a/third_party/WebKit/Source/build/scripts/make_names.py
+++ b/third_party/WebKit/Source/build/scripts/make_names.py
@@ -30,7 +30,7 @@
import sys
import hasher
-import in_generator
+import json5_generator
import template_expander
import name_utilities
@@ -43,14 +43,14 @@ def _symbol(entry):
return name_utilities.cpp_name(entry).replace('-', '_')
-class MakeNamesWriter(in_generator.Writer):
- defaults = {
+class MakeNamesWriter(json5_generator.Writer):
+ default_parameters = {
'Conditional': None, # FIXME: Add support for Conditional.
'ImplementedAs': None,
'RuntimeEnabled': None, # What should we do for runtime-enabled features?
'Symbol': None,
}
- default_parameters = {
+ default_metadata = {
'export': '',
'namespace': '',
'suffix': '',
@@ -63,12 +63,12 @@ class MakeNamesWriter(in_generator.Writer):
'to_macro_style': name_utilities.to_macro_style,
}
- def __init__(self, in_file_path):
- super(MakeNamesWriter, self).__init__(in_file_path)
+ def __init__(self, json5_file_path):
+ super(MakeNamesWriter, self).__init__(json5_file_path)
- namespace = self.in_file.parameters['namespace'].strip('"')
- suffix = self.in_file.parameters['suffix'].strip('"')
- export = self.in_file.parameters['export'].strip('"')
+ namespace = self.json5_file.metadata['namespace'].strip('"')
+ suffix = self.json5_file.metadata['suffix'].strip('"')
+ export = self.json5_file.metadata['export'].strip('"')
assert namespace, 'A namespace is required.'
@@ -80,8 +80,8 @@ class MakeNamesWriter(in_generator.Writer):
'namespace': namespace,
'suffix': suffix,
'export': export,
- 'entries': self.in_file.name_dictionaries,
- 'in_files': self.in_file.file_paths,
+ 'entries': self.json5_file.name_dictionaries,
+ 'in_files': self.json5_file.file_paths,
}
@template_expander.use_jinja("MakeNames.h.tmpl", filters=filters)
@@ -94,4 +94,4 @@ class MakeNamesWriter(in_generator.Writer):
if __name__ == "__main__":
- in_generator.Maker(MakeNamesWriter).main(sys.argv)
+ json5_generator.Maker(MakeNamesWriter).main()
« no previous file with comments | « third_party/WebKit/Source/build/scripts/make_media_features.py ('k') | third_party/WebKit/Source/core/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698