| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 include = '#include "%(path)s"\n#include "V8%(script_name)s.h"' % { | 134 include = '#include "%(path)s"\n#include "V8%(script_name)s.h"' % { |
| 135 'path': self._headers_header_include_path(entry), | 135 'path': self._headers_header_include_path(entry), |
| 136 'script_name': name_utilities.script_name(entry), | 136 'script_name': name_utilities.script_name(entry), |
| 137 } | 137 } |
| 138 includes[cpp_name] = self.wrap_with_condition(include, entry['Condit
ional']) | 138 includes[cpp_name] = self.wrap_with_condition(include, entry['Condit
ional']) |
| 139 return includes.values() | 139 return includes.values() |
| 140 | 140 |
| 141 def generate_headers_header(self): | 141 def generate_headers_header(self): |
| 142 base_header_for_suffix = '' | 142 base_header_for_suffix = '' |
| 143 if self.suffix: | 143 if self.suffix: |
| 144 base_header_for_suffix = '\n#include "%(namespace)sHeaders.h"\n' % {
'namespace': self.namespace} | 144 base_header_for_suffix = '\n#include "core/%(namespace)sHeaders.h"\n
' % {'namespace': self.namespace} |
| 145 return HEADER_TEMPLATE % { | 145 return HEADER_TEMPLATE % { |
| 146 'license': license.license_for_generated_cpp(), | 146 'license': license.license_for_generated_cpp(), |
| 147 'namespace': self.namespace, | 147 'namespace': self.namespace, |
| 148 'suffix': self.suffix, | 148 'suffix': self.suffix, |
| 149 'base_header_for_suffix': base_header_for_suffix, | 149 'base_header_for_suffix': base_header_for_suffix, |
| 150 'includes': '\n'.join(self._headers_header_includes(self.in_file.nam
e_dictionaries)), | 150 'includes': '\n'.join(self._headers_header_includes(self.in_file.nam
e_dictionaries)), |
| 151 } | 151 } |
| 152 | 152 |
| 153 def _declare_one_conditional_macro(self, conditional, entries): | 153 def _declare_one_conditional_macro(self, conditional, entries): |
| 154 macro_name = '%(macro_style_name)s_INTERFACES_FOR_EACH_%(conditional)s'
% { | 154 macro_name = '%(macro_style_name)s_INTERFACES_FOR_EACH_%(conditional)s'
% { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 176 | 176 |
| 177 def _conditional_macros(self, conditional): | 177 def _conditional_macros(self, conditional): |
| 178 return ' %(macro_style_name)s_INTERFACES_FOR_EACH_%(conditional)s(mac
ro) \\' % { | 178 return ' %(macro_style_name)s_INTERFACES_FOR_EACH_%(conditional)s(mac
ro) \\' % { |
| 179 'macro_style_name': name_utilities.to_macro_style(self.namespace + s
elf.suffix), | 179 'macro_style_name': name_utilities.to_macro_style(self.namespace + s
elf.suffix), |
| 180 'conditional': conditional, | 180 'conditional': conditional, |
| 181 } | 181 } |
| 182 | 182 |
| 183 def generate_interfaces_header(self): | 183 def generate_interfaces_header(self): |
| 184 base_header_for_suffix = '' | 184 base_header_for_suffix = '' |
| 185 if self.suffix: | 185 if self.suffix: |
| 186 base_header_for_suffix = '\n#include "%(namespace)sInterfaces.h"\n'
% {'namespace': self.namespace} | 186 base_header_for_suffix = '\n#include "core/%(namespace)sInterfaces.h
"\n' % {'namespace': self.namespace} |
| 187 return INTERFACES_HEADER_TEMPLATE % { | 187 return INTERFACES_HEADER_TEMPLATE % { |
| 188 'license': license.license_for_generated_cpp(), | 188 'license': license.license_for_generated_cpp(), |
| 189 'namespace': self.namespace, | 189 'namespace': self.namespace, |
| 190 'suffix': self.suffix, | 190 'suffix': self.suffix, |
| 191 'base_header_for_suffix': base_header_for_suffix, | 191 'base_header_for_suffix': base_header_for_suffix, |
| 192 'macro_style_name': name_utilities.to_macro_style(self.namespace + s
elf.suffix), | 192 'macro_style_name': name_utilities.to_macro_style(self.namespace + s
elf.suffix), |
| 193 'declare_conditional_macros': self._declare_conditional_macros(), | 193 'declare_conditional_macros': self._declare_conditional_macros(), |
| 194 'unconditional_macros': '\n'.join(sorted(set(map(self._unconditional
_macro, self._unconditional_entries)))), | 194 '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())), | 195 'conditional_macros': '\n'.join(map(self._conditional_macros, self._
entries_by_conditional.keys())), |
| 196 } | 196 } |
| OLD | NEW |