Browse Source

* AstFormattingVisitor.cs: Fixed bug in binary operator expression.

* cs-parser.cs:
* cs-parser.jay: Fixed bug in "for" statement locations.
newNRvisualizers
mike 14 years ago
parent
commit
e43634786e
  1. 4
      ICSharpCode.NRefactory.CSharp/Formatter/AstFormattingVisitor.cs
  2. 2
      ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs
  3. 2
      ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay

4
ICSharpCode.NRefactory.CSharp/Formatter/AstFormattingVisitor.cs

@ -1,4 +1,4 @@
// //
// AstFormattingVisitor.cs // AstFormattingVisitor.cs
// //
// Author: // Author:
@ -1390,7 +1390,7 @@ namespace ICSharpCode.NRefactory.CSharp
base.VisitBinaryOperatorExpression (binaryOperatorExpression); base.VisitBinaryOperatorExpression (binaryOperatorExpression);
// Handle line breaks in binary opeartor expression. // Handle line breaks in binary opeartor expression.
if (binaryOperatorExpression.Left.StartLocation.Line != binaryOperatorExpression.Right.StartLocation.Line) { if (binaryOperatorExpression.Left.EndLocation.Line != binaryOperatorExpression.Right.StartLocation.Line) {
IndentLevel++; IndentLevel++;
if (binaryOperatorExpression.OperatorToken.StartLocation.Line == binaryOperatorExpression.Right.StartLocation.Line) { if (binaryOperatorExpression.OperatorToken.StartLocation.Line == binaryOperatorExpression.Right.StartLocation.Line) {
FixStatementIndentation (binaryOperatorExpression.OperatorToken.StartLocation); FixStatementIndentation (binaryOperatorExpression.OperatorToken.StartLocation);

2
ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs

@ -8064,7 +8064,7 @@ void case_806()
current_block.IsCompilerGenerated = true; current_block.IsCompilerGenerated = true;
For f = new For (GetLocation (yyVals[-1+yyTop])); For f = new For (GetLocation (yyVals[-1+yyTop]));
current_block.AddStatement (f); current_block.AddStatement (f);
lbag.AddStatement (f, current_block.StartLocation, GetLocation (yyVals[0+yyTop])); lbag.AddStatement (f, current_block.StartLocation);
yyVal = f; yyVal = f;
} }

2
ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay

@ -5333,7 +5333,7 @@ for_statement
current_block.IsCompilerGenerated = true; current_block.IsCompilerGenerated = true;
For f = new For (GetLocation ($1)); For f = new For (GetLocation ($1));
current_block.AddStatement (f); current_block.AddStatement (f);
lbag.AddStatement (f, current_block.StartLocation, GetLocation ($2)); lbag.AddStatement (f, current_block.StartLocation);
$$ = f; $$ = f;
} }
for_statement_cont for_statement_cont

Loading…
Cancel
Save