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

Unified Diff: frog/parser.dart

Issue 9188048: fix issue 1110 (handle void better) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: comment fix Created 8 years, 11 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 | « frog/minfrog ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/parser.dart
diff --git a/frog/parser.dart b/frog/parser.dart
index 294d3d20458d6d9b29723f15127f722976c0e142..2c3e0f49ce3d85cbf742c3ccbe0e1a61f52e237e 100644
--- a/frog/parser.dart
+++ b/frog/parser.dart
@@ -1251,6 +1251,10 @@ class Parser {
}
_typeAsIdentifier(type) {
+ if (type.name.name == 'void') {
+ _errorExpected('identifer, but found "${type.name.name}"');
+ }
+
// TODO(jimhug): lots of errors to check for
return type.name;
}
@@ -1655,6 +1659,9 @@ class Parser {
} else if (expr is DeclaredIdentifier) {
name = expr.name;
type = expr.type;
+ if (name == null) {
+ _error('expected name and type', expr.span);
+ }
} else {
_error('bad function body', expr.span);
}
« no previous file with comments | « frog/minfrog ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698