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

Side by Side Diff: sdk/lib/html/scripts/htmldartgenerator.py

Issue 11308087: Added "/// @docsEditable" to all generated members in the HTML lib. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot a thing. Created 8 years, 1 month 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 from generator import AnalyzeOperation, ConstantOutputOrder, \ 9 from generator import AnalyzeOperation, ConstantOutputOrder, \
10 DartDomNameOfAttribute, FindMatchingAttribute, IsDartCollectionType, \ 10 DartDomNameOfAttribute, FindMatchingAttribute, IsDartCollectionType, \
(...skipping 14 matching lines...) Expand all
25 self._database = options.database 25 self._database = options.database
26 self._interface = interface 26 self._interface = interface
27 self._type_registry = options.type_registry 27 self._type_registry = options.type_registry
28 self._interface_type_info = self._type_registry.TypeInfo(self._interface.id) 28 self._interface_type_info = self._type_registry.TypeInfo(self._interface.id)
29 self._renamer = options.renamer 29 self._renamer = options.renamer
30 30
31 def EmitAttributeDocumentation(self, attribute): 31 def EmitAttributeDocumentation(self, attribute):
32 """ Emits the MDN dartdoc comment for an attribute. 32 """ Emits the MDN dartdoc comment for an attribute.
33 """ 33 """
34 dom_name = DartDomNameOfAttribute(attribute) 34 dom_name = DartDomNameOfAttribute(attribute)
35 self._members_emitter.Emit('\n /** @domName $DOMINTERFACE.$DOMNAME */', 35 self._members_emitter.Emit('\n /** @domName $DOMINTERFACE.$DOMNAME */\n'
36 ' /// @docsEditable',
36 DOMINTERFACE=attribute.doc_js_interface_name, 37 DOMINTERFACE=attribute.doc_js_interface_name,
37 DOMNAME=dom_name) 38 DOMNAME=dom_name)
38 39
39 def EmitOperationDocumentation(self, operation): 40 def EmitOperationDocumentation(self, operation):
40 """ Emits the MDN dartdoc comment for an operation. 41 """ Emits the MDN dartdoc comment for an operation.
41 """ 42 """
42 self._members_emitter.Emit('\n /** @domName $DOMINTERFACE.$DOMNAME */', 43 self._members_emitter.Emit('\n /** @domName $DOMINTERFACE.$DOMNAME */\n'
blois 2012/11/19 23:19:06 Seems odd to have two doc comments- can we just ro
44 ' /// @docsEditable',
43 DOMINTERFACE=operation.overloads[0].doc_js_interface_name, 45 DOMINTERFACE=operation.overloads[0].doc_js_interface_name,
44 DOMNAME=operation.name) 46 DOMNAME=operation.name)
45 47
46 def EmitEventGetter(self, events_class_name): 48 def EmitEventGetter(self, events_class_name):
47 self._members_emitter.Emit( 49 self._members_emitter.Emit(
48 '\n /**' 50 '\n /**'
49 '\n * @domName EventTarget.addEventListener, ' 51 '\n * @domName EventTarget.addEventListener, '
50 'EventTarget.removeEventListener, EventTarget.dispatchEvent' 52 'EventTarget.removeEventListener, EventTarget.dispatchEvent'
51 '\n */' 53 '\n */\n /// @docsEditable'
52 '\n $TYPE get on =>\n new $TYPE(this);\n', 54 '\n $TYPE get on =>\n new $TYPE(this);\n',
53 TYPE=events_class_name) 55 TYPE=events_class_name)
54 56
55 def AddMembers(self, interface, declare_only=False): 57 def AddMembers(self, interface, declare_only=False):
56 for const in sorted(interface.constants, ConstantOutputOrder): 58 for const in sorted(interface.constants, ConstantOutputOrder):
57 self.AddConstant(const) 59 self.AddConstant(const)
58 60
59 for attr in sorted(interface.attributes, ConstantOutputOrder): 61 for attr in sorted(interface.attributes, ConstantOutputOrder):
60 if attr.type.id != 'EventListener': 62 if attr.type.id != 'EventListener':
61 self.AddAttribute(attr, declare_only) 63 self.AddAttribute(attr, declare_only)
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 walk(interface.parents) 303 walk(interface.parents)
302 else: 304 else:
303 walk(interface.parents[1:]) 305 walk(interface.parents[1:])
304 return result 306 return result
305 307
306 def _DartType(self, type_name): 308 def _DartType(self, type_name):
307 return self._type_registry.DartType(type_name) 309 return self._type_registry.DartType(type_name)
308 310
309 def _IsPrivate(self, name): 311 def _IsPrivate(self, name):
310 return name.startswith('_') 312 return name.startswith('_')
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/html/templates/dart2js_impl.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698