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

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

Issue 1294043002: Mojom compiler: Improves error message by giving misspelled identifier. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Add comment as requested in code review. Created 5 years, 4 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 | « no previous file | 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_cpp_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
index 3d590872ad7c1a7b82f11bb17eae69823e21e6b9..160f65714281d6cf2118df5bd7302bd5b8bda3c6 100644
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
@@ -146,7 +146,13 @@ def GetCppResultWrapperType(kind):
return "mojo::ScopedMessagePipeHandle"
if mojom.IsSharedBufferKind(kind):
return "mojo::ScopedSharedBufferHandle"
- return _kind_to_cpp_type[kind]
+ # TODO(rudominer) After improvements to compiler front end have landed,
+ # revisit strategy used below for emitting a useful error message when an
+ # undefined identifier is referenced.
+ val = _kind_to_cpp_type.get(kind)
+ if (val is not None):
+ return val
+ raise Exception("Unrecognized kind %s" % kind.spec)
def GetCppWrapperType(kind):
if mojom.IsEnumKind(kind):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698