From 76701e14b7f407028489dbc9b0715aede30b8a38 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Tue, 12 Oct 2010 11:21:50 +0100 Subject: [PATCH] Keep parsing after invalid contstructor declaration --- mcs/errors/cs1018-2.cs | 10 ---------- mcs/errors/cs1525-23.cs | 10 ++++++++++ mcs/errors/{cs1018.cs => cs1525-24.cs} | 2 +- mcs/errors/cs1525-25.cs | 10 ++++++++++ mcs/mcs/cs-parser.jay | 5 +++-- 5 files changed, 24 insertions(+), 13 deletions(-) delete mode 100644 mcs/errors/cs1018-2.cs create mode 100644 mcs/errors/cs1525-23.cs rename mcs/errors/{cs1018.cs => cs1525-24.cs} (50%) create mode 100644 mcs/errors/cs1525-25.cs diff --git a/mcs/errors/cs1018-2.cs b/mcs/errors/cs1018-2.cs deleted file mode 100644 index 5a9ecbad7bd..00000000000 --- a/mcs/errors/cs1018-2.cs +++ /dev/null @@ -1,10 +0,0 @@ -// CS1018: Keyword `this' or `base' expected -// Line: 7 - -class Bar -{ - Bar(int a) - :super() - { - } -} diff --git a/mcs/errors/cs1525-23.cs b/mcs/errors/cs1525-23.cs new file mode 100644 index 00000000000..8a97e05efb1 --- /dev/null +++ b/mcs/errors/cs1525-23.cs @@ -0,0 +1,10 @@ +// CS1525: Unexpected symbol `public', expecting `:', `;', or `{' +// Line: 5 + +class TorrentEditor { + TorrentEditor () + + public TorrentEditor () + { + } +} diff --git a/mcs/errors/cs1018.cs b/mcs/errors/cs1525-24.cs similarity index 50% rename from mcs/errors/cs1018.cs rename to mcs/errors/cs1525-24.cs index ed423c529e6..c481178c31a 100644 --- a/mcs/errors/cs1018.cs +++ b/mcs/errors/cs1525-24.cs @@ -1,4 +1,4 @@ -// CS1018: Keyword `this' or `base' expected +// CS1525: Unexpected symbol `{', expecting `base' or `this' // Line: 5 class X { diff --git a/mcs/errors/cs1525-25.cs b/mcs/errors/cs1525-25.cs new file mode 100644 index 00000000000..8e2784c4456 --- /dev/null +++ b/mcs/errors/cs1525-25.cs @@ -0,0 +1,10 @@ +// CS1525: Unexpected symbol `super', expecting `base' or `this' +// Line: 7 + +class Bar +{ + Bar(int a) + :super() + { + } +} diff --git a/mcs/mcs/cs-parser.jay b/mcs/mcs/cs-parser.jay index de1b01e4a85..84f50dca99a 100644 --- a/mcs/mcs/cs-parser.jay +++ b/mcs/mcs/cs-parser.jay @@ -2245,8 +2245,9 @@ constructor_initializer $$ = new ConstructorThisInitializer ((Arguments) $5, GetLocation ($2)); lbag.AddLocation ($$, GetLocation ($1), GetLocation ($3), GetLocation ($6)); } - | COLON error { - Report.Error (1018, GetLocation ($1), "Keyword `this' or `base' expected"); + | error + { + Error_SyntaxError (yyToken); $$ = null; } ; -- GitLab