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

Side by Side Diff: lib/dom/scripts/systemfrog.py

Issue 10704102: Cleanup attributes generation in dart:html. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: . Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | lib/dom/scripts/systemhtml.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """This module provides shared functionality for the systems to generate 6 """This module provides shared functionality for the systems to generate
7 frog binding from the IDL database.""" 7 frog binding from the IDL database."""
8 8
9 import os 9 import os
10 from generator import * 10 from generator import *
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 return (attr2, parent_interface_name) 308 return (attr2, parent_interface_name)
309 309
310 return FindInParent( 310 return FindInParent(
311 self._system._database.GetInterface(parent_interface_name)) 311 self._system._database.GetInterface(parent_interface_name))
312 return (None, None) 312 return (None, None)
313 313
314 return FindInParent(self._interface) if attr else (None, None) 314 return FindInParent(self._interface) if attr else (None, None)
315 315
316 316
317 def AddSecondaryAttribute(self, interface, attribute): 317 def AddSecondaryAttribute(self, interface, attribute):
318 self._SecondaryContext(interface) 318 self.SecondaryContext(interface)
319 self.AddAttribute(attribute) 319 self.AddAttribute(attribute)
320 320
321 def AddSecondaryOperation(self, interface, info): 321 def AddSecondaryOperation(self, interface, info):
322 self._SecondaryContext(interface) 322 self.SecondaryContext(interface)
323 self.AddOperation(info) 323 self.AddOperation(info)
324 324
325 def _SecondaryContext(self, interface): 325 def SecondaryContext(self, interface):
326 if interface is not self._current_secondary_parent: 326 if interface is not self._current_secondary_parent:
327 self._current_secondary_parent = interface 327 self._current_secondary_parent = interface
328 self._members_emitter.Emit('\n // From $WHERE\n', WHERE=interface.id) 328 self._members_emitter.Emit('\n // From $WHERE\n', WHERE=interface.id)
329 329
330 def AddIndexer(self, element_type): 330 def AddIndexer(self, element_type):
331 """Adds all the methods required to complete implementation of List.""" 331 """Adds all the methods required to complete implementation of List."""
332 # We would like to simply inherit the implementation of everything except 332 # We would like to simply inherit the implementation of everything except
333 # get length(), [], and maybe []=. It is possible to extend from a base 333 # get length(), [], and maybe []=. It is possible to extend from a base
334 # array implementation class only when there is no other implementation 334 # array implementation class only when there is no other implementation
335 # inheritance. There might be no implementation inheritance other than 335 # inheritance. There might be no implementation inheritance other than
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 if native_body: 388 if native_body:
389 native_string = " '''" + native_body + "'''" 389 native_string = " '''" + native_body + "'''"
390 390
391 self._members_emitter.Emit( 391 self._members_emitter.Emit(
392 '\n' 392 '\n'
393 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n', 393 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n',
394 TYPE=self._NarrowOutputType(info.type_name), 394 TYPE=self._NarrowOutputType(info.type_name),
395 NAME=info.name, 395 NAME=info.name,
396 PARAMS=params, 396 PARAMS=params,
397 NATIVESTRING=native_string) 397 NATIVESTRING=native_string)
OLDNEW
« no previous file with comments | « no previous file | lib/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698