diff options
author | Marek Safar <marek.safar@gmail.com> | 2013-03-22 18:28:03 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2013-03-22 18:28:03 +0400 |
commit | 19e7a81b9b4e99ae2c3588fed99b15affac2df16 (patch) | |
tree | 62ccf051b178397a9cfb8ddc1cf752f9ffebb22d /mcs | |
parent | 2ae9fc18eb7859735c82f413a92c9883f5e05f6f (diff) |
Try to recover incomplete initializers. Fixes #4964
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/mcs/argument.cs | 3 | ||||
-rw-r--r-- | mcs/mcs/cs-parser.jay | 10 |
2 files changed, 3 insertions, 10 deletions
diff --git a/mcs/mcs/argument.cs b/mcs/mcs/argument.cs index 22e28eaf729..03b18b7f376 100644 --- a/mcs/mcs/argument.cs +++ b/mcs/mcs/argument.cs @@ -47,9 +47,6 @@ namespace Mono.CSharp public Argument (Expression expr) { - if (expr == null) - throw new ArgumentNullException (); - this.Expr = expr; } diff --git a/mcs/mcs/cs-parser.jay b/mcs/mcs/cs-parser.jay index f0d481aa514..d32d28cd689 100644 --- a/mcs/mcs/cs-parser.jay +++ b/mcs/mcs/cs-parser.jay @@ -3301,7 +3301,7 @@ member_initializer { report.Error (1920, GetLocation ($1), "An element initializer cannot be empty"); $$ = null; - } + } ; initializer_value @@ -3417,22 +3417,18 @@ element_access ; expression_list - : expression + : expression_or_error { var list = new List<Expression> (4); list.Add ((Expression) $1); $$ = list; } - | expression_list COMMA expression + | expression_list COMMA expression_or_error { var list = (List<Expression>) $1; list.Add ((Expression) $3); $$ = list; } - | expression_list error { - Error_SyntaxError (yyToken); - $$ = $1; - } ; expression_list_arguments |