Author: mkrueger
Date: 2007-09-11 04:33:39 -0400 (Tue, 11 Sep 2007)
New Revision: 85624
Modified:
trunk/monodevelop/Extras/CSharpBinding/ChangeLog
trunk/monodevelop/Extras/CSharpBinding/Parser/CodeGenerator.cs
Log:
* Parser/CodeGenerator.cs: Fixed 82500: Rename refactoring enum value
crashes MonoDevelop.
Modified: trunk/monodevelop/Extras/CSharpBinding/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/CSharpBinding/ChangeLog 2007-09-11 08:32:29 UTC
(rev 85623)
+++ trunk/monodevelop/Extras/CSharpBinding/ChangeLog 2007-09-11 08:33:39 UTC
(rev 85624)
@@ -1,3 +1,8 @@
+2007-09-11 Mike Krüger <[EMAIL PROTECTED]>
+
+ * Parser/CodeGenerator.cs: Fixed 82500: Rename refactoring enum value
+ crashes MonoDevelop.
+
2007-09-10 Mike Krüger <[EMAIL PROTECTED]>
* Parser/Resolver.cs: Fixed 82760: Nul ref enableing autocomplete.
Modified: trunk/monodevelop/Extras/CSharpBinding/Parser/CodeGenerator.cs
===================================================================
--- trunk/monodevelop/Extras/CSharpBinding/Parser/CodeGenerator.cs
2007-09-11 08:32:29 UTC (rev 85623)
+++ trunk/monodevelop/Extras/CSharpBinding/Parser/CodeGenerator.cs
2007-09-11 08:33:39 UTC (rev 85624)
@@ -236,16 +236,18 @@
bool IsMatchedField (string txt, string field, int index)
{
- char c = txt[index - 1];
-
- if (Char.IsLetterOrDigit (c) || c == '_')
- return false;
-
- c = txt[index + field.Length];
-
- if (Char.IsLetterOrDigit (c) || c == '_')
- return false;
-
+ char c;
+ if (index > 0) {
+ c = txt[index - 1];
+ if (Char.IsLetterOrDigit (c) || c == '_')
+ return false;
+ }
+ if (index + field.Length < txt.Length) {
+ c = txt[index + field.Length];
+
+ if (Char.IsLetterOrDigit (c) || c == '_')
+ return false;
+ }
return true;
}
@@ -261,12 +263,10 @@
string name = member.Name;
int len = txt.Length;
int pos = -1;
-
if (member is IField) {
// Fields are different because multiple fields
can be declared
// in the same region and might even reference
each other
// e.g. "public int fu, bar = 1, baz = bar;"
-
do {
if ((pos = txt.IndexOf (member.Name,
pos + 1)) == -1)
return -1;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches