OLD | NEW |
---|---|
1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 path = entry['name'] | 124 path = entry['name'] |
125 return path + '.h' | 125 return path + '.h' |
126 | 126 |
127 def _headers_header_includes(self, entries): | 127 def _headers_header_includes(self, entries): |
128 includes = dict() | 128 includes = dict() |
129 for entry in entries: | 129 for entry in entries: |
130 cpp_name = name_utilities.cpp_name(entry) | 130 cpp_name = name_utilities.cpp_name(entry) |
131 # Avoid duplicate includes. | 131 # Avoid duplicate includes. |
132 if cpp_name in includes: | 132 if cpp_name in includes: |
133 continue | 133 continue |
134 include = '#include "%(path)s"\n#include "V8%(script_name)s.h"' % { | 134 if self.suffix == "Modules": |
Nils Barth (inactive)
2014/06/30 02:19:52
nit: single quotes
c.shu
2014/06/30 19:46:07
Done.
| |
135 subdir_name = 'modules' | |
136 else: | |
137 subdir_name = 'core' | |
138 include = '#include "%(path)s"\n#include "bindings/%(subdir_name)s/v 8/V8%(script_name)s.h"' % { | |
135 'path': self._headers_header_include_path(entry), | 139 'path': self._headers_header_include_path(entry), |
140 'subdir_name': subdir_name, | |
Nils Barth (inactive)
2014/06/30 02:19:52
nit: alpha
c.shu
2014/06/30 19:46:07
Done.
| |
136 'script_name': name_utilities.script_name(entry), | 141 'script_name': name_utilities.script_name(entry), |
137 } | 142 } |
138 includes[cpp_name] = self.wrap_with_condition(include, entry['Condit ional']) | 143 includes[cpp_name] = self.wrap_with_condition(include, entry['Condit ional']) |
139 return includes.values() | 144 return includes.values() |
140 | 145 |
141 def generate_headers_header(self): | 146 def generate_headers_header(self): |
142 base_header_for_suffix = '' | 147 base_header_for_suffix = '' |
143 if self.suffix: | 148 if self.suffix: |
144 base_header_for_suffix = '\n#include "core/%(namespace)sHeaders.h"\n ' % {'namespace': self.namespace} | 149 base_header_for_suffix = '\n#include "core/%(namespace)sHeaders.h"\n ' % {'namespace': self.namespace} |
145 return HEADER_TEMPLATE % { | 150 return HEADER_TEMPLATE % { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
187 return INTERFACES_HEADER_TEMPLATE % { | 192 return INTERFACES_HEADER_TEMPLATE % { |
188 'license': license.license_for_generated_cpp(), | 193 'license': license.license_for_generated_cpp(), |
189 'namespace': self.namespace, | 194 'namespace': self.namespace, |
190 'suffix': self.suffix, | 195 'suffix': self.suffix, |
191 'base_header_for_suffix': base_header_for_suffix, | 196 'base_header_for_suffix': base_header_for_suffix, |
192 'macro_style_name': name_utilities.to_macro_style(self.namespace + s elf.suffix), | 197 'macro_style_name': name_utilities.to_macro_style(self.namespace + s elf.suffix), |
193 'declare_conditional_macros': self._declare_conditional_macros(), | 198 'declare_conditional_macros': self._declare_conditional_macros(), |
194 'unconditional_macros': '\n'.join(sorted(set(map(self._unconditional _macro, self._unconditional_entries)))), | 199 'unconditional_macros': '\n'.join(sorted(set(map(self._unconditional _macro, self._unconditional_entries)))), |
195 'conditional_macros': '\n'.join(map(self._conditional_macros, self._ entries_by_conditional.keys())), | 200 'conditional_macros': '\n'.join(map(self._conditional_macros, self._ entries_by_conditional.keys())), |
196 } | 201 } |
OLD | NEW |