Author: mkrueger
Date: 2007-10-08 04:09:39 -0400 (Mon, 08 Oct 2007)
New Revision: 87078
Modified:
trunk/monodevelop/Extras/CSharpBinding/ChangeLog
trunk/monodevelop/Extras/CSharpBinding/Parser/ExpressionFinder.cs
Log:
* Parser/ExpressionFinder.cs: Worked on "Bug 330717 - Error while
updating status of command. CurrentRefactoryOperations". Need to
get reply, if this bug is fixed (couldn't reproduce the problem).
Modified: trunk/monodevelop/Extras/CSharpBinding/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/CSharpBinding/ChangeLog 2007-10-08 08:02:59 UTC
(rev 87077)
+++ trunk/monodevelop/Extras/CSharpBinding/ChangeLog 2007-10-08 08:09:39 UTC
(rev 87078)
@@ -1,3 +1,9 @@
+2007-10-08 Mike Krüger <[EMAIL PROTECTED]>
+
+ * Parser/ExpressionFinder.cs: Worked on "Bug 330717 - Error while
updating
+ status of command. CurrentRefactoryOperations". Need to get reply, if
+ this bug is fixed (couldn't reproduce the problem).
+
2007-10-05 Ankit Jain <[EMAIL PROTECTED]>
* Autotools/CSharpAutotoolsSetup.cs (GetCompilerFlags): Correctly emit
Modified: trunk/monodevelop/Extras/CSharpBinding/Parser/ExpressionFinder.cs
===================================================================
--- trunk/monodevelop/Extras/CSharpBinding/Parser/ExpressionFinder.cs
2007-10-08 08:02:59 UTC (rev 87077)
+++ trunk/monodevelop/Extras/CSharpBinding/Parser/ExpressionFinder.cs
2007-10-08 08:09:39 UTC (rev 87078)
@@ -213,7 +213,9 @@
#region FindFullExpression
public ExpressionResult FindFullExpression(string inText, int
offset)
- {
+ {
+ if (inText == null)
+ return new ExpressionResult (null);
int offsetWithoutComments = offset;
string textWithoutComments = FilterComments(inText, ref
offsetWithoutComments);
string expressionBeforeOffset =
FindExpressionInternal(textWithoutComments, offsetWithoutComments);
@@ -394,10 +396,10 @@
int initialOffset;
public string FilterComments(string text, ref int offset)
{
- if (text.Length <= offset)
+ if (text == null || text.Length <= offset)
return null;
this.initialOffset = offset;
- StringBuilder outText = new StringBuilder();
+ StringBuilder result = new StringBuilder();
int curOffset = 0;
while (curOffset <= initialOffset) {
@@ -406,27 +408,27 @@
switch (ch) {
case '@':
if (curOffset + 1 < text.Length
&& text[curOffset + 1] == '"') {
-
outText.Append(text[curOffset++]); // @
-
outText.Append(text[curOffset++]); // "
- if
(!ReadVerbatimString(outText, text, ref curOffset)) {
+
result.Append(text[curOffset++]); // @
+
result.Append(text[curOffset++]); // "
+ if
(!ReadVerbatimString(result, text, ref curOffset)) {
return null;
}
}else{
- outText.Append(ch);
+ result.Append(ch);
++curOffset;
}
break;
case '\'':
- outText.Append(ch);
+ result.Append(ch);
curOffset++;
- if(! ReadChar(outText, text,
ref curOffset)) {
+ if(! ReadChar(result, text, ref
curOffset)) {
return null;
}
break;
case '"':
- outText.Append(ch);
+ result.Append(ch);
curOffset++;
- if (!ReadString(outText, text,
ref curOffset)) {
+ if (!ReadString(result, text,
ref curOffset)) {
return null;
}
break;
@@ -453,13 +455,13 @@
}
break;
default:
- outText.Append(ch);
+ result.Append(ch);
++curOffset;
break;
}
}
- return outText.ToString();
+ return result.ToString();
}
bool ReadToEOL(string text, ref int curOffset, ref int offset)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches