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

Unified Diff: mojo/public/tools/bindings/generators/mojom_dart_generator.py

Issue 1964193002: Dart: Refactors Proxies (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address comments Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/generators/mojom_dart_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_dart_generator.py b/mojo/public/tools/bindings/generators/mojom_dart_generator.py
index 5dbc1ba14d0d67dc02b3c7be43a2e6e0ccf9dc0a..7c2a15c712ed5313ba0a8b4c2cdd446a3f3931e0 100644
--- a/mojo/public/tools/bindings/generators/mojom_dart_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_dart_generator.py
@@ -20,12 +20,12 @@ from mojom.generate.template_expander import UseJinja
GENERATOR_PREFIX = 'dart'
# CAUTION: To generate Dart-style names, and to avoid generating reserved words
-# for identifiers. The template files should generate names using
+# for identifiers, the template files should generate names using
# {{element|name}}, not {{element.name}}.
# Dart reserved words from:
# http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-408.pdf
-# We must not generated reserved words for identifiers.
+# We must not generate reserved words for identifiers.
# NB: async, await, and yield are not technically reserved words, but since
# they are not valid identifiers in all contexts, we include them here as well.
_dart_reserved_words = [
@@ -67,8 +67,20 @@ _dart_reserved_words = [
"yield",
]
+# These names are the class fields and methods of the Proxy class in
+# lib/src/proxy.dart of Dart's mojo package. If these names appear in a .mojom
+# they must be mangled to avoid name conflicts. They are mangled by appending
+# an underscore ('_'), which is banned on names in mojom interfaces.
_reserved_words = _dart_reserved_words + [
+ "close",
+ "connectToService",
+ "ctrl",
+ "fromEndpoint",
+ "fromHandle",
+ "newFromEndpoint",
+ "responseOrError",
"serviceName",
+ "unbound",
]
_kind_to_dart_default_value = {
« no previous file with comments | « mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698