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

Side by Side Diff: tools/dom/scripts/htmldartgenerator.py

Issue 12929005: dart:typeddata for dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revert status change Created 7 years, 9 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
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 system to generate 6 """This module provides shared functionality for the system to generate
7 dart:html APIs from the IDL database.""" 7 dart:html APIs from the IDL database."""
8 8
9 import emitter 9 import emitter
10 from generator import AnalyzeOperation, ConstantOutputOrder, \ 10 from generator import AnalyzeOperation, ConstantOutputOrder, \
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 'fromList'), ' ') 375 'fromList'), ' ')
376 376
377 fromBufferAnnotations = FormatAnnotationsAndComments( 377 fromBufferAnnotations = FormatAnnotationsAndComments(
378 GetAnnotationsAndComments(self._library_name, self._interface.id, 378 GetAnnotationsAndComments(self._library_name, self._interface.id,
379 'fromBuffer'), ' ') 379 'fromBuffer'), ' ')
380 380
381 if typed_array_type: 381 if typed_array_type:
382 self._members_emitter.Emit( 382 self._members_emitter.Emit(
383 '\n $(ANNOTATIONS)factory $CTOR(int length) =>\n' 383 '\n $(ANNOTATIONS)factory $CTOR(int length) =>\n'
384 ' $FACTORY.create$(CTOR)(length);\n' 384 ' $FACTORY.create$(CTOR)(length);\n'
385 '\n $(LIST_ANNOTATIONS)factory $CTOR.fromList(List<$TYPE> list) =>\n' 385 '\n $(LIST_ANNOTATIONS)factory $CTOR.fromList(List<$TYPE> list) =>\n'
Anton Muhin 2013/03/19 12:31:24 none as of now
386 ' $FACTORY.create$(CTOR)_fromList(list);\n' 386 ' $FACTORY.create$(CTOR)_fromList(list);\n'
387 '\n $(BUFFER_ANNOTATIONS)factory $CTOR.fromBuffer(ArrayBuffer buffer, ' 387 '\n $(BUFFER_ANNOTATIONS)factory $CTOR.view(ByteBuffer buffer, '
388 '[int byteOffset, int length]) => \n' 388 '[int byteOffset, int length]) => \n'
389 ' $FACTORY.create$(CTOR)_fromBuffer(buffer, byteOffset, length);\n' , 389 ' $FACTORY.create$(CTOR)_fromBuffer(buffer, byteOffset, length);\n' ,
390 CTOR=self._interface.id, 390 CTOR=self._renamer.RenameInterface(interface),
391 ANNOTATIONS=annotations, 391 ANNOTATIONS=annotations,
392 LIST_ANNOTATIONS=fromListAnnotations, 392 LIST_ANNOTATIONS=fromListAnnotations,
393 BUFFER_ANNOTATIONS=fromBufferAnnotations, 393 BUFFER_ANNOTATIONS=fromBufferAnnotations,
394 TYPE=self._DartType(typed_array_type), 394 TYPE=self._DartType(typed_array_type),
395 FACTORY=factory_name) 395 FACTORY=factory_name)
396 396
397 def _AddConstructor(self, 397 def _AddConstructor(self,
398 constructor_info, factory_name, factory_constructor_name): 398 constructor_info, factory_name, factory_constructor_name):
399 if self.GenerateCustomFactory(constructor_info): 399 if self.GenerateCustomFactory(constructor_info):
400 return 400 return
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 walk(interface.parents) 641 walk(interface.parents)
642 else: 642 else:
643 walk(interface.parents[1:]) 643 walk(interface.parents[1:])
644 return result 644 return result
645 645
646 def _DartType(self, type_name): 646 def _DartType(self, type_name):
647 return self._type_registry.DartType(type_name) 647 return self._type_registry.DartType(type_name)
648 648
649 def _IsPrivate(self, name): 649 def _IsPrivate(self, name):
650 return name.startswith('_') 650 return name.startswith('_')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698