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

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

Issue 14400004: First try at removing ? from HTML. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Made positional arguments make more sense, Created 7 years, 7 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 ' }\n', 383 ' }\n',
384 CTOR=constructor_info._ConstructorFullName(self._DartType), 384 CTOR=constructor_info._ConstructorFullName(self._DartType),
385 PARAMS=constructor_info.ParametersDeclaration(self._DartType), 385 PARAMS=constructor_info.ParametersDeclaration(self._DartType),
386 FACTORY=factory_name, 386 FACTORY=factory_name,
387 ANNOTATIONS=annotations, 387 ANNOTATIONS=annotations,
388 FACTORY_PARAMS=constructor_info.ParametersAsArgumentList()) 388 FACTORY_PARAMS=constructor_info.ParametersAsArgumentList())
389 389
390 for index, param_info in enumerate(constructor_info.param_infos): 390 for index, param_info in enumerate(constructor_info.param_infos):
391 if param_info.is_optional: 391 if param_info.is_optional:
392 dispatcher_emitter.Emit( 392 dispatcher_emitter.Emit(
393 ' if (!?$OPT_PARAM_NAME) {\n' 393 ' if ($OPT_PARAM_NAME == null) {\n'
394 ' return $FACTORY._create($FACTORY_PARAMS);\n' 394 ' return $FACTORY._create($FACTORY_PARAMS);\n'
395 ' }\n', 395 ' }\n',
396 OPT_PARAM_NAME=param_info.name, 396 OPT_PARAM_NAME=param_info.name,
397 FACTORY=factory_name, 397 FACTORY=factory_name,
398 FACTORY_PARAMS=constructor_info.ParametersAsArgumentList(index)) 398 FACTORY_PARAMS=constructor_info.ParametersAsArgumentList(index))
399 else: 399 else:
400 inits = self._members_emitter.Emit( 400 inits = self._members_emitter.Emit(
401 '\n $(ANNOTATIONS)' 401 '\n $(ANNOTATIONS)'
402 'factory $CONSTRUCTOR($PARAMS) {\n' 402 'factory $CONSTRUCTOR($PARAMS) {\n'
403 ' var e = $FACTORY.$CTOR_FACTORY_NAME($FACTORY_PARAMS);\n' 403 ' var e = $FACTORY.$CTOR_FACTORY_NAME($FACTORY_PARAMS);\n'
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 walk(interface.parents) 594 walk(interface.parents)
595 else: 595 else:
596 walk(interface.parents[1:]) 596 walk(interface.parents[1:])
597 return result 597 return result
598 598
599 def _DartType(self, type_name): 599 def _DartType(self, type_name):
600 return self._type_registry.DartType(type_name) 600 return self._type_registry.DartType(type_name)
601 601
602 def _IsPrivate(self, name): 602 def _IsPrivate(self, name):
603 return name.startswith('_') 603 return name.startswith('_')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698