Author: raja
Date: 2006-01-18 06:46:26 -0500 (Wed, 18 Jan 2006)
New Revision: 55716
Added:
trunk/mcs/errors/cs1026-2.cs
Modified:
trunk/mcs/errors/ChangeLog
trunk/mcs/errors/known-issues-gmcs
trunk/mcs/errors/known-issues-mcs
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/cs-parser.jay
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/cs-parser.jay
Log:
Fix #76656, cs0231-2.cs.
* mcs/cs-parser.jay (formal_parameter_list): Make error case catch
more issues.
(parenthesized_expression_0): Add CS1026 check.
(invocation_expression): Remove unused { $$ = lexer.Location }.
* gmcs/cs-parser.jay: Likewise.
* errors/cs1026-2.cs: New test from #76656.
Modified: trunk/mcs/errors/ChangeLog
===================================================================
--- trunk/mcs/errors/ChangeLog 2006-01-18 11:31:48 UTC (rev 55715)
+++ trunk/mcs/errors/ChangeLog 2006-01-18 11:46:26 UTC (rev 55716)
@@ -1,3 +1,7 @@
+2006-01-18 Raja R Harinath <[EMAIL PROTECTED]>
+
+ * cs1026-2.cs: New test from #76656.
+
2006-01-17 Raja R Harinath <[EMAIL PROTECTED]>
* cs0201-2.cs, cs0201-3.cs: New tests from #76824.
Added: trunk/mcs/errors/cs1026-2.cs
===================================================================
--- trunk/mcs/errors/cs1026-2.cs 2006-01-18 11:31:48 UTC (rev 55715)
+++ trunk/mcs/errors/cs1026-2.cs 2006-01-18 11:46:26 UTC (rev 55716)
@@ -0,0 +1,12 @@
+// cs1026-2.cs: Expecting `)'
+// Line: 10
+
+using System;
+
+class Test {
+ static void Main ()
+ {
+ string uri = "http://localhost/";
+ int default_port = (uri.StartsWith ("http://") ? 80 : -1;
+ }
+}
Property changes on: trunk/mcs/errors/cs1026-2.cs
___________________________________________________________________
Name: svn:mime-type
+ text/cpp
Name: svn:eol-style
+ native
Modified: trunk/mcs/errors/known-issues-gmcs
===================================================================
--- trunk/mcs/errors/known-issues-gmcs 2006-01-18 11:31:48 UTC (rev 55715)
+++ trunk/mcs/errors/known-issues-gmcs 2006-01-18 11:46:26 UTC (rev 55716)
@@ -13,7 +13,6 @@
cs0229-2.cs
cs0229.cs NO ERROR
-cs0231-2.cs
cs0525.cs
cs0526.cs
cs0531.cs
Modified: trunk/mcs/errors/known-issues-mcs
===================================================================
--- trunk/mcs/errors/known-issues-mcs 2006-01-18 11:31:48 UTC (rev 55715)
+++ trunk/mcs/errors/known-issues-mcs 2006-01-18 11:46:26 UTC (rev 55716)
@@ -13,7 +13,6 @@
cs0229-2.cs
cs0229.cs NO ERROR
-cs0231-2.cs
cs0525.cs
cs0526.cs
cs0547.cs
@@ -32,4 +31,4 @@
cs1528.cs
cs1586.cs
cs1641.cs
-cs1670-2.cs
\ No newline at end of file
+cs1670-2.cs
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2006-01-18 11:31:48 UTC (rev 55715)
+++ trunk/mcs/gmcs/ChangeLog 2006-01-18 11:46:26 UTC (rev 55716)
@@ -1,3 +1,11 @@
+2006-01-18 Raja R Harinath <[EMAIL PROTECTED]>
+
+ Fix #76656, cs0231-2.cs.
+ * cs-parser.jay (formal_parameter_list): Make error case catch
+ more issues.
+ (parenthesized_expression_0): Add CS1026 check.
+ (invocation_expression): Remove unused { $$ = lexer.Location }.
+
2006-01-17 Raja R Harinath <[EMAIL PROTECTED]>
Fix #76824.
Modified: trunk/mcs/gmcs/cs-parser.jay
===================================================================
--- trunk/mcs/gmcs/cs-parser.jay 2006-01-18 11:31:48 UTC (rev 55715)
+++ trunk/mcs/gmcs/cs-parser.jay 2006-01-18 11:46:26 UTC (rev 55716)
@@ -1244,13 +1244,13 @@
$$ = new Parameters (pars, true);
}
- | parameter_array COMMA fixed_parameters
+ | parameter_array COMMA error
{
if ($1 != null)
Report.Error (231, ((Parameter) $1).Location, "A params
parameter must be the last parameter in a formal parameter list");
$$ = null;
}
- | ARGLIST COMMA fixed_parameters
+ | ARGLIST COMMA error
{
Report.Error (257, (Location) $1, "An __arglist parameter must
be the last parameter in a formal parameter list");
$$ = null;
@@ -2975,6 +2975,7 @@
// CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
CLOSE_PARENS_OPEN_PARENS
// or CLOSE_PARENS_MINUS.
}
+ | OPEN_PARENS expression error { CheckToken (1026, yyToken, "Expecting
')'", lexer.Location); }
;
parenthesized_expression
@@ -2989,7 +2990,7 @@
// in Binary.DoResolve().
$$ = new ParenthesizedExpression ((Expression) $1);
}
- ;;
+ ;
member_access
: primary_expression DOT IDENTIFIER opt_type_argument_list
@@ -3011,15 +3012,12 @@
;
invocation_expression
- : primary_expression {
- $$ = lexer.Location;
- } OPEN_PARENS opt_argument_list CLOSE_PARENS
+ : primary_expression OPEN_PARENS opt_argument_list CLOSE_PARENS
{
- if ($1 == null) {
- Location l = (Location) $3;
- Report.Error (1, l, "Parse error");
- }
- $$ = new Invocation ((Expression) $1, (ArrayList) $4);
+ if ($1 == null)
+ Report.Error (1, (Location) $2, "Parse error");
+ else
+ $$ = new Invocation ((Expression) $1, (ArrayList) $3);
}
| parenthesized_expression_0 CLOSE_PARENS_OPEN_PARENS OPEN_PARENS
CLOSE_PARENS
{
@@ -5298,11 +5296,10 @@
void CheckToken (int error, int yyToken, string msg, Location loc)
{
- if (yyToken >= Token.FIRST_KEYWORD && yyToken <= Token.LAST_KEYWORD){
- Report.Error (error, loc, String.Format ("{0}: `{1}' is a
keyword", msg, yyNames [yyToken].ToLower ()));
- return;
- }
- Report.Error (error, loc, msg);
+ if (yyToken >= Token.FIRST_KEYWORD && yyToken <= Token.LAST_KEYWORD)
+ Report.Error (error, loc, "{0}: `{1}' is a keyword", msg,
yyNames [yyToken].ToLower ());
+ else
+ Report.Error (error, loc, msg);
}
void CheckIdentifierToken (int yyToken, Location loc)
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2006-01-18 11:31:48 UTC (rev 55715)
+++ trunk/mcs/mcs/ChangeLog 2006-01-18 11:46:26 UTC (rev 55716)
@@ -1,3 +1,11 @@
+2006-01-18 Raja R Harinath <[EMAIL PROTECTED]>
+
+ Fix #76656, cs0231-2.cs.
+ * cs-parser.jay (formal_parameter_list): Make error case catch
+ more issues.
+ (parenthesized_expression_0): Add CS1026 check.
+ (invocation_expression): Remove unused { $$ = lexer.Location }.
+
2006-01-17 Raja R Harinath <[EMAIL PROTECTED]>
Fix #76824.
Modified: trunk/mcs/mcs/cs-parser.jay
===================================================================
--- trunk/mcs/mcs/cs-parser.jay 2006-01-18 11:31:48 UTC (rev 55715)
+++ trunk/mcs/mcs/cs-parser.jay 2006-01-18 11:46:26 UTC (rev 55716)
@@ -1176,13 +1176,13 @@
$$ = new Parameters (pars, true);
}
- | parameter_array COMMA fixed_parameters
+ | parameter_array COMMA error
{
if ($1 != null)
Report.Error (231, ((Parameter) $1).Location, "A params
parameter must be the last parameter in a formal parameter list");
$$ = null;
}
- | ARGLIST COMMA fixed_parameters
+ | ARGLIST COMMA error
{
Report.Error (257, (Location) $1, "An __arglist parameter must
be the last parameter in a formal parameter list");
$$ = null;
@@ -2743,6 +2743,7 @@
// CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
CLOSE_PARENS_OPEN_PARENS
// or CLOSE_PARENS_MINUS.
}
+ | OPEN_PARENS expression error { CheckToken (1026, yyToken, "Expecting
')'", lexer.Location); }
;
parenthesized_expression
@@ -2757,7 +2758,7 @@
// in Binary.DoResolve().
$$ = new ParenthesizedExpression ((Expression) $1);
}
- ;;
+ ;
member_access
: primary_expression DOT IDENTIFIER
@@ -2777,15 +2778,12 @@
;
invocation_expression
- : primary_expression {
- $$ = lexer.Location;
- } OPEN_PARENS opt_argument_list CLOSE_PARENS
+ : primary_expression OPEN_PARENS opt_argument_list CLOSE_PARENS
{
- if ($1 == null) {
- Location l = (Location) $3;
- Report.Error (1, l, "Parse error");
- }
- $$ = new Invocation ((Expression) $1, (ArrayList) $4);
+ if ($1 == null)
+ Report.Error (1, (Location) $2, "Parse error");
+ else
+ $$ = new Invocation ((Expression) $1, (ArrayList) $3);
}
| parenthesized_expression_0 CLOSE_PARENS_OPEN_PARENS OPEN_PARENS
CLOSE_PARENS
{
@@ -4911,11 +4909,10 @@
void CheckToken (int error, int yyToken, string msg, Location loc)
{
- if (yyToken >= Token.FIRST_KEYWORD && yyToken <= Token.LAST_KEYWORD){
- Report.Error (error, loc, String.Format ("{0}: `{1}' is a
keyword", msg, yyNames [yyToken].ToLower ()));
- return;
- }
- Report.Error (error, loc, msg);
+ if (yyToken >= Token.FIRST_KEYWORD && yyToken <= Token.LAST_KEYWORD)
+ Report.Error (error, loc, "{0}: `{1}' is a keyword", msg,
yyNames [yyToken].ToLower ());
+ else
+ Report.Error (error, loc, msg);
}
void CheckIdentifierToken (int yyToken, Location loc)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches