diff --git a/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/QueryExpressionTests.cs b/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/QueryExpressionTests.cs index 5601797c95..6f4817ec93 100644 --- a/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/QueryExpressionTests.cs +++ b/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/QueryExpressionTests.cs @@ -6,7 +6,7 @@ using NUnit.Framework; namespace ICSharpCode.NRefactory.CSharp.Parser.Expression { - [TestFixture, Ignore("Query expressions not yet implemented")] + [TestFixture] public class QueryExpressionTests { [Test] @@ -125,19 +125,17 @@ select new { c.Name, o.OrderID, o.Total }", }, new QueryWhereClause { Condition = new BinaryOperatorExpression { - Left = new IdentifierExpression("c").Member("OrderDate").Member("Year"), + Left = new IdentifierExpression("o").Member("OrderDate").Member("Year"), Operator = BinaryOperatorType.Equality, Right = new PrimitiveExpression(2005) } }, new QuerySelectClause { - Expression = new ObjectCreateExpression { - Initializer = new ArrayInitializerExpression { - Elements = { - new IdentifierExpression("c").Member("Name"), - new IdentifierExpression("o").Member("OrderID"), - new IdentifierExpression("o").Member("Total") - } + Expression = new AnonymousTypeCreateExpression { + Initializer = { + new IdentifierExpression("c").Member("Name"), + new IdentifierExpression("o").Member("OrderID"), + new IdentifierExpression("o").Member("Total") } } } diff --git a/ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs b/ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs index d055c25a24..d55d0a7b6b 100644 --- a/ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs +++ b/ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs @@ -137,6 +137,7 @@ namespace ICSharpCode.NRefactory.CSharp public AstNode Parent { get { return parent; } + set { parent = value; } } public Role Role { @@ -145,18 +146,22 @@ namespace ICSharpCode.NRefactory.CSharp public AstNode NextSibling { get { return nextSibling; } + set { nextSibling = value; } } public AstNode PrevSibling { get { return prevSibling; } + set { prevSibling = value; } } public AstNode FirstChild { get { return firstChild; } + set { firstChild = value; } } public AstNode LastChild { get { return lastChild; } + set { lastChild = value; } } public IEnumerable Children { diff --git a/ICSharpCode.NRefactory/CSharp/Ast/DepthFirstAstVisitor.cs b/ICSharpCode.NRefactory/CSharp/Ast/DepthFirstAstVisitor.cs index 50abe6c01c..044571bcc2 100644 --- a/ICSharpCode.NRefactory/CSharp/Ast/DepthFirstAstVisitor.cs +++ b/ICSharpCode.NRefactory/CSharp/Ast/DepthFirstAstVisitor.cs @@ -440,6 +440,11 @@ namespace ICSharpCode.NRefactory.CSharp return VisitChildren (objectCreateExpression, data); } + public virtual S VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression, T data) + { + return VisitChildren (anonymousTypeCreateExpression, data); + } + public virtual S VisitArrayCreateExpression (ArrayCreateExpression arrayObjectCreateExpression, T data) { return VisitChildren (arrayObjectCreateExpression, data); diff --git a/ICSharpCode.NRefactory/CSharp/Ast/Expressions/AnonymousTypeCreateExpression.cs b/ICSharpCode.NRefactory/CSharp/Ast/Expressions/AnonymousTypeCreateExpression.cs new file mode 100644 index 0000000000..0b216cc281 --- /dev/null +++ b/ICSharpCode.NRefactory/CSharp/Ast/Expressions/AnonymousTypeCreateExpression.cs @@ -0,0 +1,63 @@ +// +// AnonymousTypeCreateExpression.cs +// +// Author: +// Mike Krüger +// +// Copyright (c) 2011 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace ICSharpCode.NRefactory.CSharp +{ + /// + /// new { [ExpressionList] } + /// + public class AnonymousTypeCreateExpression : Expression + { + public CSharpTokenNode NewToken { + get { return GetChildByRole (Roles.Keyword); } + } + + public CSharpTokenNode LParToken { + get { return GetChildByRole (Roles.LPar); } + } + + public AstNodeCollection Initializer { + get { return GetChildrenByRole (Roles.Expression); } + } + + public CSharpTokenNode RParToken { + get { return GetChildByRole (Roles.RPar); } + } + + public override S AcceptVisitor (IAstVisitor visitor, T data) + { + return visitor.VisitAnonymousTypeCreateExpression (this, data); + } + + protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) + { + var o = other as AnonymousTypeCreateExpression; + return o != null && this.Initializer.DoMatch(o.Initializer, match); + } + } +} + diff --git a/ICSharpCode.NRefactory/CSharp/Ast/Expressions/QueryExpression.cs b/ICSharpCode.NRefactory/CSharp/Ast/Expressions/QueryExpression.cs index 9841a74685..5179c60368 100644 --- a/ICSharpCode.NRefactory/CSharp/Ast/Expressions/QueryExpression.cs +++ b/ICSharpCode.NRefactory/CSharp/Ast/Expressions/QueryExpression.cs @@ -101,6 +101,9 @@ namespace ICSharpCode.NRefactory.CSharp protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) { QueryContinuationClause o = other as QueryContinuationClause; + Console.WriteLine ("other: " + other); + Console.WriteLine (MatchString(this.Identifier, o.Identifier)); + Console.WriteLine (this.PrecedingQuery.DoMatch(o.PrecedingQuery, match)); return o != null && MatchString(this.Identifier, o.Identifier) && this.PrecedingQuery.DoMatch(o.PrecedingQuery, match); } } diff --git a/ICSharpCode.NRefactory/CSharp/Ast/IAstVisitor.cs b/ICSharpCode.NRefactory/CSharp/Ast/IAstVisitor.cs index 1e9c2a8a19..cb140b7829 100644 --- a/ICSharpCode.NRefactory/CSharp/Ast/IAstVisitor.cs +++ b/ICSharpCode.NRefactory/CSharp/Ast/IAstVisitor.cs @@ -32,6 +32,7 @@ namespace ICSharpCode.NRefactory.CSharp S VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, T data); S VisitNullReferenceExpression(NullReferenceExpression nullReferenceExpression, T data); S VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, T data); + S VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression, T data); S VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, T data); S VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression, T data); S VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, T data); diff --git a/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs b/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs index 53ded9f750..81466bdf44 100644 --- a/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs +++ b/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs @@ -771,6 +771,25 @@ namespace ICSharpCode.NRefactory.CSharp return EndNode(objectCreateExpression); } + public object VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression, object data) + { + StartNode(anonymousTypeCreateExpression); + WriteKeyword("new"); + Space(); + LPar(); + RPar(); + Space(); + OpenBrace(policy.AnonymousMethodBraceStyle); + foreach (AstNode node in anonymousTypeCreateExpression.Initializer) { + node.AcceptVisitor(this, null); + if (node.NextSibling != null) + Comma(node); + NewLine (); + } + CloseBrace(policy.AnonymousMethodBraceStyle); + return EndNode(anonymousTypeCreateExpression); + } + public object VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, object data) { StartNode(parenthesizedExpression); @@ -1026,7 +1045,8 @@ namespace ICSharpCode.NRefactory.CSharp if (first) { first = false; } else { - NewLine(); + if (!(clause is QueryContinuationClause)) + NewLine(); } clause.AcceptVisitor(this, data); } diff --git a/ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs b/ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs index 547e4f2da9..30fea469d3 100644 --- a/ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs +++ b/ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs @@ -2217,8 +2217,25 @@ namespace ICSharpCode.NRefactory.CSharp if (location != null) result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), ObjectCreateExpression.Roles.RPar); - // TODO: Collection initializer ? - + return result; + } + + public override object Visit (NewAnonymousType newAnonymousType) + { + var result = new AnonymousTypeCreateExpression (); + foreach (var par in newAnonymousType.Parameters) { + var location = LocationsBag.GetLocations (par); + + if (location == null) { + result.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression); + } else { + var namedArgument = new NamedArgumentExpression (); + namedArgument.AddChild (new Identifier (par.Name, Convert (par.Location)), AnonymousTypeCreateExpression.Roles.Identifier); + namedArgument.AddChild (new CSharpTokenNode (Convert (location[0]), 1), AnonymousTypeCreateExpression.Roles.Assign); + namedArgument.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression); + result.AddChild (namedArgument, AnonymousTypeCreateExpression.Roles.Expression); + } + } return result; } @@ -2542,47 +2559,98 @@ namespace ICSharpCode.NRefactory.CSharp #endregion #region LINQ expressions -/* public override object Visit (Mono.CSharp.Linq.Query queryExpression) - { - var result = new QueryFromClause (); - var location = LocationsBag.GetLocations (queryExpression); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), "from".Length), QueryFromClause.FromKeywordRole); - // TODO: select identifier - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[1]), "in".Length), QueryFromClause.InKeywordRole); - var query = queryExpression.Expr as Mono.CSharp.Linq.AQueryClause; -// if (query != null && query.Expr != null) -// result.AddChild ((AstNode)query.Expr.Accept (this), QueryFromClause.Roles.Expression); + public override object Visit (Mono.CSharp.Linq.QueryExpression queryExpression) + { + var result = new QueryExpression (); + + var currentClause = queryExpression.next; + var queryStarts = new Stack (); + + while (currentClause != null) { + Console.WriteLine (currentClause); + QueryClause clause = (QueryClause)currentClause.Accept (this); + if (clause is QueryFromClause) { + queryStarts.Push (clause); + } else if (clause is QueryContinuationClause) { + var lastStart = queryStarts.Pop (); + var precedingQuery = new QueryExpression (); + List children = new List (); + AstNode node = lastStart; + while (node != null) { + children.Add (node); + node = node.NextSibling; + } + result.LastChild = lastStart.PrevSibling; + if (lastStart.PrevSibling != null) { + lastStart.PrevSibling.NextSibling = null; + lastStart.PrevSibling = null; + } else { + // lastStart == FirstChild + result.FirstChild = null; + } + + children.ForEach (c => c.Parent = precedingQuery); + precedingQuery.FirstChild = children.First (); + precedingQuery.LastChild = children.Last (); + + ((QueryContinuationClause)clause).PrecedingQuery = precedingQuery; + + queryStarts.Push (clause); + } + result.AddChild (clause, QueryExpression.ClauseRole); + currentClause = currentClause.next; + } + return result; - } */ + } - public override object Visit (Mono.CSharp.Linq.SelectMany selectMany) + public override object Visit (Mono.CSharp.Linq.QueryStartClause queryStart) { - var result = new QueryFromClause (); - // TODO: -// Mono.CSharp.Linq.Cast cast = selectMany.Expr as Mono.CSharp.Linq.Cast; - var location = LocationsBag.GetLocations (selectMany); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), "from".Length), QueryFromClause.FromKeywordRole); + if (queryStart.Expr == null) { + var intoClause = new QueryContinuationClause (); + intoClause.AddChild (new CSharpTokenNode (Convert (queryStart.Location), "into".Length), QueryContinuationClause.IntoKeywordRole); + intoClause.AddChild (new Identifier (queryStart.IntoVariable.Name, Convert(queryStart.IntoVariable.Location)), QueryContinuationClause.Roles.Identifier); + return intoClause; + } - // result.AddChild ((AstNode)cast.TypeExpr.Accept (this), QueryFromClause.Roles.ReturnType); -// if (cast != null) + var fromClause = new QueryFromClause (); + var location = LocationsBag.GetLocations (queryStart); -// result.AddChild (new Identifier (selectMany.SelectIdentifier.Value, Convert (selectMany.SelectIdentifier.Location)), QueryFromClause.Roles.Identifier); - // result.AddChild (new CSharpTokenNode (Convert (location[1]), "in".Length), QueryFromClause.InKeywordRole); + fromClause.AddChild (new CSharpTokenNode (Convert (queryStart.Location), "from".Length), QueryFromClause.FromKeywordRole); - // result.AddChild ((AstNode)(cast != null ? cast.Expr : selectMany.Expr).Accept (this), QueryFromClause.Roles.Expression); + if (queryStart.IdentifierType != null) + fromClause.AddChild (ConvertToType (queryStart.IdentifierType), QueryFromClause.Roles.Type); + fromClause.AddChild (new Identifier (queryStart.IntoVariable.Name, Convert(queryStart.IntoVariable.Location)), QueryFromClause.Roles.Identifier); - return result; + if (location != null) + fromClause.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryFromClause.InKeywordRole); + fromClause.AddChild ((Expression)queryStart.Expr.Accept (this), QueryFromClause.Roles.Expression); + return fromClause; + } + + public override object Visit (Mono.CSharp.Linq.SelectMany queryStart) + { + var fromClause = new QueryFromClause (); + var location = LocationsBag.GetLocations (queryStart); + + fromClause.AddChild (new CSharpTokenNode (Convert (queryStart.Location), "from".Length), QueryFromClause.FromKeywordRole); + + if (queryStart.IdentifierType != null) + fromClause.AddChild (ConvertToType (queryStart.IdentifierType), QueryFromClause.Roles.Type); + + fromClause.AddChild (new Identifier (queryStart.IntoVariable.Name, Convert(queryStart.IntoVariable.Location)), QueryFromClause.Roles.Identifier); + + if (location != null) + fromClause.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryFromClause.InKeywordRole); + fromClause.AddChild ((Expression)queryStart.Expr.Accept (this), QueryFromClause.Roles.Expression); + return fromClause; } public override object Visit (Mono.CSharp.Linq.Select sel) { var result = new QuerySelectClause (); - var location = LocationsBag.GetLocations (sel); - result.AddChild (new CSharpTokenNode (Convert (location[0]), "select".Length), QueryWhereClause.Roles.Keyword); + result.AddChild (new CSharpTokenNode (Convert (sel.Location), "select".Length), QueryWhereClause.Roles.Keyword); result.AddChild ((Expression)sel.Expr.Accept (this), QueryWhereClause.Roles.Expression); return result; } @@ -2591,12 +2659,11 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new QueryGroupClause (); var location = LocationsBag.GetLocations (groupBy); + result.AddChild (new CSharpTokenNode (Convert (groupBy.Location), "group".Length), QueryGroupClause.GroupKeywordRole); + result.AddChild ((Expression)groupBy.ElementSelector.Accept (this), QueryGroupClause.KeyRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), "group".Length), QueryGroupClause.GroupKeywordRole); -// result.AddChild ((AstNode)groupBy.ElementSelector.Accept (this), QueryGroupClause.GroupByExpressionRole); -// if (location != null) -// result.AddChild (new CSharpTokenNode (Convert (location[1]), "by".Length), QueryGroupClause.ByKeywordRole); -// result.AddChild ((AstNode)groupBy.Expr.Accept (this), QueryGroupClause.ProjectionExpressionRole); + result.AddChild (new CSharpTokenNode (Convert (location[0]), "by".Length), QueryGroupClause.ByKeywordRole); + result.AddChild ((Expression)groupBy.Expr.Accept (this), QueryGroupClause.ProjectionRole); return result; } @@ -2605,17 +2672,11 @@ namespace ICSharpCode.NRefactory.CSharp var result = new QueryLetClause (); var location = LocationsBag.GetLocations (l); + result.AddChild (new CSharpTokenNode (Convert (l.Location), "let".Length), QueryLetClause.Roles.Keyword); + result.AddChild (new Identifier (l.IntoVariable.Name, Convert (l.IntoVariable.Location)), Identifier.Roles.Identifier); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), "let".Length), QueryWhereClause.Roles.Keyword); - - NewAnonymousType aType = l.Expr as NewAnonymousType; - AnonymousTypeParameter param = ((AnonymousTypeParameter)aType.Parameters[1]); - result.AddChild (new Identifier (param.Name, Convert (param.Location)), Identifier.Roles.Identifier); - - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), QueryWhereClause.Roles.Assign); - - result.AddChild ((Expression)param.Expr.Accept (this), QueryWhereClause.Roles.Condition); + result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), QueryLetClause.Roles.Assign); + result.AddChild ((Expression)l.Expr.Accept (this), QueryLetClause.Roles.Expression); return result; } @@ -2632,98 +2693,117 @@ namespace ICSharpCode.NRefactory.CSharp public override object Visit (Mono.CSharp.Linq.Join join) { var result = new QueryJoinClause (); - /* var location = LocationsBag.GetLocations (join); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), "join".Length), QueryJoinClause.JoinKeywordRole); + var location = LocationsBag.GetLocations (join); + result.AddChild (new CSharpTokenNode (Convert (join.Location), "join".Length), QueryJoinClause.JoinKeywordRole); result.AddChild (new Identifier (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), Identifier.Roles.Identifier); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[1]), "in".Length), QueryJoinClause.InKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryJoinClause.InKeywordRole); - result.AddChild ((AstNode)join.Expr.Accept (this), QueryJoinClause.Roles.Expression); + result.AddChild ((Expression)join.Expr.Accept (this), QueryJoinClause.Roles.Expression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[2]), "on".Length), QueryJoinClause.OnKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location[1]), "on".Length), QueryJoinClause.OnKeywordRole); // TODO: on expression if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[3]), "equals".Length), QueryJoinClause.EqualsKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location[2]), "equals".Length), QueryJoinClause.EqualsKeywordRole); // TODO: equals expression - */ + return result; } - public override object Visit (Mono.CSharp.Linq.GroupJoin groupJoin) + public override object Visit (Mono.CSharp.Linq.GroupJoin join) { var result = new QueryJoinClause (); -/* var location = LocationsBag.GetLocations (groupJoin); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), "join".Length), QueryJoinClause.JoinKeywordRole); + var location = LocationsBag.GetLocations (join); + result.AddChild (new CSharpTokenNode (Convert (join.Location), "join".Length), QueryJoinClause.JoinKeywordRole); - result.AddChild (new Identifier (groupJoin.JoinVariable.Name, Convert (groupJoin.JoinVariable.Location)), Identifier.Roles.Identifier); + result.AddChild (new Identifier (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), Identifier.Roles.Identifier); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[1]), "in".Length), QueryJoinClause.InKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryJoinClause.InKeywordRole); - result.AddChild ((AstNode)groupJoin.Expr.Accept (this), QueryJoinClause.Roles.Expression); + result.AddChild ((Expression)join.Expr.Accept (this), QueryJoinClause.Roles.Expression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[2]), "on".Length), QueryJoinClause.OnKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location[1]), "on".Length), QueryJoinClause.OnKeywordRole); + // TODO: on expression if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[3]), "equals".Length), QueryJoinClause.EqualsKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location[2]), "equals".Length), QueryJoinClause.EqualsKeywordRole); // TODO: equals expression if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[4]), "into".Length), QueryJoinClause.IntoKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location[3]), "into".Length), QueryJoinClause.IntoKeywordRole); - result.AddChild (new Identifier (groupJoin.JoinVariable.Name, Convert (groupJoin.JoinVariable.Location)), Identifier.Roles.Identifier);*/ + result.AddChild (new Identifier (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), Identifier.Roles.Identifier); return result; } public override object Visit (Mono.CSharp.Linq.OrderByAscending orderByAscending) { var result = new QueryOrderClause (); - /* result.OrderAscending = true; - result.AddChild ((AstNode)orderByAscending.Expr.Accept (this), QueryWhereClause.Roles.Expression); + + var ordering = new QueryOrdering (); + + ordering.AddChild ((Expression)orderByAscending.Expr.Accept (this), QueryWhereClause.Roles.Expression); var location = LocationsBag.GetLocations (orderByAscending); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), "ascending".Length), QueryWhereClause.Roles.Keyword);*/ + if (location != null) { + ordering.Direction = QueryOrderingDirection.Ascending; + ordering.AddChild (new CSharpTokenNode (Convert (location[0]), "ascending".Length), QueryWhereClause.Roles.Keyword); + } + result.AddChild (ordering, QueryOrderClause.OrderingRole); return result; } public override object Visit (Mono.CSharp.Linq.OrderByDescending orderByDescending) { var result = new QueryOrderClause (); - /* result.OrderAscending = false; - result.AddChild ((AstNode)orderByDescending.Expr.Accept (this), QueryWhereClause.Roles.Expression); + + var ordering = new QueryOrdering (); + + ordering.AddChild ((Expression)orderByDescending.Expr.Accept (this), QueryWhereClause.Roles.Expression); var location = LocationsBag.GetLocations (orderByDescending); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), "descending".Length), QueryWhereClause.Roles.Keyword);*/ + if (location != null) { + ordering.Direction = QueryOrderingDirection.Descending; + ordering.AddChild (new CSharpTokenNode (Convert (location[0]), "ascending".Length), QueryWhereClause.Roles.Keyword); + } + result.AddChild (ordering, QueryOrderClause.OrderingRole); return result; - } + } public override object Visit (Mono.CSharp.Linq.ThenByAscending thenByAscending) { var result = new QueryOrderClause (); - /* result.OrderAscending = true; - result.AddChild ((AstNode)thenByAscending.Expr.Accept (this), QueryWhereClause.Roles.Expression); + + var ordering = new QueryOrdering (); + + ordering.AddChild ((Expression)thenByAscending.Expr.Accept (this), QueryWhereClause.Roles.Expression); var location = LocationsBag.GetLocations (thenByAscending); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), "ascending".Length), QueryWhereClause.Roles.Keyword);*/ + if (location != null) { + ordering.Direction = QueryOrderingDirection.Ascending; + ordering.AddChild (new CSharpTokenNode (Convert (location[0]), "ascending".Length), QueryWhereClause.Roles.Keyword); + } + result.AddChild (ordering, QueryOrderClause.OrderingRole); return result; } public override object Visit (Mono.CSharp.Linq.ThenByDescending thenByDescending) { var result = new QueryOrderClause (); -/* result.OrderAscending = false; - result.AddChild ((AstNode)thenByDescending.Expr.Accept (this), QueryWhereClause.Roles.Expression); + + var ordering = new QueryOrdering (); + + ordering.AddChild ((Expression)thenByDescending.Expr.Accept (this), QueryWhereClause.Roles.Expression); var location = LocationsBag.GetLocations (thenByDescending); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), "descending".Length), QueryWhereClause.Roles.Keyword);*/ + if (location != null) { + ordering.Direction = QueryOrderingDirection.Descending; + ordering.AddChild (new CSharpTokenNode (Convert (location[0]), "ascending".Length), QueryWhereClause.Roles.Keyword); + } + result.AddChild (ordering, QueryOrderClause.OrderingRole); return result; } #endregion diff --git a/ICSharpCode.NRefactory/CSharp/Parser/mcs/cs-parser.cs b/ICSharpCode.NRefactory/CSharp/Parser/mcs/cs-parser.cs index 59104a2038..cdd44d3ae7 100644 --- a/ICSharpCode.NRefactory/CSharp/Parser/mcs/cs-parser.cs +++ b/ICSharpCode.NRefactory/CSharp/Parser/mcs/cs-parser.cs @@ -3674,7 +3674,7 @@ case 879: case_879(); break; case 885: -#line 5704 "cs-parser.jay" +#line 5705 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } @@ -3683,7 +3683,7 @@ case 886: case_886(); break; case 887: -#line 5722 "cs-parser.jay" +#line 5724 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } @@ -3716,13 +3716,13 @@ case 896: case_896(); break; case 898: -#line 5864 "cs-parser.jay" +#line 5868 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 899: -#line 5871 "cs-parser.jay" +#line 5875 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } @@ -3743,40 +3743,28 @@ case 906: case_906(); break; case 907: -#line 5917 "cs-parser.jay" +#line 5921 "cs-parser.jay" { yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); } break; case 908: -#line 5921 "cs-parser.jay" - { - yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); - } + case_908(); break; case 909: -#line 5925 "cs-parser.jay" - { - yyVal = new Linq.OrderByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); - } + case_909(); break; case 910: -#line 5932 "cs-parser.jay" +#line 5938 "cs-parser.jay" { yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); } break; case 911: -#line 5936 "cs-parser.jay" - { - yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); - } + case_911(); break; case 912: -#line 5940 "cs-parser.jay" - { - yyVal = new Linq.ThenByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); - } + case_912(); break; case 914: case_914(); @@ -3791,13 +3779,13 @@ case 919: case_919(); break; case 927: -#line 6054 "cs-parser.jay" +#line 6062 "cs-parser.jay" { module.DocumentationBuilder.ParsedName = (MemberName) yyVals[0+yyTop]; } break; case 928: -#line 6061 "cs-parser.jay" +#line 6069 "cs-parser.jay" { module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; } @@ -3809,13 +3797,13 @@ case 930: case_930(); break; case 931: -#line 6078 "cs-parser.jay" +#line 6086 "cs-parser.jay" { yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], new MemberName (MemberCache.IndexerNameAlias)); } break; case 932: -#line 6082 "cs-parser.jay" +#line 6090 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } @@ -3833,25 +3821,25 @@ case 936: case_936(); break; case 938: -#line 6118 "cs-parser.jay" +#line 6126 "cs-parser.jay" { yyVal = new MemberName (((MemberName) yyVals[-2+yyTop]), (MemberName) yyVals[0+yyTop]); } break; case 940: -#line 6126 "cs-parser.jay" +#line 6134 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 941: -#line 6130 "cs-parser.jay" +#line 6138 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 942: -#line 6137 "cs-parser.jay" +#line 6145 "cs-parser.jay" { yyVal = new List (0); } @@ -8127,25 +8115,27 @@ void case_875() #line 5670 "cs-parser.jay" { yyVal = new Linq.GroupBy ((Linq.QueryBlock)current_block, (Expression)yyVals[-3+yyTop], linq_clause_blocks.Pop (), (Expression)yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop])); + lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } void case_879() -#line 5686 "cs-parser.jay" +#line 5687 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-1+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } void case_886() -#line 5706 "cs-parser.jay" +#line 5707 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); yyVal = new Linq.Let ((Linq.QueryBlock) current_block, sn, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); - + lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); + current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8153,7 +8143,7 @@ void case_886() } void case_888() -#line 5724 "cs-parser.jay" +#line 5726 "cs-parser.jay" { yyVal = new Linq.Where ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); @@ -8162,7 +8152,7 @@ void case_888() } void case_889() -#line 5734 "cs-parser.jay" +#line 5736 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack (); @@ -8172,7 +8162,7 @@ void case_889() } void case_890() -#line 5742 "cs-parser.jay" +#line 5744 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8182,7 +8172,7 @@ void case_890() } void case_891() -#line 5750 "cs-parser.jay" +#line 5752 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -8192,7 +8182,7 @@ void case_891() } void case_892() -#line 5758 "cs-parser.jay" +#line 5760 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -8207,6 +8197,7 @@ void case_892() if (yyVals[0+yyTop] == null) { into = sn; yyVal = new Linq.Join (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, GetLocation (yyVals[-11+yyTop])); + lbag.AddLocation (yyVal, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-3+yyTop])); } else { /**/ /* Set equals right side parent to beginning of linq query, it is not accessible therefore cannot cause name collisions*/ @@ -8223,6 +8214,7 @@ void case_892() into = new Linq.RangeVariable (lt.Value, lt.Location); yyVal = new Linq.GroupJoin (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, into, GetLocation (yyVals[-11+yyTop])); + lbag.AddLocation (yyVal, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } current_block = block.Parent; @@ -8230,7 +8222,7 @@ void case_892() } void case_893() -#line 5794 "cs-parser.jay" +#line 5798 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack (); @@ -8240,7 +8232,7 @@ void case_893() } void case_894() -#line 5802 "cs-parser.jay" +#line 5806 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8250,7 +8242,7 @@ void case_894() } void case_895() -#line 5810 "cs-parser.jay" +#line 5814 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -8260,7 +8252,7 @@ void case_895() } void case_896() -#line 5818 "cs-parser.jay" +#line 5822 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -8302,7 +8294,7 @@ void case_896() } void case_900() -#line 5873 "cs-parser.jay" +#line 5877 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8311,7 +8303,7 @@ void case_900() } void case_902() -#line 5884 "cs-parser.jay" +#line 5888 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8320,14 +8312,14 @@ void case_902() } void case_903() -#line 5891 "cs-parser.jay" +#line 5895 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-3+yyTop]).Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-3+yyTop]; } void case_905() -#line 5900 "cs-parser.jay" +#line 5904 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8336,14 +8328,42 @@ void case_905() } void case_906() -#line 5907 "cs-parser.jay" +#line 5911 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-3+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-3+yyTop]; } +void case_908() +#line 5923 "cs-parser.jay" +{ + yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); + lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); + } + +void case_909() +#line 5928 "cs-parser.jay" +{ + yyVal = new Linq.OrderByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); + lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); + } + +void case_911() +#line 5940 "cs-parser.jay" +{ + yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); + lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); + } + +void case_912() +#line 5945 "cs-parser.jay" +{ + yyVal = new Linq.ThenByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); + lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); + } + void case_914() -#line 5947 "cs-parser.jay" +#line 5955 "cs-parser.jay" { /* query continuation block is not linked with query block but with block*/ /* before. This means each query can use same range variable names for*/ @@ -8361,7 +8381,7 @@ void case_914() } void case_915() -#line 5963 "cs-parser.jay" +#line 5971 "cs-parser.jay" { var current_block = linq_clause_blocks.Pop (); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; @@ -8372,7 +8392,7 @@ void case_915() } void case_918() -#line 5990 "cs-parser.jay" +#line 5998 "cs-parser.jay" { current_container = new Class (current_namespace, current_class, new MemberName (""), Modifiers.PUBLIC, null); current_class = current_container; @@ -8404,7 +8424,7 @@ void case_918() } void case_919() -#line 6020 "cs-parser.jay" +#line 6028 "cs-parser.jay" { --lexer.parsing_block; Method method = (Method) oob_stack.Pop (); @@ -8416,7 +8436,7 @@ void case_919() } void case_929() -#line 6063 "cs-parser.jay" +#line 6071 "cs-parser.jay" { module.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)yyVals[-1+yyTop]; module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; @@ -8424,7 +8444,7 @@ void case_929() } void case_930() -#line 6069 "cs-parser.jay" +#line 6077 "cs-parser.jay" { module.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)yyVals[-3+yyTop]; module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; @@ -8433,14 +8453,14 @@ void case_930() } void case_933() -#line 6084 "cs-parser.jay" +#line 6092 "cs-parser.jay" { module.DocumentationBuilder.ParsedParameters = (List)yyVals[-1+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-6+yyTop], new MemberName (MemberCache.IndexerNameAlias)); } void case_934() -#line 6089 "cs-parser.jay" +#line 6097 "cs-parser.jay" { var p = (List)yyVals[0+yyTop] ?? new List (1); p.Add (new DocumentationParameter ((FullNamedExpression) yyVals[-1+yyTop])); @@ -8450,7 +8470,7 @@ void case_934() } void case_935() -#line 6097 "cs-parser.jay" +#line 6105 "cs-parser.jay" { var p = (List)yyVals[0+yyTop] ?? new List (1); p.Add (new DocumentationParameter ((FullNamedExpression) yyVals[-1+yyTop])); @@ -8460,7 +8480,7 @@ void case_935() } void case_936() -#line 6105 "cs-parser.jay" +#line 6113 "cs-parser.jay" { var p = (List)yyVals[0+yyTop] ?? new List (1); module.DocumentationBuilder.ParsedParameters = p; @@ -8469,7 +8489,7 @@ void case_936() } void case_944() -#line 6143 "cs-parser.jay" +#line 6151 "cs-parser.jay" { var parameters = new List (); parameters.Add ((DocumentationParameter) yyVals[0+yyTop]); @@ -8477,7 +8497,7 @@ void case_944() } void case_945() -#line 6149 "cs-parser.jay" +#line 6157 "cs-parser.jay" { var parameters = yyVals[-2+yyTop] as List; parameters.Add ((DocumentationParameter) yyVals[0+yyTop]); @@ -8485,7 +8505,7 @@ void case_945() } void case_946() -#line 6158 "cs-parser.jay" +#line 6166 "cs-parser.jay" { if (yyVals[-1+yyTop] != null) yyVal = new DocumentationParameter ((Parameter.Modifier) yyVals[-1+yyTop], (FullNamedExpression) yyVals[0+yyTop]); @@ -11811,7 +11831,7 @@ void case_946() -1, -1, 359, }; -#line 6167 "cs-parser.jay" +#line 6175 "cs-parser.jay" // // A class used to hold info about an operator declarator diff --git a/ICSharpCode.NRefactory/CSharp/Parser/mcs/cs-parser.jay b/ICSharpCode.NRefactory/CSharp/Parser/mcs/cs-parser.jay index 838a708f81..4cca865305 100644 --- a/ICSharpCode.NRefactory/CSharp/Parser/mcs/cs-parser.jay +++ b/ICSharpCode.NRefactory/CSharp/Parser/mcs/cs-parser.jay @@ -5669,6 +5669,7 @@ select_or_group_clause BY expression { $$ = new Linq.GroupBy ((Linq.QueryBlock)current_block, (Expression)$3, linq_clause_blocks.Pop (), (Expression)$6, GetLocation ($1)); + lbag.AddLocation ($$, GetLocation ($5)); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -5707,7 +5708,8 @@ let_clause var lt = (Tokenizer.LocatedToken) $2; var sn = new Linq.RangeVariable (lt.Value, lt.Location); $$ = new Linq.Let ((Linq.QueryBlock) current_block, sn, (Expression)$5, GetLocation ($1)); - + lbag.AddLocation ($$, GetLocation ($3)); + current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -5769,6 +5771,7 @@ join_clause if ($12 == null) { into = sn; $$ = new Linq.Join (block, sn, (Expression)$5, outer_selector, (Linq.QueryBlock) current_block, GetLocation ($1)); + lbag.AddLocation ($$, GetLocation ($3), GetLocation ($6), GetLocation ($9)); } else { // // Set equals right side parent to beginning of linq query, it is not accessible therefore cannot cause name collisions @@ -5785,6 +5788,7 @@ join_clause into = new Linq.RangeVariable (lt.Value, lt.Location); $$ = new Linq.GroupJoin (block, sn, (Expression)$5, outer_selector, (Linq.QueryBlock) current_block, into, GetLocation ($1)); + lbag.AddLocation ($$, GetLocation ($3), GetLocation ($6), GetLocation ($9), GetLocation ($12)); } current_block = block.Parent; @@ -5918,10 +5922,12 @@ order_by | expression ASCENDING { $$ = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)$1); + lbag.AddLocation ($$, GetLocation ($2)); } | expression DESCENDING { $$ = new Linq.OrderByDescending ((Linq.QueryBlock) current_block, (Expression)$1); + lbag.AddLocation ($$, GetLocation ($2)); } ; @@ -5933,10 +5939,12 @@ then_by | expression ASCENDING { $$ = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)$1); + lbag.AddLocation ($$, GetLocation ($2)); } | expression DESCENDING { $$ = new Linq.ThenByDescending ((Linq.QueryBlock) current_block, (Expression)$1); + lbag.AddLocation ($$, GetLocation ($2)); } ; diff --git a/ICSharpCode.NRefactory/CSharp/Parser/mcs/expression.cs b/ICSharpCode.NRefactory/CSharp/Parser/mcs/expression.cs index 5363e82453..de35886e24 100644 --- a/ICSharpCode.NRefactory/CSharp/Parser/mcs/expression.cs +++ b/ICSharpCode.NRefactory/CSharp/Parser/mcs/expression.cs @@ -9670,7 +9670,7 @@ namespace Mono.CSharp public override object Accept (StructuralVisitor visitor) { return visitor.Visit (this); - } + } } public class NewAnonymousType : New @@ -9783,6 +9783,11 @@ namespace Mono.CSharp RequestedType = new GenericTypeExpr (anonymous_type.Definition, new TypeArguments (t_args), loc); return base.DoResolve (ec); } + + public override object Accept (StructuralVisitor visitor) + { + return visitor.Visit (this); + } } public class AnonymousTypeParameter : ShimExpression diff --git a/ICSharpCode.NRefactory/CSharp/Parser/mcs/linq.cs b/ICSharpCode.NRefactory/CSharp/Parser/mcs/linq.cs index 3046ae240c..070b6df10c 100644 --- a/ICSharpCode.NRefactory/CSharp/Parser/mcs/linq.cs +++ b/ICSharpCode.NRefactory/CSharp/Parser/mcs/linq.cs @@ -273,7 +273,13 @@ namespace Mono.CSharp.Linq } protected RangeVariable identifier; - + + public RangeVariable IntoVariable { + get { + return identifier; + } + } + protected ARangeVariableQueryClause (QueryBlock block, RangeVariable identifier, Expression expr, Location loc) : base (block, expr, loc) { @@ -434,6 +440,11 @@ namespace Mono.CSharp.Linq protected override string MethodName { get { throw new NotSupportedException (); } } + + public override object Accept (StructuralVisitor visitor) + { + return visitor.Visit (this); + } } @@ -500,7 +511,19 @@ namespace Mono.CSharp.Linq public RangeVariable JoinVariable { get { return this.GetIntoVariable (); } } - + + public QueryBlock InnerSelector { + get { + return inner_selector; + } + } + + public QueryBlock OuterSelector { + get { + return outer_selector; + } + } + public Join (QueryBlock block, RangeVariable lt, Expression inner, QueryBlock outerSelector, QueryBlock innerSelector, Location loc) : base (block, lt, inner, loc) { diff --git a/ICSharpCode.NRefactory/CSharp/Parser/mcs/visit.cs b/ICSharpCode.NRefactory/CSharp/Parser/mcs/visit.cs index 3540793cf3..da7ade635e 100644 --- a/ICSharpCode.NRefactory/CSharp/Parser/mcs/visit.cs +++ b/ICSharpCode.NRefactory/CSharp/Parser/mcs/visit.cs @@ -446,6 +446,11 @@ namespace Mono.CSharp return null; } + public virtual object Visit (NewAnonymousType newAnonymousType) + { + return null; + } + public virtual object Visit (NewInitialize newInitializeExpression) { return null; @@ -546,6 +551,11 @@ namespace Mono.CSharp return null; } + public virtual object Visit (Linq.QueryStartClause queryExpression) + { + return null; + } + public virtual object Visit (Linq.SelectMany selectMany) { return null; diff --git a/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj b/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj index 503a62b5dd..3aec1477af 100644 --- a/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj +++ b/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj @@ -351,6 +351,7 @@ +