diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin index 15bf0aefb1..d997f1f7fb 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin @@ -279,6 +279,7 @@ + diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs index a2afbf1fe5..61e9f6bdae 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs @@ -46,9 +46,18 @@ namespace CSharpBinding.Completion }; } - ICompletionData ICompletionDataFactory.CreateTypeCompletionData(IType type, string shortType) + ICompletionData ICompletionDataFactory.CreateTypeCompletionData(IType type, bool showFullName, bool isInAttributeContext) { - return new CompletionData(shortType); + var typeDef = type.GetDefinition(); + if (typeDef != null) + return new EntityCompletionData(typeDef); + else + return new CompletionData(type.Name); + } + + ICompletionData ICompletionDataFactory.CreateMemberCompletionData(IType type, IEntity member) + { + return new CompletionData(type.Name + "." + member.Name); } ICompletionData ICompletionDataFactory.CreateLiteralCompletionData(string title, string description, string insertText) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs index b8eb4bf212..8990fb5d82 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs @@ -408,10 +408,15 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis bool? cond = ifElseStatement.Condition.IsNull ? true : builder.EvaluateCondition(ifElseStatement.Condition); if (ifElseStatement.TrueStatement.IsNull) return data; - ControlFlowNode trueBegin = builder.CreateStartNode(ifElseStatement.TrueStatement); - if (cond != false) + ControlFlowNode trueBegin; + if (ifElseStatement.TrueStatement.IsNull) { + trueBegin = null; + } else { + trueBegin = builder.CreateStartNode(ifElseStatement.TrueStatement); + } + if (cond != false && trueBegin != null) Connect(data, trueBegin, ControlFlowEdgeType.ConditionTrue); - ControlFlowNode trueEnd = ifElseStatement.TrueStatement.AcceptVisitor(this, trueBegin); + ControlFlowNode trueEnd = trueBegin != null ? ifElseStatement.TrueStatement.AcceptVisitor(this, trueBegin) : null; ControlFlowNode falseEnd; if (ifElseStatement.FalseStatement.IsNull) { falseEnd = null; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs index 5d73c90db5..c57e2b3222 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs @@ -652,20 +652,18 @@ namespace ICSharpCode.NRefactory.CSharp { AstNode result = null; AstNode node = this; - while (node.FirstChild != null) { - var child = node.FirstChild; - while (child != null) { - if (child.StartLocation <= location && location < child.EndLocation) { - if (pred == null || pred (child)) - result = child; - node = child; - break; - } - child = child.NextSibling; - } - // found no better child node - therefore the parent is the right one. - if (child == null) + while (node.LastChild != null) { + var child = node.LastChild; + while (child != null && child.StartLocation > location) + child = child.prevSibling; + if (child != null && location < child.EndLocation) { + if (pred == null || pred (child)) + result = child; + node = child; + } else { + // found no better child node - therefore the parent is the right one. break; + } } return result; } @@ -689,20 +687,18 @@ namespace ICSharpCode.NRefactory.CSharp { T result = null; AstNode node = this; - while (node.FirstChild != null) { - var child = node.FirstChild; - while (child != null) { - if (child.StartLocation <= location && location < child.EndLocation) { - if (child is T) - result = (T)child; - node = child; - break; - } - child = child.NextSibling; - } - // found no better child node - therefore the parent is the right one. - if (child == null) + while (node.LastChild != null) { + var child = node.LastChild; + while (child != null && child.StartLocation > location) + child = child.prevSibling; + if (child != null && location < child.EndLocation) { + if (child is T) + result = (T)child; + node = child; + } else { + // found no better child node - therefore the parent is the right one. break; + } } return result; } @@ -729,20 +725,18 @@ namespace ICSharpCode.NRefactory.CSharp { AstNode result = null; AstNode node = this; - while (node.FirstChild != null) { - var child = node.FirstChild; - while (child != null) { - if (child.StartLocation <= location && location <= child.EndLocation) { - if (pred == null || pred (child)) - result = child; - node = child; - break; - } - child = child.NextSibling; - } - // found no better child node - therefore the parent is the right one. - if (child == null) + while (node.LastChild != null) { + var child = node.LastChild; + while (child != null && child.StartLocation > location) + child = child.prevSibling; + if (child != null && location <= child.EndLocation) { + if (pred == null || pred (child)) + result = child; + node = child; + } else { + // found no better child node - therefore the parent is the right one. break; + } } return result; } @@ -766,20 +760,18 @@ namespace ICSharpCode.NRefactory.CSharp { T result = null; AstNode node = this; - while (node.FirstChild != null) { - var child = node.FirstChild; - while (child != null) { - if (child.StartLocation <= location && location < child.EndLocation) { - if (child is T) - result = (T)child; - node = child; - break; - } - child = child.NextSibling; - } - // found no better child node - therefore the parent is the right one. - if (child == null) + while (node.LastChild != null) { + var child = node.LastChild; + while (child != null && child.StartLocation > location) + child = child.prevSibling; + if (child != null && location <= child.EndLocation) { + if (child is T) + result = (T)child; + node = child; + } else { + // found no better child node - therefore the parent is the right one. break; + } } return result; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstType.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstType.cs index cf58d1cd3f..ef6a52a9a1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstType.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstType.cs @@ -127,6 +127,7 @@ namespace ICSharpCode.NRefactory.CSharp /// /// Create an ITypeReference for this AstType. + /// Uses the context (ancestors of this node) to determine the correct . /// /// /// The resulting type reference will read the context information from the @@ -135,7 +136,42 @@ namespace ICSharpCode.NRefactory.CSharp /// For resolving simple names, the current namespace and usings from the CurrentUsingScope /// (on CSharpTypeResolveContext only) is used. /// - public abstract ITypeReference ToTypeReference(NameLookupMode lookupMode = NameLookupMode.Type, InterningProvider interningProvider = null); + public ITypeReference ToTypeReference(InterningProvider interningProvider = null) + { + return ToTypeReference(GetNameLookupMode(), interningProvider); + } + + /// + /// Create an ITypeReference for this AstType. + /// + /// + /// The resulting type reference will read the context information from the + /// : + /// For resolving type parameters, the CurrentTypeDefinition/CurrentMember is used. + /// For resolving simple names, the current namespace and usings from the CurrentUsingScope + /// (on CSharpTypeResolveContext only) is used. + /// + public abstract ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider = null); + + /// + /// Gets the name lookup mode from the context (looking at the ancestors of this ). + /// + public NameLookupMode GetNameLookupMode() + { + AstType outermostType = this; + while (outermostType.Parent is AstType) + outermostType = (AstType)outermostType.Parent; + + if (outermostType.Parent is UsingDeclaration || outermostType.Parent is UsingAliasDeclaration) { + return NameLookupMode.TypeInUsingDeclaration; + } else if (outermostType.Role == Roles.BaseType) { + // Use BaseTypeReference for a type's base type, and for a constraint on a type. + // Do not use it for a constraint on a method. + if (outermostType.Parent is TypeDeclaration || (outermostType.Parent is Constraint && outermostType.Parent.Parent is TypeDeclaration)) + return NameLookupMode.BaseTypeReference; + } + return NameLookupMode.Type; + } /// /// Creates a pointer type from this type by nesting it in a . diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpModifierToken.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpModifierToken.cs index ac59c72460..3f38eaf3a6 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpModifierToken.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpModifierToken.cs @@ -40,13 +40,13 @@ namespace ICSharpCode.NRefactory.CSharp this.modifier = value; } } - - protected override int TokenLength { + + public override TextLocation EndLocation { get { - return GetModifierName (modifier).Length; + return new TextLocation (StartLocation.Line, StartLocation.Column + GetModifierLength (Modifier)); } } - + public override string GetText (CSharpFormattingOptions formattingOptions = null) { return GetModifierName (Modifier); @@ -75,7 +75,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return allModifiers; } } - public CSharpModifierToken (TextLocation location, Modifiers modifier) : base (location) + public CSharpModifierToken (TextLocation location, Modifiers modifier) : base (location, null) { this.Modifier = modifier; } @@ -124,5 +124,50 @@ namespace ICSharpCode.NRefactory.CSharp throw new NotSupportedException("Invalid value for Modifiers"); } } + + public static int GetModifierLength(Modifiers modifier) + { + switch (modifier) { + case Modifiers.Private: + return "private".Length; + case Modifiers.Internal: + return "internal".Length; + case Modifiers.Protected: + return "protected".Length; + case Modifiers.Public: + return "public".Length; + case Modifiers.Abstract: + return "abstract".Length; + case Modifiers.Virtual: + return "virtual".Length; + case Modifiers.Sealed: + return "sealed".Length; + case Modifiers.Static: + return "static".Length; + case Modifiers.Override: + return "override".Length; + case Modifiers.Readonly: + return "readonly".Length; + case Modifiers.Const: + return "const".Length; + case Modifiers.New: + return "new".Length; + case Modifiers.Partial: + return "partial".Length; + case Modifiers.Extern: + return "extern".Length; + case Modifiers.Volatile: + return "volatile".Length; + case Modifiers.Unsafe: + return "unsafe".Length; + case Modifiers.Async: + return "async".Length; + case Modifiers.Any: + // even though it's used for pattern matching only, 'any' needs to be in this list to be usable in the AST + return "any".Length; + default: + throw new NotSupportedException("Invalid value for Modifiers"); + } + } } } \ No newline at end of file diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpTokenNode.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpTokenNode.cs index 04910ae181..3de564d78e 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpTokenNode.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpTokenNode.cs @@ -44,7 +44,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public NullCSharpTokenNode () : base (TextLocation.Empty) + public NullCSharpTokenNode () : base (TextLocation.Empty, null) { } @@ -80,12 +80,10 @@ namespace ICSharpCode.NRefactory.CSharp return startLocation; } } - - protected virtual int TokenLength { + + int TokenLength { get { - if (!(Role is TokenRole)) - return 0; - return ((TokenRole)Role).Length; + return TokenRole.TokenLengths [(int)(this.flags >> AstNodeFlagsUsedBits)]; } } @@ -94,17 +92,17 @@ namespace ICSharpCode.NRefactory.CSharp return new TextLocation (StartLocation.Line, StartLocation.Column + TokenLength); } } - - public CSharpTokenNode (TextLocation location) + + public CSharpTokenNode (TextLocation location, TokenRole role) { this.startLocation = location; + if (role != null) + this.flags |= role.TokenIndex << AstNodeFlagsUsedBits; } public override string GetText (CSharpFormattingOptions formattingOptions = null) { - if (!(Role is TokenRole)) - return null; - return ((TokenRole)Role).Token; + return TokenRole.Tokens [(int)(this.flags >> AstNodeFlagsUsedBits)]; } public override void AcceptVisitor (IAstVisitor visitor) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ComposedType.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ComposedType.cs index ebbd64951d..859b2cbb2d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ComposedType.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ComposedType.cs @@ -47,7 +47,7 @@ namespace ICSharpCode.NRefactory.CSharp return !GetChildByRole(NullableRole).IsNull; } set { - SetChildByRole(NullableRole, value ? new CSharpTokenNode(TextLocation.Empty) : null); + SetChildByRole(NullableRole, value ? new CSharpTokenNode(TextLocation.Empty, null) : null); } } @@ -64,7 +64,7 @@ namespace ICSharpCode.NRefactory.CSharp d--; } while (d < value) { - InsertChildBefore(GetChildByRole(PointerRole), new CSharpTokenNode(TextLocation.Empty), PointerRole); + InsertChildBefore(GetChildByRole(PointerRole), new CSharpTokenNode(TextLocation.Empty, PointerRole), PointerRole); d++; } } @@ -126,7 +126,7 @@ namespace ICSharpCode.NRefactory.CSharp return this; } - public override ITypeReference ToTypeReference(NameLookupMode lookupMode = NameLookupMode.Type, InterningProvider interningProvider = null) + public override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider = null) { if (interningProvider == null) interningProvider = InterningProvider.Dummy; @@ -178,7 +178,7 @@ namespace ICSharpCode.NRefactory.CSharp d--; } while (d < value) { - InsertChildBefore(GetChildByRole(Roles.Comma), new CSharpTokenNode(TextLocation.Empty), Roles.Comma); + InsertChildBefore(GetChildByRole(Roles.Comma), new CSharpTokenNode(TextLocation.Empty, Roles.Comma), Roles.Comma); d++; } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/QueryExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/QueryExpression.cs index e5f36ae10d..737e8a5908 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/QueryExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/QueryExpression.cs @@ -118,6 +118,10 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole(PrecedingQueryRole, value); } } + public CSharpTokenNode IntoKeyword { + get { return GetChildByRole (IntoKeywordRole); } + } + public string Identifier { get { return GetChildByRole (Roles.Identifier).Name; @@ -158,6 +162,10 @@ namespace ICSharpCode.NRefactory.CSharp public static readonly TokenRole FromKeywordRole = new TokenRole ("from"); public static readonly TokenRole InKeywordRole = new TokenRole ("in"); + public CSharpTokenNode FromKeyword { + get { return GetChildByRole (FromKeywordRole); } + } + public AstType Type { get { return GetChildByRole (Roles.Type); } set { SetChildByRole (Roles.Type, value); } @@ -176,6 +184,10 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole(Roles.Identifier); } } + public CSharpTokenNode InKeyword { + get { return GetChildByRole (InKeywordRole); } + } + public Expression Expression { get { return GetChildByRole (Roles.Expression); } set { SetChildByRole (Roles.Expression, value); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Constraint.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Constraint.cs index cfd15f7afd..c49930427f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Constraint.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Constraint.cs @@ -41,7 +41,11 @@ namespace ICSharpCode.NRefactory.CSharp return NodeType.Unknown; } } - + + public CSharpTokenNode WhereKeyword { + get { return GetChildByRole (Roles.WhereKeyword); } + } + public SimpleType TypeParameter { get { return GetChildByRole (Roles.ConstraintTypeParameter); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/MemberType.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/MemberType.cs index a3ff86af1b..bb5bef6ee6 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/MemberType.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/MemberType.cs @@ -135,7 +135,7 @@ namespace ICSharpCode.NRefactory.CSharp return b.ToString(); } - public override ITypeReference ToTypeReference(NameLookupMode lookupMode = NameLookupMode.Type, InterningProvider interningProvider = null) + public override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider = null) { if (interningProvider == null) interningProvider = InterningProvider.Dummy; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/PrimitiveType.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/PrimitiveType.cs index 87df2983f8..c21df9b313 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/PrimitiveType.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/PrimitiveType.cs @@ -103,7 +103,7 @@ namespace ICSharpCode.NRefactory.CSharp return Keyword; } - public override ITypeReference ToTypeReference(NameLookupMode lookupMode = NameLookupMode.Type, InterningProvider interningProvider = null) + public override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider = null) { KnownTypeCode typeCode = GetTypeCodeForPrimitiveType(this.Keyword); if (typeCode == KnownTypeCode.None) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs index e34437b74f..5eb2832224 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs @@ -158,7 +158,7 @@ namespace ICSharpCode.NRefactory.CSharp return b.ToString(); } - public override ITypeReference ToTypeReference(NameLookupMode lookupMode = NameLookupMode.Type, InterningProvider interningProvider = null) + public override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider = null) { if (interningProvider == null) interningProvider = InterningProvider.Dummy; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TokenRole.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TokenRole.cs index 29a67ab272..8c9c7392a9 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TokenRole.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TokenRole.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace ICSharpCode.NRefactory.CSharp { @@ -7,6 +8,17 @@ namespace ICSharpCode.NRefactory.CSharp /// public sealed class TokenRole : Role { + internal readonly static List Tokens = new List (); + internal readonly static List TokenLengths = new List (); + internal readonly uint TokenIndex; + + static TokenRole () + { + // null token + Tokens.Add (""); + TokenLengths.Add (0); + } + /// /// Gets the token as string. Note that the token Name and Token value may differ. /// @@ -22,11 +34,27 @@ namespace ICSharpCode.NRefactory.CSharp get; private set; } - - public TokenRole (string token) : base (token, CSharpTokenNode.Null) + + + public TokenRole(string token) : base (token, CSharpTokenNode.Null) { this.Token = token; this.Length = token.Length; + + bool found = false; + for (int i = 0; i < Tokens.Count; i++) { + var existingToken = Tokens [i]; + if (existingToken == token) { + TokenIndex = (uint)i; + found = true; + break; + } + } + if (!found) { + TokenIndex = (uint)Tokens.Count; + Tokens.Add (token); + TokenLengths.Add (this.Length); + } } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EventDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EventDeclaration.cs index 8c1958cf82..7e338af2cc 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EventDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EventDeclaration.cs @@ -24,7 +24,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +using System; using System.Collections.Generic; +using System.ComponentModel; + using ICSharpCode.NRefactory.TypeSystem; namespace ICSharpCode.NRefactory.CSharp @@ -41,6 +44,20 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (Roles.Variable); } } + // Hide .Name and .NameToken from users; the actual field names + // are stored in the VariableInitializer. + [EditorBrowsable(EditorBrowsableState.Never)] + public override string Name { + get { return string.Empty; } + set { throw new NotSupportedException(); } + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public override Identifier NameToken { + get { return Identifier.Null; } + set { throw new NotSupportedException(); } + } + public override void AcceptVisitor (IAstVisitor visitor) { visitor.VisitEventDeclaration (this); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FieldDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FieldDeclaration.cs index 16406d59d0..d9af2f374f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FieldDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FieldDeclaration.cs @@ -24,6 +24,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +using System; +using System.ComponentModel; using ICSharpCode.NRefactory.TypeSystem; namespace ICSharpCode.NRefactory.CSharp @@ -38,6 +40,20 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (Roles.Variable); } } + // Hide .Name and .NameToken from users; the actual field names + // are stored in the VariableInitializer. + [EditorBrowsable(EditorBrowsableState.Never)] + public override string Name { + get { return string.Empty; } + set { throw new NotSupportedException(); } + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public override Identifier NameToken { + get { return Identifier.Null; } + set { throw new NotSupportedException(); } + } + public override void AcceptVisitor (IAstVisitor visitor) { visitor.VisitFieldDeclaration (this); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/IndexerDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/IndexerDeclaration.cs index 02bc126aec..d82001920f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/IndexerDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/IndexerDeclaration.cs @@ -25,6 +25,7 @@ // THE SOFTWARE. using System; +using System.ComponentModel; using ICSharpCode.NRefactory.TypeSystem; namespace ICSharpCode.NRefactory.CSharp @@ -53,6 +54,7 @@ namespace ICSharpCode.NRefactory.CSharp set { throw new NotSupportedException(); } } + [EditorBrowsable(EditorBrowsableState.Never)] public override Identifier NameToken { get { return Identifier.Null; } set { throw new NotSupportedException(); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/OperatorDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/OperatorDeclaration.cs index 8e09673577..f0a07e84d1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/OperatorDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/OperatorDeclaration.cs @@ -25,6 +25,7 @@ // THE SOFTWARE. using System; +using System.ComponentModel; using ICSharpCode.NRefactory.TypeSystem; namespace ICSharpCode.NRefactory.CSharp @@ -250,6 +251,7 @@ namespace ICSharpCode.NRefactory.CSharp set { throw new NotSupportedException(); } } + [EditorBrowsable(EditorBrowsableState.Never)] public override Identifier NameToken { get { return Identifier.Null; } set { throw new NotSupportedException(); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs index f0a8025afc..977c9b7065 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs @@ -198,6 +198,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion } } var resolveResult = ResolveExpression(expr); + if (resolveResult == null) { return null; } @@ -262,10 +263,20 @@ namespace ICSharpCode.NRefactory.CSharp.Completion return contextList.Result; } - foreach (var m in initializerResult.Item1.Type.GetMembers (m => m.IsPublic && (m.EntityType == EntityType.Property || m.EntityType == EntityType.Field))) { - contextList.AddMember(m); + var lookup = new MemberLookup(ctx.CurrentTypeDefinition, Compilation.MainAssembly); + bool isProtectedAllowed = ctx.CurrentTypeDefinition != null ? + ctx.CurrentTypeDefinition.IsDerivedFrom(initializerResult.Item1.Type.GetDefinition()) : + false; + + foreach (var m in initializerResult.Item1.Type.GetMembers (m => m.EntityType == EntityType.Field)) { + if (lookup.IsAccessible (m, isProtectedAllowed)) + contextList.AddMember(m); } - + foreach (IProperty m in initializerResult.Item1.Type.GetMembers (m => m.EntityType == EntityType.Property)) { + if (m.CanSet && lookup.IsAccessible (m.Setter, isProtectedAllowed)) + contextList.AddMember(m); + } + if (prev != null && (prev is NamedExpression)) { // case 2) return contextList.Result; @@ -656,19 +667,11 @@ namespace ICSharpCode.NRefactory.CSharp.Completion return HandleCatchClauseType(identifierStart); } } - if (!(char.IsLetter(completionChar) || completionChar == '_') && (!controlSpace || identifierStart == null || !(identifierStart.Node.Parent is ArrayInitializerExpression))) { + if (!(char.IsLetter(completionChar) || completionChar == '_') && (!controlSpace || identifierStart == null)) { return controlSpace ? HandleAccessorContext() ?? DefaultControlSpaceItems(identifierStart) : null; } - char prevCh = offset > 2 ? document.GetCharAt(offset - 2) : ';'; - char nextCh = offset < document.TextLength ? document.GetCharAt(offset) : ' '; - const string allowedChars = ";,.[](){}+-*/%^?:&|~!<>="; - if (!Char.IsWhiteSpace(nextCh) && allowedChars.IndexOf(nextCh) < 0) { - return null; - } - if (!(Char.IsWhiteSpace(prevCh) || allowedChars.IndexOf(prevCh) >= 0)) { - return null; - } + // Do not pop up completion on identifier identifier (should be handled by keyword completion). tokenIndex = offset - 1; token = GetPreviousToken(ref tokenIndex, false); @@ -680,6 +683,16 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (keywordresult != null) { return keywordresult; } + + char prevCh = offset > 2 ? document.GetCharAt(offset - 2) : ';'; + char nextCh = offset < document.TextLength ? document.GetCharAt(offset) : ' '; + const string allowedChars = ";,.[](){}+-*/%^?:&|~!<>="; + + if ((!Char.IsWhiteSpace(nextCh) && allowedChars.IndexOf(nextCh) < 0) || !(Char.IsWhiteSpace(prevCh) || allowedChars.IndexOf(prevCh) >= 0)) { + if (controlSpace) + return DefaultControlSpaceItems(identifierStart); + return null; + } int prevTokenIndex = tokenIndex; var prevToken2 = GetPreviousToken(ref prevTokenIndex, false); @@ -1058,7 +1071,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion node = node.Parent; } var contextList = new CompletionDataWrapper(this); - if (node is PropertyDeclaration) { + if (node is PropertyDeclaration || node is IndexerDeclaration) { contextList.AddCustom("get"); contextList.AddCustom("set"); AddKeywords(contextList, accessorModifierKeywords); @@ -1098,10 +1111,13 @@ namespace ICSharpCode.NRefactory.CSharp.Completion node = unit.GetNodeAt( location.Line, location.Column + 2, - n => n is Expression || n is AstType + n => n is Expression || n is AstType || n is NamespaceDeclaration ); rr = ResolveExpression(node); } + // namespace name case + if (node is NamespaceDeclaration) + return null; if (node is Identifier && node.Parent is ForeachStatement) { var foreachStmt = (ForeachStatement)node.Parent; foreach (var possibleName in GenerateNameProposals (foreachStmt.VariableType)) { @@ -1308,26 +1324,25 @@ namespace ICSharpCode.NRefactory.CSharp.Completion } return false; } - + void AddTypesAndNamespaces(CompletionDataWrapper wrapper, CSharpResolver state, AstNode node, Func typePred = null, Predicate memberPred = null, Action callback = null) { var lookup = new MemberLookup(ctx.CurrentTypeDefinition, Compilation.MainAssembly); + if (currentType != null) { for (var ct = ctx.CurrentTypeDefinition; ct != null; ct = ct.DeclaringTypeDefinition) { - foreach (var nestedType in ct.NestedTypes) { - string name = nestedType.Name; - if (IsAttributeContext(node) && name.EndsWith("Attribute") && name.Length > "Attribute".Length) { - name = name.Substring(0, name.Length - "Attribute".Length); - } + foreach (var nestedType in ct.GetNestedTypes ()) { + if (!lookup.IsAccessible (nestedType.GetDefinition (), true)) + continue; if (typePred == null) { - wrapper.AddType(nestedType, name); + wrapper.AddType(nestedType, false, IsAttributeContext(node)); continue; } var type = typePred(nestedType); if (type != null) { - var a2 = wrapper.AddType(type, name); + var a2 = wrapper.AddType(type, false, IsAttributeContext(node)); if (a2 != null && callback != null) { callback(a2, type); } @@ -1354,7 +1369,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (!lookup.IsAccessible(member, isProtectedAllowed)) { continue; } - + if (memberPred == null || memberPred(member)) { wrapper.AddMember(member); } @@ -1389,11 +1404,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion IType addType = typePred != null ? typePred(type) : type; if (addType != null) { - string name = type.Name; - if (IsAttributeContext(node) && name.EndsWith("Attribute") && name.Length > "Attribute".Length) { - name = name.Substring(0, name.Length - "Attribute".Length); - } - var a = wrapper.AddType(addType, name); + var a = wrapper.AddType(addType, false, IsAttributeContext(node)); if (a != null && callback != null) { callback(a, type); } @@ -1406,7 +1417,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion continue; IType addType = typePred != null ? typePred(type) : type; if (addType != null) { - var a2 = wrapper.AddType(addType, addType.Name); + var a2 = wrapper.AddType(addType, false); if (a2 != null && callback != null) { callback(a2, type); } @@ -1770,7 +1781,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion new [] { hintType } ); if (inferedType != SpecialType.UnknownType) { - var newType = wrapper.AddType(inferedType, amb.ConvertType(inferedType)); + var newType = wrapper.AddType(inferedType, true); if (newType != null) { newType.CompletionCategory = inferredTypesCategory; } @@ -1779,8 +1790,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion return t; }; if (!(hintType.Kind == TypeKind.Interface && hintType.Kind != TypeKind.Array)) { - DefaultCompletionString = GetShortType(hintType, GetState()); - var hint = wrapper.AddType(hintType, DefaultCompletionString); + var hint = wrapper.AddType(hintType, true); + DefaultCompletionString = hint.DisplayText; if (hint != null) { hint.CompletionCategory = derivedTypesCategory; } @@ -1789,11 +1800,11 @@ namespace ICSharpCode.NRefactory.CSharp.Completion var arg = ((ParameterizedType)hintType).TypeArguments.FirstOrDefault(); if (arg.Kind != TypeKind.TypeParameter) { var array = new ArrayType (ctx.Compilation, arg, 1); - wrapper.AddType(array, amb.ConvertType(array)); + wrapper.AddType(array, true); } } } else { - var hint = wrapper.AddType(hintType, DefaultCompletionString); + var hint = wrapper.AddType(hintType, true); if (hint != null) { DefaultCompletionString = hint.DisplayText; hint.CompletionCategory = derivedTypesCategory; @@ -2159,15 +2170,18 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (resolveResult is NamespaceResolveResult) { var nr = (NamespaceResolveResult)resolveResult; if (!(resolvedNode.Parent is UsingDeclaration || resolvedNode.Parent != null && resolvedNode.Parent.Parent is UsingDeclaration)) { + var lookup = new MemberLookup( + ctx.CurrentTypeDefinition, + Compilation.MainAssembly + ); + foreach (var cl in nr.Namespace.Types) { - string name = cl.Name; if (hintType != null && hintType.Kind != TypeKind.Array && cl.Kind == TypeKind.Interface) { continue; } - if (IsAttributeContext(resolvedNode) && name.EndsWith("Attribute") && name.Length > "Attribute".Length) { - name = name.Substring(0, name.Length - "Attribute".Length); - } - result.AddType(cl, name); + if (!lookup.IsAccessible (cl, false)) + continue; + result.AddType(cl, false, IsAttributeContext(resolvedNode)); } } foreach (var ns in nr.Namespace.ChildNamespaces) { @@ -2179,7 +2193,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (hintType != null && hintType.Kind != TypeKind.Array && nested.Kind == TypeKind.Interface) { continue; } - result.AddType(nested, nested.Name); + result.AddType(nested, false); } } return result.Result; @@ -2188,7 +2202,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion IEnumerable CreateTypeList() { foreach (var cl in Compilation.RootNamespace.Types) { - yield return factory.CreateTypeCompletionData(cl, cl.Name); + yield return factory.CreateTypeCompletionData(cl, false, false); } foreach (var ns in Compilation.RootNamespace.ChildNamespaces) { @@ -2258,33 +2272,14 @@ namespace ICSharpCode.NRefactory.CSharp.Completion // } return result.Result; } - - string GetShortType(IType type, CSharpResolver state) - { - var builder = new TypeSystemAstBuilder(state); - var dt = state.CurrentTypeDefinition; - var declaring = type.DeclaringType != null ? type.DeclaringType.GetDefinition() : null; - if (declaring != null) { - while (dt != null) { - if (dt.Equals(declaring)) { - builder.AlwaysUseShortTypeNames = true; - break; - } - dt = dt.DeclaringTypeDefinition; - } - } - var shortType = builder.ConvertType(type); - return shortType.GetText(FormattingPolicy); - } - + void AddEnumMembers(CompletionDataWrapper completionList, IType resolvedType, CSharpResolver state) { if (resolvedType.Kind != TypeKind.Enum) { return; } - string typeString = GetShortType(resolvedType, state); - completionList.AddEnumMembers(resolvedType, state, typeString); - DefaultCompletionString = typeString; + completionList.AddEnumMembers(resolvedType, state); + DefaultCompletionString = resolvedType.Name; } IEnumerable CreateCompletionData(TextLocation location, ResolveResult resolveResult, AstNode resolvedNode, CSharpResolver state, Func typePred = null) @@ -2292,7 +2287,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (resolveResult == null /*|| resolveResult.IsError*/) { return null; } - + var lookup = new MemberLookup( ctx.CurrentTypeDefinition, Compilation.MainAssembly @@ -2307,7 +2302,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion continue; IType addType = typePred != null ? typePred(cl) : cl; if (addType != null) - namespaceContents.AddType(addType, addType.Name); + namespaceContents.AddType(addType, false); } foreach (var ns in nr.Namespace.ChildNamespaces) { @@ -2357,7 +2352,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (trr.Type.Kind == TypeKind.Enum) { foreach (var field in trr.Type.GetFields ()) { - result.AddMember(field); + if (lookup.IsAccessible (field, false)) + result.AddMember(field); } return result.Result; } @@ -2406,23 +2402,28 @@ namespace ICSharpCode.NRefactory.CSharp.Completion result.AddMember(member); }*/ foreach (var member in lookup.GetAccessibleMembers (resolveResult)) { - if (member.EntityType == EntityType.Indexer || member.EntityType == EntityType.Operator || member.EntityType == EntityType.Constructor || member.EntityType == EntityType.Destructor) { continue; } if (resolvedNode is BaseReferenceExpression && member.IsAbstract) { continue; } + if (member is IType) { + if (resolveResult is TypeResolveResult || includeStaticMembers) { + result.AddType ((IType)member, false); + continue; + } + } bool memberIsStatic = member.IsStatic; if (!includeStaticMembers && memberIsStatic && !(resolveResult is TypeResolveResult)) { // Console.WriteLine ("skip static member: " + member.FullName); continue; } + var field = member as IField; if (field != null) { memberIsStatic |= field.IsConst; } - if (!memberIsStatic && skipNonStaticMembers) { continue; } @@ -2436,23 +2437,11 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (member is IMember) { result.AddMember ((IMember)member); - } else { - if (resolveResult is TypeResolveResult || includeStaticMembers) - result.AddType ((IType)member, member.Name); } } } - - if (resolveResult is TypeResolveResult || includeStaticMembers) { - foreach (var nested in type.GetNestedTypes ()) { - if (!lookup.IsAccessible(nested.GetDefinition(), isProtectedAllowed)) - continue; - IType addType = typePred != null ? typePred(nested) : nested; - if (addType != null) - result.AddType(addType, addType.Name); - } - - } else { + + if (!(resolveResult is TypeResolveResult || includeStaticMembers)) { foreach (var meths in state.GetExtensionMethods (type)) { foreach (var m in meths) { if (!lookup.IsAccessible(m, isProtectedAllowed)) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngineBase.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngineBase.cs index b938064dc9..c0da6aebb1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngineBase.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngineBase.cs @@ -200,6 +200,12 @@ namespace ICSharpCode.NRefactory.CSharp.Completion } parameter.Push (0); break; + case '=': + if (nextCh == '>') { + i++; + continue; + } + break; case '>': if (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment) { break; @@ -705,7 +711,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion { SyntaxTree baseUnit; baseUnit = ParseStub("a", false); - + var section = baseUnit.GetNodeAt(location.Line, location.Column - 2); var attr = section != null ? section.Attributes.LastOrDefault() : null; if (attr != null) { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpParameterCompletionEngine.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpParameterCompletionEngine.cs index bf61e27f7b..f527b0b605 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpParameterCompletionEngine.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpParameterCompletionEngine.cs @@ -224,6 +224,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion } if (GetCurrentParameterIndex(document.GetOffset(invoke.Node.StartLocation), offset) < 0) return null; + if (invoke.Node is ArrayCreateExpression) + return null; if (invoke.Node is ObjectCreateExpression) { var createType = ResolveExpression(((ObjectCreateExpression)invoke.Node).Type); return factory.CreateConstructorProvider(document.GetOffset(invoke.Node.StartLocation), createType.Item1.Type); @@ -276,6 +278,9 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (invoke == null) { return null; } + if (invoke.Node is ArrayCreateExpression) { + return null; + } var indexerExpression = ResolveExpression(invoke); if (indexerExpression == null || indexerExpression.Item1 == null || indexerExpression.Item1.IsError) { return null; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CompletionDataWrapper.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CompletionDataWrapper.cs index 38d7f84a89..e906eb6259 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CompletionDataWrapper.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CompletionDataWrapper.cs @@ -82,25 +82,27 @@ namespace ICSharpCode.NRefactory.CSharp.Completion Dictionary usedTypes = new Dictionary (); - public ICompletionData AddType(IType type, string shortType) + public ICompletionData AddType(IType type, bool showFullName, bool isInAttributeContext = false) { - if (type == null || string.IsNullOrEmpty(shortType)) - return null; - if (type.Name == "Void" && type.Namespace == "System") + if (type == null) + throw new ArgumentNullException("type"); + if (type.Name == "Void" && type.Namespace == "System" || type.Kind == TypeKind.Unknown) return null; var def = type.GetDefinition(); if (def != null && def.ParentAssembly != completion.ctx.CurrentAssembly && !def.IsBrowsable()) return null; ICompletionData usedType; - if (usedTypes.TryGetValue (shortType, out usedType)) { - usedType.AddOverload (Factory.CreateTypeCompletionData(type, shortType)); + var data = Factory.CreateTypeCompletionData(type, showFullName, isInAttributeContext); + var text = data.DisplayText; + + if (usedTypes.TryGetValue(text, out usedType)) { + usedType.AddOverload(data); return usedType; } - var iCompletionData = Factory.CreateTypeCompletionData(type, shortType); - usedTypes[shortType] = iCompletionData; - result.Add(iCompletionData); - return iCompletionData; + usedTypes [text] = data; + result.Add(data); + return data; } Dictionary> data = new Dictionary> (); @@ -214,21 +216,15 @@ namespace ICSharpCode.NRefactory.CSharp.Completion } } HashSet addedEnums = new HashSet (); - public void AddEnumMembers (IType resolvedType, CSharpResolver state, string typeString) + public void AddEnumMembers (IType resolvedType, CSharpResolver state) { if (addedEnums.Contains (resolvedType)) return; addedEnums.Add (resolvedType); - if (typeString.Contains(".")) { - AddType(resolvedType, typeString); - } + AddType(resolvedType, true); foreach (var field in resolvedType.GetFields ()) { if (field.IsPublic && (field.IsConst || field.IsStatic)) { - Result.Add(Factory.CreateEntityCompletionData( - field, - typeString + "." + field.Name - ) - ); + Result.Add(Factory.CreateMemberCompletionData(resolvedType, field)); } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/ICompletionDataFactory.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/ICompletionDataFactory.cs index e1c6a5a40c..29cdcedb67 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/ICompletionDataFactory.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/ICompletionDataFactory.cs @@ -35,7 +35,14 @@ namespace ICSharpCode.NRefactory.CSharp.Completion ICompletionData CreateEntityCompletionData (IEntity entity); ICompletionData CreateEntityCompletionData (IEntity entity, string text); - ICompletionData CreateTypeCompletionData (IType type, string shortType); + ICompletionData CreateTypeCompletionData (IType type, bool showFullName, bool isInAttributeContext); + + /// + /// Creates the member completion data. + /// Form: Type.Member + /// Used for generating enum members Foo.A, Foo.B where the enum 'Foo' is valid. + /// + ICompletionData CreateMemberCompletionData(IType type, IEntity member); /// /// Creates a generic completion data. diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj index d1517435ec..d0dde5fa32 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj @@ -324,7 +324,6 @@ - @@ -338,6 +337,7 @@ + @@ -503,6 +503,8 @@ + + @@ -534,4 +536,4 @@ - \ No newline at end of file + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs index 665e15e71a..db8335f686 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs @@ -1057,6 +1057,12 @@ namespace ICSharpCode.NRefactory.CSharp } return; } + if (f == 0 && 1 / f == float.NegativeInfinity) { + // negative zero is a special case + // (again, not a primitive expression, but it's better to handle + // the special case here than to do it in all code generators) + formatter.WriteToken("-"); + } formatter.WriteToken(f.ToString("R", NumberFormatInfo.InvariantInfo) + "f"); lastWritten = LastWritten.Other; } else if (val is double) { @@ -1075,6 +1081,12 @@ namespace ICSharpCode.NRefactory.CSharp } return; } + if (f == 0 && 1 / f == double.NegativeInfinity) { + // negative zero is a special case + // (again, not a primitive expression, but it's better to handle + // the special case here than to do it in all code generators) + formatter.WriteToken("-"); + } string number = f.ToString("R", NumberFormatInfo.InvariantInfo); if (number.IndexOf('.') < 0 && number.IndexOf('E') < 0) { number += ".0"; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs index 2ac9f86e4f..0e7db3fee5 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs @@ -83,11 +83,11 @@ namespace ICSharpCode.NRefactory.CSharp if (nspace.NS != null && !string.IsNullOrEmpty(nspace.NS.Name)) { nDecl = new NamespaceDeclaration (); if (loc != null) { - nDecl.AddChild(new CSharpTokenNode (Convert(loc [0])), Roles.NamespaceKeyword); + nDecl.AddChild(new CSharpTokenNode (Convert(loc [0]), Roles.NamespaceKeyword), Roles.NamespaceKeyword); } ConvertNamespaceName(nspace.RealMemberName, nDecl); if (loc != null && loc.Count > 1) { - nDecl.AddChild(new CSharpTokenNode (Convert(loc [1])), Roles.LBrace); + nDecl.AddChild(new CSharpTokenNode (Convert(loc [1]), Roles.LBrace), Roles.LBrace); } AddToNamespace(nDecl); namespaceStack.Push(nDecl); @@ -112,9 +112,9 @@ namespace ICSharpCode.NRefactory.CSharp if (nDecl != null) { AddAttributeSection (nDecl, nspace.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole); if (loc != null && loc.Count > 2) - nDecl.AddChild (new CSharpTokenNode (Convert (loc [2])), Roles.RBrace); + nDecl.AddChild (new CSharpTokenNode (Convert (loc [2]), Roles.RBrace), Roles.RBrace); if (loc != null && loc.Count > 3) - nDecl.AddChild (new CSharpTokenNode (Convert (loc [3])), Roles.Semicolon); + nDecl.AddChild (new CSharpTokenNode (Convert (loc [3]), Roles.Semicolon), Roles.Semicolon); namespaceStack.Pop (); } else { @@ -133,15 +133,15 @@ namespace ICSharpCode.NRefactory.CSharp return; var loc = LocationsBag.GetLocations (texpr.TypeArguments); if (loc != null && loc.Count >= 2) - result.AddChild (new CSharpTokenNode (Convert (loc [loc.Count - 2])), Roles.LChevron); + result.AddChild (new CSharpTokenNode (Convert (loc [loc.Count - 2]), Roles.LChevron), Roles.LChevron); int i = 0; foreach (var arg in texpr.TypeArguments.Args) { result.AddChild (ConvertToType (arg), Roles.TypeArgument); if (loc != null && i < loc.Count - 2) - result.AddChild (new CSharpTokenNode (Convert (loc [i++])), Roles.Comma); + result.AddChild (new CSharpTokenNode (Convert (loc [i++]), Roles.Comma), Roles.Comma); } if (loc != null && loc.Count >= 2) - result.AddChild (new CSharpTokenNode (Convert (loc [loc.Count - 1])), Roles.RChevron); + result.AddChild (new CSharpTokenNode (Convert (loc [loc.Count - 1]), Roles.RChevron), Roles.RChevron); } AstType ConvertToType (TypeParameter spec) @@ -159,7 +159,7 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild (ConvertToType (memberName.Left), MemberType.TargetRole); var loc = LocationsBag.GetLocations (memberName.Left); if (loc != null) - result.AddChild (new CSharpTokenNode (Convert (loc [0])), Roles.Dot); + result.AddChild (new CSharpTokenNode (Convert (loc [0]), Roles.Dot), Roles.Dot); result.AddChild (Identifier.Create (memberName.Name, Convert (memberName.Location)), Roles.Identifier); } else { result = new SimpleType () { IdentifierToken = Identifier.Create (memberName.Name, Convert (memberName.Location)) }; @@ -167,15 +167,15 @@ namespace ICSharpCode.NRefactory.CSharp if (memberName.TypeParameters != null) { var chevronLocs = LocationsBag.GetLocations (memberName.TypeParameters); if (chevronLocs != null) - result.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 2])), Roles.LChevron); + result.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron); for (int i = 0; i < memberName.TypeParameters.Count; i++) { var param = memberName.TypeParameters [i]; result.AddChild (new SimpleType (Identifier.Create (param.Name, Convert (param.Location))), Roles.TypeArgument); if (chevronLocs != null && i < chevronLocs.Count - 2) - result.AddChild (new CSharpTokenNode (Convert (chevronLocs [i])), Roles.Comma); + result.AddChild (new CSharpTokenNode (Convert (chevronLocs [i]), Roles.Comma), Roles.Comma); } if (chevronLocs != null) - result.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 1])), Roles.RChevron); + result.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron); } return result; } @@ -204,7 +204,7 @@ namespace ICSharpCode.NRefactory.CSharp var memberType = new MemberType (); memberType.AddChild (ConvertToType (ma.LeftExpression), MemberType.TargetRole); - memberType.AddChild (new CSharpTokenNode (Convert (ma.DotLocation)), Roles.Dot); + memberType.AddChild (new CSharpTokenNode (Convert (ma.DotLocation), Roles.Dot), Roles.Dot); memberType.MemberNameToken = Identifier.Create (ma.Name, Convert (ma.Location)); @@ -226,15 +226,15 @@ namespace ICSharpCode.NRefactory.CSharp var ccSpec = cc.Spec; while (ccSpec != null) { if (ccSpec.IsNullable) { - result.AddChild (new CSharpTokenNode (Convert (ccSpec.Location)), ComposedType.NullableRole); + result.AddChild (new CSharpTokenNode (Convert (ccSpec.Location), ComposedType.NullableRole), ComposedType.NullableRole); } else if (ccSpec.IsPointer) { - result.AddChild (new CSharpTokenNode (Convert (ccSpec.Location)), ComposedType.PointerRole); + result.AddChild (new CSharpTokenNode (Convert (ccSpec.Location), ComposedType.PointerRole), ComposedType.PointerRole); } else { var location = LocationsBag.GetLocations (ccSpec); var spec = new ArraySpecifier () { Dimensions = ccSpec.Dimension }; - spec.AddChild (new CSharpTokenNode (Convert (ccSpec.Location)), Roles.LBracket); + spec.AddChild (new CSharpTokenNode (Convert (ccSpec.Location), Roles.LBracket), Roles.LBracket); if (location != null) - spec.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.RBracket); + spec.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.RBracket), Roles.RBracket); result.ArraySpecifiers.Add (spec); } @@ -268,7 +268,7 @@ namespace ICSharpCode.NRefactory.CSharp result.HasArgumentList = loc != null; int pos = 0; if (loc != null) - result.AddChild (new CSharpTokenNode (Convert (loc [pos++])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), Roles.LPar), Roles.LPar); if (attr.PositionalArguments != null) { foreach (var arg in attr.PositionalArguments) { @@ -279,7 +279,7 @@ namespace ICSharpCode.NRefactory.CSharp var argLoc = LocationsBag.GetLocations (na); if (argLoc != null) - newArg.AddChild (new CSharpTokenNode (Convert (argLoc [0])), Roles.Colon); + newArg.AddChild (new CSharpTokenNode (Convert (argLoc [0]), Roles.Colon), Roles.Colon); if (na.Expr != null) newArg.AddChild ((Expression)na.Expr.Accept (this), Roles.Expression); result.AddChild (newArg, Roles.Argument); @@ -288,7 +288,7 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild ((Expression)arg.Expr.Accept (this), Roles.Argument); } if (loc != null && pos + 1 < loc.Count) - result.AddChild (new CSharpTokenNode (Convert (loc [pos++])), Roles.Comma); + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), Roles.Comma), Roles.Comma); } } if (attr.NamedArguments != null) { @@ -298,16 +298,16 @@ namespace ICSharpCode.NRefactory.CSharp var argLoc = LocationsBag.GetLocations (na); if (argLoc != null) - newArg.AddChild (new CSharpTokenNode (Convert (argLoc [0])), Roles.Assign); + newArg.AddChild (new CSharpTokenNode (Convert (argLoc [0]), Roles.Assign), Roles.Assign); if (na.Expr != null) newArg.AddChild ((Expression)na.Expr.Accept (this), Roles.Expression); result.AddChild (newArg, Roles.Argument); if (loc != null && pos + 1 < loc.Count) - result.AddChild (new CSharpTokenNode (Convert (loc [pos++])), Roles.Comma); + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), Roles.Comma), Roles.Comma); } } if (loc != null && pos < loc.Count) - result.AddChild (new CSharpTokenNode (Convert (loc [pos++])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), Roles.RPar), Roles.RPar); yield return result; } @@ -321,7 +321,7 @@ namespace ICSharpCode.NRefactory.CSharp var loc = LocationsBag.GetLocations (optAttributes); int pos = 0; if (loc != null) - result.AddChild (new CSharpTokenNode (Convert (loc [pos++])), Roles.LBracket); + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), Roles.LBracket), Roles.LBracket); var first = optAttributes.FirstOrDefault (); string target = first != null ? first.ExplicitTarget : null; @@ -333,7 +333,7 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild (Identifier.Create (target), Roles.Identifier); } if (loc != null && pos < loc.Count) - result.AddChild (new CSharpTokenNode (Convert (loc [pos++])), Roles.Colon); + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), Roles.Colon), Roles.Colon); } int attributeCount = 0; @@ -345,9 +345,9 @@ namespace ICSharpCode.NRefactory.CSharp int locCount = 2 + attributeCount - 1; // optional comma if (loc != null && pos < loc.Count - 1 && loc.Count == locCount + 1) - result.AddChild (new CSharpTokenNode (Convert (loc [pos++])), Roles.Comma); + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), Roles.Comma), Roles.Comma); if (loc != null && pos < loc.Count) - result.AddChild (new CSharpTokenNode (Convert (loc [pos++])), Roles.RBracket); + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), Roles.RBracket), Roles.RBracket); return result; } @@ -359,11 +359,11 @@ namespace ICSharpCode.NRefactory.CSharp if (nspace.NS != null && !string.IsNullOrEmpty(nspace.NS.Name)) { nDecl = new NamespaceDeclaration (); if (loc != null) { - nDecl.AddChild(new CSharpTokenNode (Convert(loc [0])), Roles.NamespaceKeyword); + nDecl.AddChild(new CSharpTokenNode (Convert(loc [0]), Roles.NamespaceKeyword), Roles.NamespaceKeyword); } ConvertNamespaceName(nspace.RealMemberName, nDecl); if (loc != null && loc.Count > 1) { - nDecl.AddChild(new CSharpTokenNode (Convert(loc [1])), Roles.LBrace); + nDecl.AddChild(new CSharpTokenNode (Convert(loc [1]), Roles.LBrace), Roles.LBrace); } AddToNamespace(nDecl); namespaceStack.Push(nDecl); @@ -384,9 +384,9 @@ namespace ICSharpCode.NRefactory.CSharp if (nDecl != null) { AddAttributeSection(nDecl, nspace.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole); if (loc != null && loc.Count > 2) - nDecl.AddChild (new CSharpTokenNode (Convert (loc [2])), Roles.RBrace); + nDecl.AddChild (new CSharpTokenNode (Convert (loc [2]), Roles.RBrace), Roles.RBrace); if (loc != null && loc.Count > 3) - nDecl.AddChild (new CSharpTokenNode (Convert (loc [3])), Roles.Semicolon); + nDecl.AddChild (new CSharpTokenNode (Convert (loc [3]), Roles.Semicolon), Roles.Semicolon); namespaceStack.Pop (); } @@ -409,7 +409,7 @@ namespace ICSharpCode.NRefactory.CSharp insertPos = newIdent; if (!memberName.DotLocation.IsNull) { - var dotToken = new CSharpTokenNode (Convert (memberName.DotLocation)); + var dotToken = new CSharpTokenNode (Convert (memberName.DotLocation), Roles.Dot); namespaceDecl.InsertChildBefore (insertPos, dotToken, Roles.Dot); insertPos = dotToken; } @@ -422,11 +422,11 @@ namespace ICSharpCode.NRefactory.CSharp { var ud = new UsingDeclaration (); var loc = LocationsBag.GetLocations (un); - ud.AddChild (new CSharpTokenNode (Convert (un.Location)), UsingDeclaration.UsingKeywordRole); + ud.AddChild (new CSharpTokenNode (Convert (un.Location), UsingDeclaration.UsingKeywordRole), UsingDeclaration.UsingKeywordRole); if (un.NamespaceExpression != null) ud.AddChild (ConvertToType (un.NamespaceExpression), UsingDeclaration.ImportRole); if (loc != null) - ud.AddChild (new CSharpTokenNode (Convert (loc [0])), Roles.Semicolon); + ud.AddChild (new CSharpTokenNode (Convert (loc [0]), Roles.Semicolon), Roles.Semicolon); AddToNamespace (ud); } @@ -435,14 +435,14 @@ namespace ICSharpCode.NRefactory.CSharp var ud = new UsingAliasDeclaration (); var loc = LocationsBag.GetLocations (uan); - ud.AddChild (new CSharpTokenNode (Convert (uan.Location)), UsingAliasDeclaration.UsingKeywordRole); + ud.AddChild (new CSharpTokenNode (Convert (uan.Location), UsingAliasDeclaration.UsingKeywordRole), UsingAliasDeclaration.UsingKeywordRole); ud.AddChild (Identifier.Create (uan.Alias.Value, Convert (uan.Alias.Location)), UsingAliasDeclaration.AliasRole); if (loc != null) - ud.AddChild (new CSharpTokenNode (Convert (loc [0])), Roles.Assign); + ud.AddChild (new CSharpTokenNode (Convert (loc [0]), Roles.Assign), Roles.Assign); if (uan.NamespaceExpression != null) ud.AddChild (ConvertToType (uan.NamespaceExpression), UsingAliasDeclaration.ImportRole); if (loc != null && loc.Count > 1) - ud.AddChild (new CSharpTokenNode (Convert (loc [1])), Roles.Semicolon); + ud.AddChild (new CSharpTokenNode (Convert (loc [1]), Roles.Semicolon), Roles.Semicolon); AddToNamespace (ud); } @@ -450,12 +450,12 @@ namespace ICSharpCode.NRefactory.CSharp { var ud = new ExternAliasDeclaration (); var loc = LocationsBag.GetLocations (uea); - ud.AddChild (new CSharpTokenNode (Convert (uea.Location)), Roles.ExternKeyword); + ud.AddChild (new CSharpTokenNode (Convert (uea.Location), Roles.ExternKeyword), Roles.ExternKeyword); if (loc != null) - ud.AddChild (new CSharpTokenNode (Convert (loc [0])), Roles.AliasKeyword); + ud.AddChild (new CSharpTokenNode (Convert (loc [0]), Roles.AliasKeyword), Roles.AliasKeyword); ud.AddChild (Identifier.Create (uea.Alias.Value, Convert (uea.Alias.Location)), Roles.Identifier); if (loc != null && loc.Count > 1) - ud.AddChild (new CSharpTokenNode (Convert (loc [1])), Roles.Semicolon); + ud.AddChild (new CSharpTokenNode (Convert (loc [1]), Roles.Semicolon), Roles.Semicolon); AddToNamespace (ud); } @@ -468,7 +468,7 @@ namespace ICSharpCode.NRefactory.CSharp t.AddChild (ConvertImport (memberName.Left), MemberType.TargetRole); if (!memberName.DotLocation.IsNull) - t.AddChild (new CSharpTokenNode (Convert (memberName.DotLocation)), Roles.Dot); + t.AddChild (new CSharpTokenNode (Convert (memberName.DotLocation), Roles.Dot), Roles.Dot); t.AddChild (Identifier.Create (memberName.Name, Convert (memberName.Location)), Roles.Identifier); AddTypeArguments (t, memberName); @@ -499,21 +499,21 @@ namespace ICSharpCode.NRefactory.CSharp AddModifiers(newType, location); int curLoc = 0; if (location != null && location.Count > 0) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.ClassKeyword); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.ClassKeyword), Roles.ClassKeyword); newType.AddChild (Identifier.Create (c.MemberName.Name, Convert (c.MemberName.Location)), Roles.Identifier); AddTypeParameters (newType, c.MemberName); if (c.TypeBaseExpressions != null) { if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.Colon); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.Colon), Roles.Colon); var commaLocations = LocationsBag.GetLocations (c.TypeBaseExpressions); int i = 0; foreach (var baseTypes in c.TypeBaseExpressions) { newType.AddChild (ConvertToType (baseTypes), Roles.BaseType); if (commaLocations != null && i < commaLocations.Count) { - newType.AddChild (new CSharpTokenNode (Convert (commaLocations [i])), Roles.Comma); + newType.AddChild (new CSharpTokenNode (Convert (commaLocations [i]), Roles.Comma), Roles.Comma); i++; } } @@ -521,16 +521,16 @@ namespace ICSharpCode.NRefactory.CSharp AddConstraints (newType, c.CurrentTypeParameters); if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.LBrace); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.LBrace), Roles.LBrace); typeStack.Push (newType); base.Visit (c); AddAttributeSection (newType, c.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole); if (location != null && curLoc < location.Count) { - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.RBrace); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.RBrace), Roles.RBrace); if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.Semicolon); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.Semicolon), Roles.Semicolon); } else { // parser error, set end node to max value. @@ -549,19 +549,19 @@ namespace ICSharpCode.NRefactory.CSharp AddModifiers(newType, location); int curLoc = 0; if (location != null && location.Count > 0) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.StructKeyword); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.StructKeyword), Roles.StructKeyword); newType.AddChild (Identifier.Create (s.MemberName.Name, Convert (s.MemberName.Location)), Roles.Identifier); AddTypeParameters (newType, s.MemberName); if (s.TypeBaseExpressions != null) { if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.Colon); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.Colon), Roles.Colon); var commaLocations = LocationsBag.GetLocations (s.TypeBaseExpressions); int i = 0; foreach (var baseTypes in s.TypeBaseExpressions) { newType.AddChild (ConvertToType (baseTypes), Roles.BaseType); if (commaLocations != null && i < commaLocations.Count) { - newType.AddChild (new CSharpTokenNode (Convert (commaLocations [i])), Roles.Comma); + newType.AddChild (new CSharpTokenNode (Convert (commaLocations [i]), Roles.Comma), Roles.Comma); i++; } } @@ -569,14 +569,14 @@ namespace ICSharpCode.NRefactory.CSharp AddConstraints (newType, s.CurrentTypeParameters); if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.LBrace); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.LBrace), Roles.LBrace); typeStack.Push (newType); base.Visit (s); if (location != null && location.Count > 2) { if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.RBrace); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.RBrace), Roles.RBrace); if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.Semicolon); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.Semicolon), Roles.Semicolon); } else { // parser error, set end node to max value. newType.AddChild (new ErrorNode (), Roles.Error); @@ -594,19 +594,19 @@ namespace ICSharpCode.NRefactory.CSharp AddModifiers(newType, location); int curLoc = 0; if (location != null && location.Count > 0) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.InterfaceKeyword); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.InterfaceKeyword), Roles.InterfaceKeyword); newType.AddChild (Identifier.Create (i.MemberName.Name, Convert (i.MemberName.Location)), Roles.Identifier); AddTypeParameters (newType, i.MemberName); if (i.TypeBaseExpressions != null) { if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.Colon); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.Colon), Roles.Colon); var commaLocations = LocationsBag.GetLocations (i.TypeBaseExpressions); int j = 0; foreach (var baseTypes in i.TypeBaseExpressions) { newType.AddChild (ConvertToType (baseTypes), Roles.BaseType); if (commaLocations != null && j < commaLocations.Count) { - newType.AddChild (new CSharpTokenNode (Convert (commaLocations [j])), Roles.Comma); + newType.AddChild (new CSharpTokenNode (Convert (commaLocations [j]), Roles.Comma), Roles.Comma); j++; } } @@ -614,14 +614,14 @@ namespace ICSharpCode.NRefactory.CSharp AddConstraints (newType, i.CurrentTypeParameters); if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.LBrace); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.LBrace), Roles.LBrace); typeStack.Push (newType); base.Visit (i); if (location != null && location.Count > 2) { if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.RBrace); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.RBrace), Roles.RBrace); if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.Semicolon); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.Semicolon), Roles.Semicolon); } else { // parser error, set end node to max value. newType.AddChild (new ErrorNode (), Roles.Error); @@ -637,7 +637,7 @@ namespace ICSharpCode.NRefactory.CSharp AddAttributeSection(newDelegate, d); AddModifiers(newDelegate, location); if (location != null && location.Count > 0) { - newDelegate.AddChild(new CSharpTokenNode (Convert(location [0])), Roles.DelegateKeyword); + newDelegate.AddChild(new CSharpTokenNode (Convert(location [0]), Roles.DelegateKeyword), Roles.DelegateKeyword); } if (d.ReturnType != null) newDelegate.AddChild (ConvertToType (d.ReturnType), Roles.Type); @@ -645,15 +645,15 @@ namespace ICSharpCode.NRefactory.CSharp AddTypeParameters (newDelegate, d.MemberName); if (location != null && location.Count > 1) - newDelegate.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.LPar); + newDelegate.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.LPar), Roles.LPar); AddParameter (newDelegate, d.Parameters); if (location != null && location.Count > 2) { - newDelegate.AddChild (new CSharpTokenNode (Convert (location [2])), Roles.RPar); + newDelegate.AddChild (new CSharpTokenNode (Convert (location [2]), Roles.RPar), Roles.RPar); } AddConstraints (newDelegate, d.CurrentTypeParameters); if (location != null && location.Count > 3) { - newDelegate.AddChild (new CSharpTokenNode (Convert (location [3])), Roles.Semicolon); + newDelegate.AddChild (new CSharpTokenNode (Convert (location [3]), Roles.Semicolon), Roles.Semicolon); } AddType (newDelegate); } @@ -686,17 +686,17 @@ namespace ICSharpCode.NRefactory.CSharp AddModifiers(newType, location); int curLoc = 0; if (location != null && location.Count > 0) - newType.AddChild(new CSharpTokenNode(Convert(location [curLoc++])), Roles.EnumKeyword); + newType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.EnumKeyword), Roles.EnumKeyword); newType.AddChild(Identifier.Create(e.MemberName.Name, Convert(e.MemberName.Location)), Roles.Identifier); if (e.BaseTypeExpression != null) { if (location != null && curLoc < location.Count) - newType.AddChild(new CSharpTokenNode(Convert(location [curLoc++])), Roles.Colon); + newType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Colon), Roles.Colon); newType.AddChild(ConvertToType(e.BaseTypeExpression), Roles.BaseType); } if (location != null && curLoc < location.Count) - newType.AddChild(new CSharpTokenNode(Convert(location [curLoc++])), Roles.LBrace); + newType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.LBrace), Roles.LBrace); typeStack.Push(newType); foreach (var m in e.Members) { @@ -707,14 +707,14 @@ namespace ICSharpCode.NRefactory.CSharp } Visit(member); if (location != null && curLoc < location.Count - 1) //last one is closing brace - newType.AddChild(new CSharpTokenNode(Convert(location [curLoc++])), Roles.Comma); + newType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Comma), Roles.Comma); } if (location != null && location.Count > 2) { if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.RBrace); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.RBrace), Roles.RBrace); if (location != null && curLoc < location.Count) - newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++])), Roles.Semicolon); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), Roles.Semicolon), Roles.Semicolon); } else { // parser error, set end node to max value. newType.AddChild (new ErrorNode (), Roles.Error); @@ -729,7 +729,7 @@ namespace ICSharpCode.NRefactory.CSharp AddAttributeSection (newField, em); newField.AddChild (Identifier.Create (em.Name, Convert (em.Location)), Roles.Identifier); if (em.Initializer != null) { - newField.AddChild (new CSharpTokenNode (Convert (em.Initializer.Location)), Roles.Assign); + newField.AddChild (new CSharpTokenNode (Convert (em.Initializer.Location), Roles.Assign), Roles.Assign); newField.AddChild ((Expression)em.Initializer.Accept (this), EnumMemberDeclaration.InitializerRole); } //Console.WriteLine (newField.StartLocation +"-" + newField.EndLocation); @@ -750,7 +750,7 @@ namespace ICSharpCode.NRefactory.CSharp AddAttributeSection (newField, f); AddModifiers (newField, location); if (location != null && location.Count > 0) - newField.AddChild (new CSharpTokenNode (Convert (location [locationIdx++])), FixedFieldDeclaration.FixedKeywordRole); + newField.AddChild (new CSharpTokenNode (Convert (location [locationIdx++]), FixedFieldDeclaration.FixedKeywordRole), FixedFieldDeclaration.FixedKeywordRole); if (f.TypeExpression != null) newField.AddChild (ConvertToType (f.TypeExpression), Roles.Type); @@ -760,11 +760,11 @@ namespace ICSharpCode.NRefactory.CSharp if (f.Initializer != null && !f.Initializer.IsNull) { var bracketLocations = LocationsBag.GetLocations (f.Initializer); if (bracketLocations != null && bracketLocations.Count > 1) - variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0])), Roles.LBracket); + variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0]), Roles.LBracket), Roles.LBracket); variable.AddChild ((Expression)f.Initializer.Accept (this), Roles.Expression); if (bracketLocations != null && bracketLocations.Count > 1) - variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0])), Roles.RBracket); + variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0]), Roles.RBracket), Roles.RBracket); } newField.AddChild (variable, FixedFieldDeclaration.VariableRole); @@ -772,23 +772,23 @@ namespace ICSharpCode.NRefactory.CSharp foreach (var decl in f.Declarators) { var declLoc = LocationsBag.GetLocations (decl); if (declLoc != null) - newField.AddChild (new CSharpTokenNode (Convert (declLoc [0])), Roles.Comma); + newField.AddChild (new CSharpTokenNode (Convert (declLoc [0]), Roles.Comma), Roles.Comma); variable = new FixedVariableInitializer (); variable.AddChild (Identifier.Create (decl.Name.Value, Convert (decl.Name.Location)), Roles.Identifier); if (!decl.Initializer.IsNull) { var bracketLocations = LocationsBag.GetLocations (f.Initializer); if (bracketLocations != null && bracketLocations.Count > 1) - variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0])), Roles.LBracket); + variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0]), Roles.LBracket), Roles.LBracket); variable.AddChild ((Expression)decl.Initializer.Accept (this), Roles.Expression); if (bracketLocations != null && bracketLocations.Count > 1) - variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0])), Roles.RBracket); + variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0]), Roles.RBracket), Roles.RBracket); } newField.AddChild (variable, FixedFieldDeclaration.VariableRole); } } if (location != null && location.Count > locationIdx) - newField.AddChild (new CSharpTokenNode (Convert (location [locationIdx])), Roles.Semicolon); + newField.AddChild (new CSharpTokenNode (Convert (location [locationIdx]), Roles.Semicolon), Roles.Semicolon); typeStack.Peek ().AddChild (newField, Roles.TypeMemberRole); } @@ -807,7 +807,7 @@ namespace ICSharpCode.NRefactory.CSharp int locationIdx = 0; if (f.Initializer != null) { if (location != null) - variable.AddChild (new CSharpTokenNode (Convert (location [locationIdx++])), Roles.Assign); + variable.AddChild (new CSharpTokenNode (Convert (location [locationIdx++]), Roles.Assign), Roles.Assign); variable.AddChild ((Expression)f.Initializer.Accept (this), Roles.Expression); } newField.AddChild (variable, Roles.Variable); @@ -815,20 +815,20 @@ namespace ICSharpCode.NRefactory.CSharp foreach (var decl in f.Declarators) { var declLoc = LocationsBag.GetLocations (decl); if (declLoc != null) - newField.AddChild (new CSharpTokenNode (Convert (declLoc [0])), Roles.Comma); + newField.AddChild (new CSharpTokenNode (Convert (declLoc [0]), Roles.Comma), Roles.Comma); variable = new VariableInitializer (); variable.AddChild (Identifier.Create (decl.Name.Value, Convert (decl.Name.Location)), Roles.Identifier); if (decl.Initializer != null) { if (declLoc != null) - variable.AddChild (new CSharpTokenNode (Convert (declLoc [1])), Roles.Assign); + variable.AddChild (new CSharpTokenNode (Convert (declLoc [1]), Roles.Assign), Roles.Assign); variable.AddChild ((Expression)decl.Initializer.Accept (this), Roles.Expression); } newField.AddChild (variable, Roles.Variable); } } if (location != null &&location.Count > locationIdx) - newField.AddChild (new CSharpTokenNode (Convert (location [locationIdx++])), Roles.Semicolon); + newField.AddChild (new CSharpTokenNode (Convert (location [locationIdx++]), Roles.Semicolon), Roles.Semicolon); typeStack.Peek ().AddChild (newField, Roles.TypeMemberRole); } @@ -848,7 +848,7 @@ namespace ICSharpCode.NRefactory.CSharp variable.AddChild (Identifier.Create (f.MemberName.Name, Convert (f.MemberName.Location)), Roles.Identifier); if (f.Initializer != null) { - variable.AddChild (new CSharpTokenNode (Convert (f.Initializer.Location)), Roles.Assign); + variable.AddChild (new CSharpTokenNode (Convert (f.Initializer.Location), Roles.Assign), Roles.Assign); variable.AddChild ((Expression)f.Initializer.Accept (this), Roles.Expression); } newField.AddChild (variable, Roles.Variable); @@ -856,19 +856,19 @@ namespace ICSharpCode.NRefactory.CSharp foreach (var decl in f.Declarators) { var declLoc = LocationsBag.GetLocations (decl); if (declLoc != null) - newField.AddChild (new CSharpTokenNode (Convert (declLoc [0])), Roles.Comma); + newField.AddChild (new CSharpTokenNode (Convert (declLoc [0]), Roles.Comma), Roles.Comma); variable = new VariableInitializer (); variable.AddChild (Identifier.Create (decl.Name.Value, Convert (decl.Name.Location)), Roles.Identifier); if (decl.Initializer != null) { - variable.AddChild (new CSharpTokenNode (Convert (decl.Initializer.Location)), Roles.Assign); + variable.AddChild (new CSharpTokenNode (Convert (decl.Initializer.Location), Roles.Assign), Roles.Assign); variable.AddChild ((Expression)decl.Initializer.Accept (this), Roles.Expression); } newField.AddChild (variable, Roles.Variable); } } if (location != null) - newField.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.Semicolon); + newField.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.Semicolon), Roles.Semicolon); typeStack.Peek ().AddChild (newField, Roles.TypeMemberRole); @@ -887,38 +887,40 @@ namespace ICSharpCode.NRefactory.CSharp if (o.OperatorType == Operator.OpType.Implicit) { if (location != null && location.Count > 0) { - newOperator.AddChild (new CSharpTokenNode (Convert (location [0])), OperatorDeclaration.ImplicitRole); + newOperator.AddChild (new CSharpTokenNode (Convert (location [0]), OperatorDeclaration.ImplicitRole), OperatorDeclaration.ImplicitRole); if (location.Count > 1) - newOperator.AddChild (new CSharpTokenNode (Convert (location [1])), OperatorDeclaration.OperatorKeywordRole); + newOperator.AddChild (new CSharpTokenNode (Convert (location [1]), OperatorDeclaration.OperatorKeywordRole), OperatorDeclaration.OperatorKeywordRole); } newOperator.AddChild (ConvertToType (o.TypeExpression), Roles.Type); } else if (o.OperatorType == Operator.OpType.Explicit) { if (location != null && location.Count > 0) { - newOperator.AddChild (new CSharpTokenNode (Convert (location [0])), OperatorDeclaration.ExplicitRole); + newOperator.AddChild (new CSharpTokenNode (Convert (location [0]), OperatorDeclaration.ExplicitRole), OperatorDeclaration.ExplicitRole); if (location.Count > 1) - newOperator.AddChild (new CSharpTokenNode (Convert (location [1])), OperatorDeclaration.OperatorKeywordRole); + newOperator.AddChild (new CSharpTokenNode (Convert (location [1]), OperatorDeclaration.OperatorKeywordRole), OperatorDeclaration.OperatorKeywordRole); } newOperator.AddChild (ConvertToType (o.TypeExpression), Roles.Type); } else { newOperator.AddChild (ConvertToType (o.TypeExpression), Roles.Type); if (location != null && location.Count > 0) - newOperator.AddChild (new CSharpTokenNode (Convert (location [0])), OperatorDeclaration.OperatorKeywordRole); + newOperator.AddChild (new CSharpTokenNode (Convert (location [0]), OperatorDeclaration.OperatorKeywordRole), OperatorDeclaration.OperatorKeywordRole); - if (location != null && location.Count > 1) - newOperator.AddChild (new CSharpTokenNode (Convert (location [1])), OperatorDeclaration.GetRole (newOperator.OperatorType)); + if (location != null && location.Count > 1) { + var r = OperatorDeclaration.GetRole(newOperator.OperatorType); + newOperator.AddChild(new CSharpTokenNode(Convert(location [1]), r), r); + } } if (location != null && location.Count > 2) - newOperator.AddChild (new CSharpTokenNode (Convert (location [2])), Roles.LPar); + newOperator.AddChild (new CSharpTokenNode (Convert (location [2]), Roles.LPar), Roles.LPar); AddParameter (newOperator, o.ParameterInfo); if (location != null && location.Count > 3) - newOperator.AddChild (new CSharpTokenNode (Convert (location [3])), Roles.RPar); + newOperator.AddChild (new CSharpTokenNode (Convert (location [3]), Roles.RPar), Roles.RPar); if (o.Block != null) { newOperator.AddChild ((BlockStatement)o.Block.Accept (this), Roles.Body); } else { if (location != null && location.Count >= 5) - newOperator.AddChild (new CSharpTokenNode (Convert (location [4])), Roles.Semicolon); + newOperator.AddChild (new CSharpTokenNode (Convert (location [4]), Roles.Semicolon), Roles.Semicolon); } typeStack.Peek ().AddChild (newOperator, Roles.TypeMemberRole); } @@ -956,25 +958,25 @@ namespace ICSharpCode.NRefactory.CSharp newIndexer.AddChild (Identifier.Create ("this", Convert (name.Location)), Roles.Identifier); if (location != null && location.Count > 0) - newIndexer.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LBracket); + newIndexer.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LBracket), Roles.LBracket); AddParameter (newIndexer, indexer.ParameterInfo); if (location != null && location.Count > 1) - newIndexer.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RBracket); + newIndexer.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RBracket), Roles.RBracket); if (location != null && location.Count > 2) - newIndexer.AddChild (new CSharpTokenNode (Convert (location [2])), Roles.LBrace); + newIndexer.AddChild (new CSharpTokenNode (Convert (location [2]), Roles.LBrace), Roles.LBrace); if (indexer.Get != null) { Accessor getAccessor = new Accessor (); var getLocation = LocationsBag.GetMemberLocation (indexer.Get); AddAttributeSection (getAccessor, indexer.Get); AddModifiers (getAccessor, getLocation); if (getLocation != null) - getAccessor.AddChild (new CSharpTokenNode (Convert (indexer.Get.Location)), PropertyDeclaration.GetKeywordRole); + getAccessor.AddChild (new CSharpTokenNode (Convert (indexer.Get.Location), PropertyDeclaration.GetKeywordRole), PropertyDeclaration.GetKeywordRole); if (indexer.Get.Block != null) { getAccessor.AddChild ((BlockStatement)indexer.Get.Block.Accept (this), Roles.Body); } else { if (getLocation != null && getLocation.Count > 0) - newIndexer.AddChild (new CSharpTokenNode (Convert (getLocation [0])), Roles.Semicolon); + newIndexer.AddChild (new CSharpTokenNode (Convert (getLocation [0]), Roles.Semicolon), Roles.Semicolon); } newIndexer.AddChild (getAccessor, PropertyDeclaration.GetterRole); } @@ -985,20 +987,20 @@ namespace ICSharpCode.NRefactory.CSharp AddAttributeSection (setAccessor, indexer.Set); AddModifiers (setAccessor, setLocation); if (setLocation != null) - setAccessor.AddChild (new CSharpTokenNode (Convert (indexer.Set.Location)), PropertyDeclaration.SetKeywordRole); + setAccessor.AddChild (new CSharpTokenNode (Convert (indexer.Set.Location), PropertyDeclaration.SetKeywordRole), PropertyDeclaration.SetKeywordRole); if (indexer.Set.Block != null) { setAccessor.AddChild ((BlockStatement)indexer.Set.Block.Accept (this), Roles.Body); } else { if (setLocation != null && setLocation.Count > 0) - newIndexer.AddChild (new CSharpTokenNode (Convert (setLocation [0])), Roles.Semicolon); + newIndexer.AddChild (new CSharpTokenNode (Convert (setLocation [0]), Roles.Semicolon), Roles.Semicolon); } newIndexer.AddChild (setAccessor, PropertyDeclaration.SetterRole); } if (location != null) { if (location.Count > 3) - newIndexer.AddChild (new CSharpTokenNode (Convert (location [3])), Roles.RBrace); + newIndexer.AddChild (new CSharpTokenNode (Convert (location [3]), Roles.RBrace), Roles.RBrace); } else { // parser error, set end node to max value. newIndexer.AddChild (new ErrorNode (), Roles.Error); @@ -1019,11 +1021,11 @@ namespace ICSharpCode.NRefactory.CSharp AddTypeParameters (newMethod, m.MemberName); if (location != null && location.Count > 0) - newMethod.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + newMethod.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); AddParameter (newMethod, m.ParameterInfo); if (location != null && location.Count > 1) - newMethod.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + newMethod.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); AddConstraints (newMethod, m.CurrentTypeParameters); @@ -1039,7 +1041,7 @@ namespace ICSharpCode.NRefactory.CSharp // parser error, set end node to max value. newMethod.AddChild (new ErrorNode (), Roles.Error); } else { - newMethod.AddChild (new CSharpTokenNode (Convert (location [2])), Roles.Semicolon); + newMethod.AddChild (new CSharpTokenNode (Convert (location [2]), Roles.Semicolon), Roles.Semicolon); } } typeStack.Peek ().AddChild (newMethod, Roles.TypeMemberRole); @@ -1114,7 +1116,7 @@ namespace ICSharpCode.NRefactory.CSharp newProperty.AddChild (Identifier.Create (p.MemberName.Name, Convert (p.Location)), Roles.Identifier); if (location != null && location.Count > 0) - newProperty.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LBrace); + newProperty.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LBrace), Roles.LBrace); Accessor getAccessor = null; if (p.Get != null) { @@ -1122,13 +1124,13 @@ namespace ICSharpCode.NRefactory.CSharp AddAttributeSection (getAccessor, p.Get); var getLocation = LocationsBag.GetMemberLocation (p.Get); AddModifiers (getAccessor, getLocation); - getAccessor.AddChild (new CSharpTokenNode (Convert (p.Get.Location)), PropertyDeclaration.GetKeywordRole); + getAccessor.AddChild (new CSharpTokenNode (Convert (p.Get.Location), PropertyDeclaration.GetKeywordRole), PropertyDeclaration.GetKeywordRole); if (p.Get.Block != null) { getAccessor.AddChild ((BlockStatement)p.Get.Block.Accept (this), Roles.Body); } else { if (getLocation != null && getLocation.Count > 0) - getAccessor.AddChild (new CSharpTokenNode (Convert (getLocation [0])), Roles.Semicolon); + getAccessor.AddChild (new CSharpTokenNode (Convert (getLocation [0]), Roles.Semicolon), Roles.Semicolon); } } @@ -1138,13 +1140,13 @@ namespace ICSharpCode.NRefactory.CSharp AddAttributeSection (setAccessor, p.Set); var setLocation = LocationsBag.GetMemberLocation (p.Set); AddModifiers (setAccessor, setLocation); - setAccessor.AddChild (new CSharpTokenNode (Convert (p.Set.Location)), PropertyDeclaration.SetKeywordRole); + setAccessor.AddChild (new CSharpTokenNode (Convert (p.Set.Location), PropertyDeclaration.SetKeywordRole), PropertyDeclaration.SetKeywordRole); if (p.Set.Block != null) { setAccessor.AddChild ((BlockStatement)p.Set.Block.Accept (this), Roles.Body); } else { if (setLocation != null && setLocation.Count > 0) - setAccessor.AddChild (new CSharpTokenNode (Convert (setLocation [0])), Roles.Semicolon); + setAccessor.AddChild (new CSharpTokenNode (Convert (setLocation [0]), Roles.Semicolon), Roles.Semicolon); } } if (getAccessor != null && setAccessor != null) { @@ -1163,7 +1165,7 @@ namespace ICSharpCode.NRefactory.CSharp } if (location != null && location.Count > 1) { - newProperty.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RBrace); + newProperty.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RBrace), Roles.RBrace); } else { // parser error, set end node to max value. newProperty.AddChild (new ErrorNode (), Roles.Error); @@ -1180,11 +1182,11 @@ namespace ICSharpCode.NRefactory.CSharp AddModifiers (newConstructor, location); newConstructor.AddChild (Identifier.Create (c.MemberName.Name, Convert (c.MemberName.Location)), Roles.Identifier); if (location != null && location.Count > 0) - newConstructor.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + newConstructor.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); AddParameter (newConstructor, c.ParameterInfo); if (location != null && location.Count > 1) - newConstructor.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + newConstructor.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); if (c.Initializer != null) { var initializer = new ConstructorInitializer (); @@ -1192,14 +1194,15 @@ namespace ICSharpCode.NRefactory.CSharp var initializerLocation = LocationsBag.GetLocations (c.Initializer); if (initializerLocation != null) - newConstructor.AddChild (new CSharpTokenNode (Convert (initializerLocation [0])), Roles.Colon); + newConstructor.AddChild (new CSharpTokenNode (Convert (initializerLocation [0]), Roles.Colon), Roles.Colon); if (initializerLocation != null && initializerLocation.Count > 1) { // this and base has the same length - initializer.AddChild (new CSharpTokenNode (Convert (c.Initializer.Location)), initializer.ConstructorInitializerType == ConstructorInitializerType.This ? ConstructorInitializer.ThisKeywordRole : ConstructorInitializer.BaseKeywordRole); - initializer.AddChild (new CSharpTokenNode (Convert (initializerLocation [1])), Roles.LPar); + var r = initializer.ConstructorInitializerType == ConstructorInitializerType.This ? ConstructorInitializer.ThisKeywordRole : ConstructorInitializer.BaseKeywordRole; + initializer.AddChild (new CSharpTokenNode (Convert (c.Initializer.Location), r), r); + initializer.AddChild (new CSharpTokenNode (Convert (initializerLocation [1]), Roles.LPar), Roles.LPar); AddArguments (initializer, LocationsBag.GetLocations (c.Initializer.Arguments), c.Initializer.Arguments); - initializer.AddChild (new CSharpTokenNode (Convert (initializerLocation [2])), Roles.RPar); + initializer.AddChild (new CSharpTokenNode (Convert (initializerLocation [2]), Roles.RPar), Roles.RPar); newConstructor.AddChild (initializer, ConstructorDeclaration.InitializerRole); } } @@ -1216,14 +1219,14 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetMemberLocation (d); AddModifiers (newDestructor, location); if (location != null && location.Count > 0) - newDestructor.AddChild (new CSharpTokenNode (Convert (location [0])), DestructorDeclaration.TildeRole); + newDestructor.AddChild (new CSharpTokenNode (Convert (location [0]), DestructorDeclaration.TildeRole), DestructorDeclaration.TildeRole); newDestructor.AddChild (Identifier.Create (d.Identifier, Convert (d.MemberName.Location)), Roles.Identifier); if (location != null && location.Count > 1) { - newDestructor.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.LPar); + newDestructor.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.LPar), Roles.LPar); if (location.Count > 2) - newDestructor.AddChild (new CSharpTokenNode (Convert (location [2])), Roles.RPar); + newDestructor.AddChild (new CSharpTokenNode (Convert (location [2]), Roles.RPar), Roles.RPar); } if (d.Block != null) @@ -1240,7 +1243,7 @@ namespace ICSharpCode.NRefactory.CSharp AddModifiers (newEvent, location); if (location != null && location.Count > 0) - newEvent.AddChild (new CSharpTokenNode (Convert (location [0])), EventDeclaration.EventKeywordRole); + newEvent.AddChild (new CSharpTokenNode (Convert (location [0]), EventDeclaration.EventKeywordRole), EventDeclaration.EventKeywordRole); newEvent.AddChild (ConvertToType (e.TypeExpression), Roles.Type); VariableInitializer variable = new VariableInitializer (); @@ -1248,7 +1251,7 @@ namespace ICSharpCode.NRefactory.CSharp if (e.Initializer != null) { if (location != null && location.Count > 0) - variable.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Assign); + variable.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Assign), Roles.Assign); variable.AddChild ((Expression)e.Initializer.Accept (this), Roles.Expression); } newEvent.AddChild (variable, Roles.Variable); @@ -1256,14 +1259,14 @@ namespace ICSharpCode.NRefactory.CSharp foreach (var decl in e.Declarators) { var declLoc = LocationsBag.GetLocations (decl); if (declLoc != null) - newEvent.AddChild (new CSharpTokenNode (Convert (declLoc [0])), Roles.Comma); + newEvent.AddChild (new CSharpTokenNode (Convert (declLoc [0]), Roles.Comma), Roles.Comma); variable = new VariableInitializer (); variable.AddChild (Identifier.Create (decl.Name.Value, Convert (decl.Name.Location)), Roles.Identifier); if (decl.Initializer != null) { if (declLoc != null) - variable.AddChild (new CSharpTokenNode (Convert (declLoc [1])), Roles.Assign); + variable.AddChild (new CSharpTokenNode (Convert (declLoc [1]), Roles.Assign), Roles.Assign); variable.AddChild ((Expression)decl.Initializer.Accept (this), Roles.Expression); } newEvent.AddChild (variable, Roles.Variable); @@ -1271,7 +1274,7 @@ namespace ICSharpCode.NRefactory.CSharp } if (location != null && location.Count > 1) - newEvent.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.Semicolon); + newEvent.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.Semicolon), Roles.Semicolon); typeStack.Peek ().AddChild (newEvent, Roles.TypeMemberRole); } @@ -1284,7 +1287,7 @@ namespace ICSharpCode.NRefactory.CSharp parent.AddChild (ConvertToType (memberName.ExplicitInterface), EntityDeclaration.PrivateImplementationTypeRole); var privateImplTypeLoc = LocationsBag.GetLocations (memberName.ExplicitInterface); if (privateImplTypeLoc != null) - parent.AddChild (new CSharpTokenNode (Convert (privateImplTypeLoc [0])), Roles.Dot); + parent.AddChild (new CSharpTokenNode (Convert (privateImplTypeLoc [0]), Roles.Dot), Roles.Dot); } public override void Visit (EventProperty ep) @@ -1295,7 +1298,7 @@ namespace ICSharpCode.NRefactory.CSharp AddModifiers (newEvent, location); if (location != null && location.Count > 0) - newEvent.AddChild (new CSharpTokenNode (Convert (location [0])), CustomEventDeclaration.EventKeywordRole); + newEvent.AddChild (new CSharpTokenNode (Convert (location [0]), CustomEventDeclaration.EventKeywordRole), CustomEventDeclaration.EventKeywordRole); newEvent.AddChild (ConvertToType (ep.TypeExpression), Roles.Type); AddExplicitInterface (newEvent, ep.MemberName); @@ -1303,14 +1306,14 @@ namespace ICSharpCode.NRefactory.CSharp newEvent.AddChild (Identifier.Create (ep.MemberName.Name, Convert (ep.Location)), Roles.Identifier); if (location != null && location.Count >= 2) - newEvent.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.LBrace); + newEvent.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.LBrace), Roles.LBrace); if (ep.Add != null) { Accessor addAccessor = new Accessor (); AddAttributeSection (addAccessor, ep.Add); var addLocation = LocationsBag.GetMemberLocation (ep.Add); AddModifiers (addAccessor, addLocation); - addAccessor.AddChild (new CSharpTokenNode (Convert (ep.Add.Location)), CustomEventDeclaration.AddKeywordRole); + addAccessor.AddChild (new CSharpTokenNode (Convert (ep.Add.Location), CustomEventDeclaration.AddKeywordRole), CustomEventDeclaration.AddKeywordRole); if (ep.Add.Block != null) addAccessor.AddChild ((BlockStatement)ep.Add.Block.Accept (this), Roles.Body); newEvent.AddChild (addAccessor, CustomEventDeclaration.AddAccessorRole); @@ -1321,14 +1324,14 @@ namespace ICSharpCode.NRefactory.CSharp AddAttributeSection (removeAccessor, ep.Remove); var removeLocation = LocationsBag.GetMemberLocation (ep.Remove); AddModifiers (removeAccessor, removeLocation); - removeAccessor.AddChild (new CSharpTokenNode (Convert (ep.Remove.Location)), CustomEventDeclaration.RemoveKeywordRole); + removeAccessor.AddChild (new CSharpTokenNode (Convert (ep.Remove.Location), CustomEventDeclaration.RemoveKeywordRole), CustomEventDeclaration.RemoveKeywordRole); if (ep.Remove.Block != null) removeAccessor.AddChild ((BlockStatement)ep.Remove.Block.Accept (this), Roles.Body); newEvent.AddChild (removeAccessor, CustomEventDeclaration.RemoveAccessorRole); } if (location != null && location.Count >= 3) { - newEvent.AddChild (new CSharpTokenNode (Convert (location [2])), Roles.RBrace); + newEvent.AddChild (new CSharpTokenNode (Convert (location [2]), Roles.RBrace), Roles.RBrace); } else { // parser error, set end node to max value. newEvent.AddChild (new ErrorNode (), Roles.Error); @@ -1356,7 +1359,7 @@ namespace ICSharpCode.NRefactory.CSharp varInit.AddChild (Identifier.Create (blockVariableDeclaration.Variable.Name, Convert (blockVariableDeclaration.Variable.Location)), Roles.Identifier); if (blockVariableDeclaration.Initializer != null) { if (location != null && location.Count > 0) - varInit.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Assign); + varInit.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Assign), Roles.Assign); varInit.AddChild ((Expression)blockVariableDeclaration.Initializer.Accept (this), Roles.Expression); } @@ -1367,11 +1370,11 @@ namespace ICSharpCode.NRefactory.CSharp var loc = LocationsBag.GetLocations (decl); var init = new VariableInitializer (); if (loc != null && loc.Count > 0) - result.AddChild (new CSharpTokenNode (Convert (loc [0])), Roles.Comma); + result.AddChild (new CSharpTokenNode (Convert (loc [0]), Roles.Comma), Roles.Comma); init.AddChild (Identifier.Create (decl.Variable.Name, Convert (decl.Variable.Location)), Roles.Identifier); if (decl.Initializer != null) { if (loc != null && loc.Count > 1) - init.AddChild (new CSharpTokenNode (Convert (loc [1])), Roles.Assign); + init.AddChild (new CSharpTokenNode (Convert (loc [1]), Roles.Assign), Roles.Assign); init.AddChild ((Expression)decl.Initializer.Accept (this), Roles.Expression); } else { } @@ -1379,7 +1382,7 @@ namespace ICSharpCode.NRefactory.CSharp } } if (location != null && (blockVariableDeclaration.Initializer == null || location.Count > 1)) - result.AddChild (new CSharpTokenNode (Convert (location [location.Count - 1])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [location.Count - 1]), Roles.Semicolon), Roles.Semicolon); return result; } @@ -1397,7 +1400,7 @@ namespace ICSharpCode.NRefactory.CSharp varInit.AddChild (Identifier.Create (blockVariableDeclaration.Variable.Name, Convert (blockVariableDeclaration.Variable.Location)), Roles.Identifier); if (blockVariableDeclaration.Initializer != null) { if (location != null && location.Count > 1) - varInit.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.Assign); + varInit.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.Assign), Roles.Assign); varInit.AddChild ((Expression)blockVariableDeclaration.Initializer.Accept (this), Roles.Expression); } @@ -1410,19 +1413,19 @@ namespace ICSharpCode.NRefactory.CSharp init.AddChild (Identifier.Create (decl.Variable.Name, Convert (decl.Variable.Location)), Roles.Identifier); if (decl.Initializer != null) { if (loc != null) - init.AddChild (new CSharpTokenNode (Convert (loc [0])), Roles.Assign); + init.AddChild (new CSharpTokenNode (Convert (loc [0]), Roles.Assign), Roles.Assign); init.AddChild ((Expression)decl.Initializer.Accept (this), Roles.Expression); if (loc != null && loc.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (loc [1])), Roles.Comma); + result.AddChild (new CSharpTokenNode (Convert (loc [1]), Roles.Comma), Roles.Comma); } else { if (loc != null && loc.Count > 0) - result.AddChild (new CSharpTokenNode (Convert (loc [0])), Roles.Comma); + result.AddChild (new CSharpTokenNode (Convert (loc [0]), Roles.Comma), Roles.Comma); } result.AddChild (init, Roles.Variable); } } if (location != null) { - result.AddChild (new CSharpTokenNode (Convert (location [location.Count - 1])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [location.Count - 1]), Roles.Semicolon), Roles.Semicolon); } else { // parser error, set end node to max value. result.AddChild (new ErrorNode (), Roles.Error); @@ -1458,20 +1461,20 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetLocations (ifStatement); - result.AddChild (new CSharpTokenNode (Convert (ifStatement.loc)), IfElseStatement.IfKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (ifStatement.loc), IfElseStatement.IfKeywordRole), IfElseStatement.IfKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (ifStatement.Expr != null) result.AddChild ((Expression)ifStatement.Expr.Accept (this), Roles.Condition); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); if (ifStatement.TrueStatement != null) result.AddChild ((Statement)ifStatement.TrueStatement.Accept (this), IfElseStatement.TrueRole); if (ifStatement.FalseStatement != null) { if (location != null && location.Count > 2) - result.AddChild (new CSharpTokenNode (Convert (location [2])), IfElseStatement.ElseKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [2]), IfElseStatement.ElseKeywordRole), IfElseStatement.ElseKeywordRole); result.AddChild ((Statement)ifStatement.FalseStatement.Accept (this), IfElseStatement.FalseRole); } @@ -1482,19 +1485,19 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new DoWhileStatement (); var location = LocationsBag.GetLocations (doStatement); - result.AddChild (new CSharpTokenNode (Convert (doStatement.loc)), DoWhileStatement.DoKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (doStatement.loc), DoWhileStatement.DoKeywordRole), DoWhileStatement.DoKeywordRole); if (doStatement.EmbeddedStatement != null) result.AddChild ((Statement)doStatement.EmbeddedStatement.Accept (this), Roles.EmbeddedStatement); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), DoWhileStatement.WhileKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [0]), DoWhileStatement.WhileKeywordRole), DoWhileStatement.WhileKeywordRole); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.LPar), Roles.LPar); if (doStatement.expr != null) result.AddChild ((Expression)doStatement.expr.Accept (this), Roles.Condition); if (location != null && location.Count > 2) { - result.AddChild (new CSharpTokenNode (Convert (location [2])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [2]), Roles.RPar), Roles.RPar); if (location.Count > 3) - result.AddChild (new CSharpTokenNode (Convert (location [3])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [3]), Roles.Semicolon), Roles.Semicolon); } return result; @@ -1504,14 +1507,14 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new WhileStatement (); var location = LocationsBag.GetLocations (whileStatement); - result.AddChild (new CSharpTokenNode (Convert (whileStatement.loc)), WhileStatement.WhileKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (whileStatement.loc), WhileStatement.WhileKeywordRole), WhileStatement.WhileKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (whileStatement.expr != null) result.AddChild ((Expression)whileStatement.expr.Accept (this), Roles.Condition); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); if (whileStatement.Statement != null) result.AddChild ((Statement)whileStatement.Statement.Accept (this), Roles.EmbeddedStatement); return result; @@ -1538,23 +1541,23 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetLocations (forStatement); - result.AddChild (new CSharpTokenNode (Convert (forStatement.loc)), ForStatement.ForKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (forStatement.loc), ForStatement.ForKeywordRole), ForStatement.ForKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); AddStatementOrList (result, forStatement.Initializer, ForStatement.InitializerRole); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.Semicolon), Roles.Semicolon); if (forStatement.Condition != null) result.AddChild ((Expression)forStatement.Condition.Accept (this), Roles.Condition); if (location != null && location.Count >= 3) - result.AddChild (new CSharpTokenNode (Convert (location [2])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [2]), Roles.Semicolon), Roles.Semicolon); AddStatementOrList (result, forStatement.Iterator, ForStatement.IteratorRole); if (location != null && location.Count >= 4) - result.AddChild (new CSharpTokenNode (Convert (location [3])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [3]), Roles.RPar), Roles.RPar); if (forStatement.Statement != null) result.AddChild ((Statement)forStatement.Statement.Accept (this), Roles.EmbeddedStatement); @@ -1570,7 +1573,7 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild ((Expression)expr, Roles.Expression); var location = LocationsBag.GetLocations (statementExpression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Semicolon), Roles.Semicolon); return result; } @@ -1582,7 +1585,7 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild ((Expression)expr, Roles.Expression); var location = LocationsBag.GetLocations (statementErrorExpression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Semicolon), Roles.Semicolon); return result; } @@ -1596,7 +1599,7 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild (expr, Roles.Expression); var location = LocationsBag.GetLocations (statementExpression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Semicolon), Roles.Semicolon); return result; } @@ -1604,13 +1607,13 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new ReturnStatement (); - result.AddChild (new CSharpTokenNode (Convert (returnStatement.loc)), ReturnStatement.ReturnKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (returnStatement.loc), ReturnStatement.ReturnKeywordRole), ReturnStatement.ReturnKeywordRole); if (returnStatement.Expr != null) result.AddChild ((Expression)returnStatement.Expr.Accept (this), Roles.Expression); var location = LocationsBag.GetLocations (returnStatement); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Semicolon), Roles.Semicolon); return result; } @@ -1619,11 +1622,11 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new GotoStatement (); var location = LocationsBag.GetLocations (gotoStatement); - result.AddChild (new CSharpTokenNode (Convert (gotoStatement.loc)), GotoStatement.GotoKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (gotoStatement.loc), GotoStatement.GotoKeywordRole), GotoStatement.GotoKeywordRole); var loc = location != null ? Convert (location [0]) : TextLocation.Empty; result.AddChild (Identifier.Create (gotoStatement.Target, loc), Roles.Identifier); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.Semicolon), Roles.Semicolon); return result; } @@ -1634,19 +1637,19 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild (Identifier.Create (labeledStatement.Name, Convert (labeledStatement.loc)), Roles.Identifier); var location = LocationsBag.GetLocations (labeledStatement); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Colon); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Colon), Roles.Colon); return result; } public override object Visit (GotoDefault gotoDefault) { var result = new GotoDefaultStatement (); - result.AddChild (new CSharpTokenNode (Convert (gotoDefault.loc)), GotoDefaultStatement.GotoKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (gotoDefault.loc), GotoDefaultStatement.GotoKeywordRole), GotoDefaultStatement.GotoKeywordRole); var location = LocationsBag.GetLocations (gotoDefault); if (location != null) { - result.AddChild (new CSharpTokenNode (Convert (location [0])), GotoDefaultStatement.DefaultKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [0]), GotoDefaultStatement.DefaultKeywordRole), GotoDefaultStatement.DefaultKeywordRole); if (location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.Semicolon), Roles.Semicolon); } return result; @@ -1655,15 +1658,15 @@ namespace ICSharpCode.NRefactory.CSharp public override object Visit (GotoCase gotoCase) { var result = new GotoCaseStatement (); - result.AddChild (new CSharpTokenNode (Convert (gotoCase.loc)), GotoCaseStatement.GotoKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (gotoCase.loc), GotoCaseStatement.GotoKeywordRole), GotoCaseStatement.GotoKeywordRole); var location = LocationsBag.GetLocations (gotoCase); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), GotoCaseStatement.CaseKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [0]), GotoCaseStatement.CaseKeywordRole), GotoCaseStatement.CaseKeywordRole); if (gotoCase.Expr != null) result.AddChild ((Expression)gotoCase.Expr.Accept (this), Roles.Expression); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.Semicolon), Roles.Semicolon); return result; } @@ -1672,11 +1675,11 @@ namespace ICSharpCode.NRefactory.CSharp var result = new ThrowStatement (); var location = LocationsBag.GetLocations (throwStatement); - result.AddChild (new CSharpTokenNode (Convert (throwStatement.loc)), ThrowStatement.ThrowKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (throwStatement.loc), ThrowStatement.ThrowKeywordRole), ThrowStatement.ThrowKeywordRole); if (throwStatement.Expr != null) result.AddChild ((Expression)throwStatement.Expr.Accept (this), Roles.Expression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Semicolon), Roles.Semicolon); return result; } @@ -1685,9 +1688,9 @@ namespace ICSharpCode.NRefactory.CSharp var result = new BreakStatement (); var location = LocationsBag.GetLocations (breakStatement); - result.AddChild (new CSharpTokenNode (Convert (breakStatement.loc)), BreakStatement.BreakKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (breakStatement.loc), BreakStatement.BreakKeywordRole), BreakStatement.BreakKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Semicolon), Roles.Semicolon); return result; } @@ -1695,9 +1698,9 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new ContinueStatement (); var location = LocationsBag.GetLocations (continueStatement); - result.AddChild (new CSharpTokenNode (Convert (continueStatement.loc)), ContinueStatement.ContinueKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (continueStatement.loc), ContinueStatement.ContinueKeywordRole), ContinueStatement.ContinueKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Semicolon), Roles.Semicolon); return result; } @@ -1712,8 +1715,8 @@ namespace ICSharpCode.NRefactory.CSharp Mono.CSharp.Statement cur = blockStatement.Statements [0]; if (cur is Using) { Using u = (Using)cur; - usingResult.AddChild (new CSharpTokenNode (Convert (u.loc)), UsingStatement.UsingKeywordRole); - usingResult.AddChild (new CSharpTokenNode (Convert (blockStatement.StartLocation)), Roles.LPar); + usingResult.AddChild (new CSharpTokenNode (Convert (u.loc), UsingStatement.UsingKeywordRole), UsingStatement.UsingKeywordRole); + usingResult.AddChild (new CSharpTokenNode (Convert (blockStatement.StartLocation), Roles.LPar), Roles.LPar); if (u.Variables != null) { var initializer = new VariableInitializer () { NameToken = Identifier.Create (u.Variables.Variable.Name, Convert (u.Variables.Variable.Location)), @@ -1721,7 +1724,7 @@ namespace ICSharpCode.NRefactory.CSharp var loc = LocationsBag.GetLocations (u.Variables); if (loc != null) - initializer.AddChild (new CSharpTokenNode (Convert (loc [0])), Roles.Assign); + initializer.AddChild (new CSharpTokenNode (Convert (loc [0]), Roles.Assign), Roles.Assign); if (u.Variables.Initializer != null) initializer.Initializer = u.Variables.Initializer.Accept (this) as Expression; @@ -1736,11 +1739,11 @@ namespace ICSharpCode.NRefactory.CSharp var declLoc = LocationsBag.GetLocations (decl); var init = new VariableInitializer (); if (declLoc != null && declLoc.Count > 0) - varDec.AddChild (new CSharpTokenNode (Convert (declLoc [0])), Roles.Comma); + varDec.AddChild (new CSharpTokenNode (Convert (declLoc [0]), Roles.Comma), Roles.Comma); init.AddChild (Identifier.Create (decl.Variable.Name, Convert (decl.Variable.Location)), Roles.Identifier); if (decl.Initializer != null) { if (declLoc != null && declLoc.Count > 1) - init.AddChild (new CSharpTokenNode (Convert (declLoc [1])), Roles.Assign); + init.AddChild (new CSharpTokenNode (Convert (declLoc [1]), Roles.Assign), Roles.Assign); init.AddChild ((Expression)decl.Initializer.Accept (this), Roles.Expression); } varDec.AddChild (init, Roles.Variable); @@ -1749,7 +1752,7 @@ namespace ICSharpCode.NRefactory.CSharp usingResult.AddChild (varDec, UsingStatement.ResourceAcquisitionRole); } cur = u.Statement; - usingResult.AddChild (new CSharpTokenNode (Convert (blockStatement.EndLocation)), Roles.RPar); + usingResult.AddChild (new CSharpTokenNode (Convert (blockStatement.EndLocation), Roles.RPar), Roles.RPar); if (cur != null) usingResult.AddChild ((Statement)cur.Accept (this), Roles.EmbeddedStatement); } @@ -1784,11 +1787,11 @@ namespace ICSharpCode.NRefactory.CSharp return blockStatement.Statements.Last ().Accept (this); } var result = new BlockStatement (); - result.AddChild (new CSharpTokenNode (Convert (blockStatement.StartLocation)), Roles.LBrace); + result.AddChild (new CSharpTokenNode (Convert (blockStatement.StartLocation), Roles.LBrace), Roles.LBrace); int curLocal = 0; AddBlockChildren (result, blockStatement, ref curLocal); - result.AddChild (new CSharpTokenNode (Convert (blockStatement.EndLocation)), Roles.RBrace); + result.AddChild (new CSharpTokenNode (Convert (blockStatement.EndLocation), Roles.RBrace), Roles.RBrace); return result; } @@ -1797,15 +1800,15 @@ namespace ICSharpCode.NRefactory.CSharp var result = new SwitchStatement (); var location = LocationsBag.GetLocations (switchStatement); - result.AddChild (new CSharpTokenNode (Convert (switchStatement.loc)), SwitchStatement.SwitchKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (switchStatement.loc), SwitchStatement.SwitchKeywordRole), SwitchStatement.SwitchKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (switchStatement.Expr != null) result.AddChild ((Expression)switchStatement.Expr.Accept (this), Roles.Expression); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); if (location != null && location.Count > 2) - result.AddChild (new CSharpTokenNode (Convert (location [2])), Roles.LBrace); + result.AddChild (new CSharpTokenNode (Convert (location [2]), Roles.LBrace), Roles.LBrace); if (switchStatement.Sections != null) { foreach (var section in switchStatement.Sections) { var newSection = new SwitchSection (); @@ -1813,15 +1816,15 @@ namespace ICSharpCode.NRefactory.CSharp foreach (var caseLabel in section.Labels) { var newLabel = new CaseLabel (); if (caseLabel.Label != null) { - newLabel.AddChild (new CSharpTokenNode (Convert (caseLabel.Location)), CaseLabel.CaseKeywordRole); + newLabel.AddChild (new CSharpTokenNode (Convert (caseLabel.Location), CaseLabel.CaseKeywordRole), CaseLabel.CaseKeywordRole); if (caseLabel.Label != null) newLabel.AddChild ((Expression)caseLabel.Label.Accept (this), Roles.Expression); var colonLocation = LocationsBag.GetLocations (caseLabel); if (colonLocation != null) - newLabel.AddChild (new CSharpTokenNode (Convert (colonLocation [0])), Roles.Colon); + newLabel.AddChild (new CSharpTokenNode (Convert (colonLocation [0]), Roles.Colon), Roles.Colon); } else { - newLabel.AddChild (new CSharpTokenNode (Convert (caseLabel.Location)), CaseLabel.DefaultKeywordRole); - newLabel.AddChild (new CSharpTokenNode (new TextLocation (caseLabel.Location.Row, caseLabel.Location.Column + "default".Length)), Roles.Colon); + newLabel.AddChild (new CSharpTokenNode (Convert (caseLabel.Location), CaseLabel.DefaultKeywordRole), CaseLabel.DefaultKeywordRole); + newLabel.AddChild (new CSharpTokenNode (new TextLocation (caseLabel.Location.Row, caseLabel.Location.Column + "default".Length), Roles.Colon), Roles.Colon); } newSection.AddChild (newLabel, SwitchSection.CaseLabelRole); } @@ -1841,7 +1844,7 @@ namespace ICSharpCode.NRefactory.CSharp } if (location != null && location.Count > 3) { - result.AddChild (new CSharpTokenNode (Convert (location [3])), Roles.RBrace); + result.AddChild (new CSharpTokenNode (Convert (location [3]), Roles.RBrace), Roles.RBrace); } else { // parser error, set end node to max value. result.AddChild (new ErrorNode (), Roles.Error); @@ -1854,15 +1857,15 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new LockStatement (); var location = LocationsBag.GetLocations (lockStatement); - result.AddChild (new CSharpTokenNode (Convert (lockStatement.loc)), LockStatement.LockKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (lockStatement.loc), LockStatement.LockKeywordRole), LockStatement.LockKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (lockStatement.Expr != null) result.AddChild ((Expression)lockStatement.Expr.Accept (this), Roles.Expression); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); if (lockStatement.Statement != null) result.AddChild ((Statement)lockStatement.Statement.Accept (this), Roles.EmbeddedStatement); @@ -1872,7 +1875,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object Visit (Unchecked uncheckedStatement) { var result = new UncheckedStatement (); - result.AddChild (new CSharpTokenNode (Convert (uncheckedStatement.loc)), UncheckedStatement.UncheckedKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (uncheckedStatement.loc), UncheckedStatement.UncheckedKeywordRole), UncheckedStatement.UncheckedKeywordRole); if (uncheckedStatement.Block != null) result.AddChild ((BlockStatement)uncheckedStatement.Block.Accept (this), Roles.Body); return result; @@ -1881,7 +1884,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object Visit (Checked checkedStatement) { var result = new CheckedStatement (); - result.AddChild (new CSharpTokenNode (Convert (checkedStatement.loc)), CheckedStatement.CheckedKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (checkedStatement.loc), CheckedStatement.CheckedKeywordRole), CheckedStatement.CheckedKeywordRole); if (checkedStatement.Block != null) result.AddChild ((BlockStatement)checkedStatement.Block.Accept (this), Roles.Body); return result; @@ -1890,7 +1893,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object Visit (Unsafe unsafeStatement) { var result = new UnsafeStatement (); - result.AddChild (new CSharpTokenNode (Convert (unsafeStatement.loc)), UnsafeStatement.UnsafeKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (unsafeStatement.loc), UnsafeStatement.UnsafeKeywordRole), UnsafeStatement.UnsafeKeywordRole); if (unsafeStatement.Block != null) result.AddChild ((BlockStatement)unsafeStatement.Block.Accept (this), Roles.Body); return result; @@ -1901,9 +1904,9 @@ namespace ICSharpCode.NRefactory.CSharp var result = new FixedStatement (); var location = LocationsBag.GetLocations (fixedStatement); - result.AddChild (new CSharpTokenNode (Convert (fixedStatement.loc)), FixedStatement.FixedKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (fixedStatement.loc), FixedStatement.FixedKeywordRole), FixedStatement.FixedKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (fixedStatement.Variables != null) { var blockVariableDeclaration = fixedStatement.Variables; @@ -1913,7 +1916,7 @@ namespace ICSharpCode.NRefactory.CSharp varInit.AddChild (Identifier.Create (blockVariableDeclaration.Variable.Name, Convert (blockVariableDeclaration.Variable.Location)), Roles.Identifier); if (blockVariableDeclaration.Initializer != null) { if (initLocation != null) - varInit.AddChild (new CSharpTokenNode (Convert (initLocation [0])), Roles.Assign); + varInit.AddChild (new CSharpTokenNode (Convert (initLocation [0]), Roles.Assign), Roles.Assign); varInit.AddChild ((Expression)blockVariableDeclaration.Initializer.Accept (this), Roles.Expression); } @@ -1924,11 +1927,11 @@ namespace ICSharpCode.NRefactory.CSharp var loc = LocationsBag.GetLocations (decl); var init = new VariableInitializer (); if (loc != null && loc.Count > 0) - result.AddChild (new CSharpTokenNode (Convert (loc [0])), Roles.Comma); + result.AddChild (new CSharpTokenNode (Convert (loc [0]), Roles.Comma), Roles.Comma); init.AddChild (Identifier.Create (decl.Variable.Name, Convert (decl.Variable.Location)), Roles.Identifier); if (decl.Initializer != null) { if (loc != null && loc.Count > 1) - init.AddChild (new CSharpTokenNode (Convert (loc [1])), Roles.Assign); + init.AddChild (new CSharpTokenNode (Convert (loc [1]), Roles.Assign), Roles.Assign); init.AddChild ((Expression)decl.Initializer.Accept (this), Roles.Expression); } else { } @@ -1938,7 +1941,7 @@ namespace ICSharpCode.NRefactory.CSharp } if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); if (fixedStatement.Statement != null) result.AddChild ((Statement)fixedStatement.Statement.Accept (this), Roles.EmbeddedStatement); return result; @@ -1953,12 +1956,12 @@ namespace ICSharpCode.NRefactory.CSharp result = (TryCatchStatement)tryFinallyStatement.Stmt.Accept (this); } else { result = new TryCatchStatement (); - result.AddChild (new CSharpTokenNode (Convert (tryFinallyStatement.loc)), TryCatchStatement.TryKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (tryFinallyStatement.loc), TryCatchStatement.TryKeywordRole), TryCatchStatement.TryKeywordRole); if (tryFinallyStatement.Stmt != null) result.AddChild ((BlockStatement)tryFinallyStatement.Stmt.Accept (this), TryCatchStatement.TryBlockRole); } if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), TryCatchStatement.FinallyKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [0]), TryCatchStatement.FinallyKeywordRole), TryCatchStatement.FinallyKeywordRole); if (tryFinallyStatement.Fini != null) result.AddChild ((BlockStatement)tryFinallyStatement.Fini.Accept (this), TryCatchStatement.FinallyBlockRole); @@ -1969,10 +1972,10 @@ namespace ICSharpCode.NRefactory.CSharp { CatchClause result = new CatchClause (); var location = LocationsBag.GetLocations (ctch); - result.AddChild (new CSharpTokenNode (Convert (ctch.loc)), CatchClause.CatchKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (ctch.loc), CatchClause.CatchKeywordRole), CatchClause.CatchKeywordRole); if (ctch.TypeExpression != null) { if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (ctch.TypeExpression != null) result.AddChild (ConvertToType (ctch.TypeExpression), Roles.Type); @@ -1980,7 +1983,7 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild (Identifier.Create (ctch.Variable.Name, Convert (ctch.Variable.Location)), Roles.Identifier); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); } if (ctch.Block != null) @@ -1992,7 +1995,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object Visit (TryCatch tryCatchStatement) { var result = new TryCatchStatement (); - result.AddChild (new CSharpTokenNode (Convert (tryCatchStatement.loc)), TryCatchStatement.TryKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (tryCatchStatement.loc), TryCatchStatement.TryKeywordRole), TryCatchStatement.TryKeywordRole); if (tryCatchStatement.Block != null) result.AddChild ((BlockStatement)tryCatchStatement.Block.Accept (this), TryCatchStatement.TryBlockRole); if (tryCatchStatement.Clauses != null) { @@ -2011,14 +2014,14 @@ namespace ICSharpCode.NRefactory.CSharp var result = new UsingStatement (); var location = LocationsBag.GetLocations (usingStatement); - result.AddChild (new CSharpTokenNode (Convert (usingStatement.loc)), UsingStatement.UsingKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (usingStatement.loc), UsingStatement.UsingKeywordRole), UsingStatement.UsingKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (usingStatement.Expr != null) result.AddChild ((AstNode)usingStatement.Expr.Accept (this), UsingStatement.ResourceAcquisitionRole); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); if (usingStatement.Statement != null) result.AddChild ((Statement)usingStatement.Statement.Accept (this), Roles.EmbeddedStatement); @@ -2031,9 +2034,9 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetLocations (foreachStatement); - result.AddChild (new CSharpTokenNode (Convert (foreachStatement.loc)), ForeachStatement.ForeachKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (foreachStatement.loc), ForeachStatement.ForeachKeywordRole), ForeachStatement.ForeachKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (foreachStatement.TypeExpression != null) result.AddChild (ConvertToType (foreachStatement.TypeExpression), Roles.Type); @@ -2042,13 +2045,13 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild (Identifier.Create (foreachStatement.Variable.Name, Convert (foreachStatement.Variable.Location)), Roles.Identifier); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), ForeachStatement.InKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [1]), ForeachStatement.InKeywordRole), ForeachStatement.InKeywordRole); if (foreachStatement.Expr != null) result.AddChild ((Expression)foreachStatement.Expr.Accept (this), Roles.Expression); if (location != null && location.Count > 2) - result.AddChild (new CSharpTokenNode (Convert (location [2])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [2]), Roles.RPar), Roles.RPar); if (foreachStatement.Statement != null) result.AddChild ((Statement)foreachStatement.Statement.Accept (this), Roles.EmbeddedStatement); @@ -2061,13 +2064,13 @@ namespace ICSharpCode.NRefactory.CSharp var result = new YieldReturnStatement (); var location = LocationsBag.GetLocations (yieldStatement); - result.AddChild (new CSharpTokenNode (Convert (yieldStatement.loc)), YieldReturnStatement.YieldKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (yieldStatement.loc), YieldReturnStatement.YieldKeywordRole), YieldReturnStatement.YieldKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), YieldReturnStatement.ReturnKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [0]), YieldReturnStatement.ReturnKeywordRole), YieldReturnStatement.ReturnKeywordRole); if (yieldStatement.Expr != null) result.AddChild ((Expression)yieldStatement.Expr.Accept (this), Roles.Expression); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.Semicolon), Roles.Semicolon); return result; } @@ -2076,11 +2079,11 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new YieldBreakStatement (); var location = LocationsBag.GetLocations (yieldBreakStatement); - result.AddChild (new CSharpTokenNode (Convert (yieldBreakStatement.loc)), YieldBreakStatement.YieldKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (yieldBreakStatement.loc), YieldBreakStatement.YieldKeywordRole), YieldBreakStatement.YieldKeywordRole); if (location != null) { - result.AddChild (new CSharpTokenNode (Convert (location [0])), YieldBreakStatement.BreakKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [0]), YieldBreakStatement.BreakKeywordRole), YieldBreakStatement.BreakKeywordRole); if (location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.Semicolon), Roles.Semicolon); } return result; } @@ -2116,7 +2119,7 @@ namespace ICSharpCode.NRefactory.CSharp var ind = memberAccess.LeftExpression as Indirection; result = new PointerReferenceExpression (); result.AddChild ((Expression)ind.Expr.Accept (this), Roles.TargetExpression); - result.AddChild (new CSharpTokenNode (Convert (ind.Location)), PointerReferenceExpression.ArrowRole); + result.AddChild (new CSharpTokenNode (Convert (ind.Location), PointerReferenceExpression.ArrowRole), PointerReferenceExpression.ArrowRole); } else { result = new MemberReferenceExpression (); if (memberAccess.LeftExpression != null) { @@ -2124,7 +2127,7 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild ((Expression)leftExpr, Roles.TargetExpression); } if (!memberAccess.DotLocation.IsNull) { - result.AddChild (new CSharpTokenNode (Convert (memberAccess.DotLocation)), Roles.Dot); + result.AddChild (new CSharpTokenNode (Convert (memberAccess.DotLocation), Roles.Dot), Roles.Dot); } } @@ -2179,11 +2182,11 @@ namespace ICSharpCode.NRefactory.CSharp var result = new ParenthesizedExpression (); var location = LocationsBag.GetLocations (parenthesizedExpression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (parenthesizedExpression.Expr != null) result.AddChild ((Expression)parenthesizedExpression.Expr.Accept (this), Roles.Expression); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); return result; } @@ -2207,7 +2210,8 @@ namespace ICSharpCode.NRefactory.CSharp result.Operator = UnaryOperatorType.AddressOf; break; } - result.AddChild (new CSharpTokenNode (Convert (unaryExpression.Location)), UnaryOperatorExpression.GetOperatorRole (result.Operator)); + var r = UnaryOperatorExpression.GetOperatorRole (result.Operator); + result.AddChild (new CSharpTokenNode (Convert (unaryExpression.Location), r), r); if (unaryExpression.Expr != null) result.AddChild ((Expression)unaryExpression.Expr.Accept (this), Roles.Expression); return result; @@ -2223,22 +2227,22 @@ namespace ICSharpCode.NRefactory.CSharp case UnaryMutator.Mode.PostDecrement: result.Operator = UnaryOperatorType.PostDecrement; result.AddChild (expression, Roles.Expression); - result.AddChild (new CSharpTokenNode (Convert (unaryMutatorExpression.Location)), UnaryOperatorExpression.DecrementRole); + result.AddChild (new CSharpTokenNode (Convert (unaryMutatorExpression.Location), UnaryOperatorExpression.DecrementRole), UnaryOperatorExpression.DecrementRole); break; case UnaryMutator.Mode.PostIncrement: result.Operator = UnaryOperatorType.PostIncrement; result.AddChild (expression, Roles.Expression); - result.AddChild (new CSharpTokenNode (Convert (unaryMutatorExpression.Location)), UnaryOperatorExpression.IncrementRole); + result.AddChild (new CSharpTokenNode (Convert (unaryMutatorExpression.Location), UnaryOperatorExpression.IncrementRole), UnaryOperatorExpression.IncrementRole); break; case UnaryMutator.Mode.PreIncrement: result.Operator = UnaryOperatorType.Increment; - result.AddChild (new CSharpTokenNode (Convert (unaryMutatorExpression.Location)), UnaryOperatorExpression.IncrementRole); + result.AddChild (new CSharpTokenNode (Convert (unaryMutatorExpression.Location), UnaryOperatorExpression.IncrementRole), UnaryOperatorExpression.IncrementRole); result.AddChild (expression, Roles.Expression); break; case UnaryMutator.Mode.PreDecrement: result.Operator = UnaryOperatorType.Decrement; - result.AddChild (new CSharpTokenNode (Convert (unaryMutatorExpression.Location)), UnaryOperatorExpression.DecrementRole); + result.AddChild (new CSharpTokenNode (Convert (unaryMutatorExpression.Location), UnaryOperatorExpression.DecrementRole), UnaryOperatorExpression.DecrementRole); result.AddChild (expression, Roles.Expression); break; } @@ -2250,7 +2254,7 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new UnaryOperatorExpression (); result.Operator = UnaryOperatorType.Dereference; - result.AddChild (new CSharpTokenNode (Convert (indirectionExpression.Location)), UnaryOperatorExpression.DereferenceRole); + result.AddChild (new CSharpTokenNode (Convert (indirectionExpression.Location), UnaryOperatorExpression.DereferenceRole), UnaryOperatorExpression.DereferenceRole); if (indirectionExpression.Expr != null) result.AddChild ((Expression)indirectionExpression.Expr.Accept (this), Roles.Expression); return result; @@ -2261,7 +2265,7 @@ namespace ICSharpCode.NRefactory.CSharp var result = new IsExpression (); if (isExpression.Expr != null) result.AddChild ((Expression)isExpression.Expr.Accept (this), Roles.Expression); - result.AddChild (new CSharpTokenNode (Convert (isExpression.Location)), IsExpression.IsKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (isExpression.Location), IsExpression.IsKeywordRole), IsExpression.IsKeywordRole); if (isExpression.ProbeType != null) result.AddChild (ConvertToType (isExpression.ProbeType), Roles.Type); @@ -2273,7 +2277,7 @@ namespace ICSharpCode.NRefactory.CSharp var result = new AsExpression (); if (asExpression.Expr != null) result.AddChild ((Expression)asExpression.Expr.Accept (this), Roles.Expression); - result.AddChild (new CSharpTokenNode (Convert (asExpression.Location)), AsExpression.AsKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (asExpression.Location), AsExpression.AsKeywordRole), AsExpression.AsKeywordRole); if (asExpression.ProbeType != null) result.AddChild (ConvertToType (asExpression.ProbeType), Roles.Type); return result; @@ -2284,11 +2288,11 @@ namespace ICSharpCode.NRefactory.CSharp var result = new CastExpression (); var location = LocationsBag.GetLocations (castExpression); - result.AddChild (new CSharpTokenNode (Convert (castExpression.Location)), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (castExpression.Location), Roles.LPar), Roles.LPar); if (castExpression.TargetType != null) result.AddChild (ConvertToType (castExpression.TargetType), Roles.Type); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.RPar), Roles.RPar); if (castExpression.Expr != null) result.AddChild ((Expression)castExpression.Expr.Accept (this), Roles.Expression); return result; @@ -2302,15 +2306,15 @@ namespace ICSharpCode.NRefactory.CSharp var spec = composedCast.Spec; while (spec != null) { if (spec.IsNullable) { - result.AddChild (new CSharpTokenNode (Convert (spec.Location)), ComposedType.NullableRole); + result.AddChild (new CSharpTokenNode (Convert (spec.Location), ComposedType.NullableRole), ComposedType.NullableRole); } else if (spec.IsPointer) { - result.AddChild (new CSharpTokenNode (Convert (spec.Location)), ComposedType.PointerRole); + result.AddChild (new CSharpTokenNode (Convert (spec.Location), ComposedType.PointerRole), ComposedType.PointerRole); } else { var aSpec = new ArraySpecifier (); - aSpec.AddChild (new CSharpTokenNode (Convert (spec.Location)), Roles.LBracket); + aSpec.AddChild (new CSharpTokenNode (Convert (spec.Location), Roles.LBracket), Roles.LBracket); var location = LocationsBag.GetLocations (spec); if (location != null) - aSpec.AddChild (new CSharpTokenNode (Convert (spec.Location)), Roles.RBracket); + aSpec.AddChild (new CSharpTokenNode (Convert (spec.Location), Roles.RBracket), Roles.RBracket); result.AddChild (aSpec, ComposedType.ArraySpecifierRole); } spec = spec.Next; @@ -2322,19 +2326,19 @@ namespace ICSharpCode.NRefactory.CSharp public override object Visit (Mono.CSharp.DefaultValueExpression defaultValueExpression) { var result = new DefaultValueExpression (); - result.AddChild (new CSharpTokenNode (Convert (defaultValueExpression.Location)), DefaultValueExpression.DefaultKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (defaultValueExpression.Location), DefaultValueExpression.DefaultKeywordRole), DefaultValueExpression.DefaultKeywordRole); var location = LocationsBag.GetLocations (defaultValueExpression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); result.AddChild (ConvertToType (defaultValueExpression.Expr), Roles.Type); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); return result; } - public override object Visit (Binary binaryExpression) + public override object Visit(Binary binaryExpression) { - var result = new BinaryOperatorExpression (); + var result = new BinaryOperatorExpression(); switch (binaryExpression.Oper) { case Binary.Operator.Multiply: result.Operator = BinaryOperatorType.Multiply; @@ -2393,10 +2397,12 @@ namespace ICSharpCode.NRefactory.CSharp } if (binaryExpression.Left != null) - result.AddChild ((Expression)binaryExpression.Left.Accept (this), BinaryOperatorExpression.LeftRole); - var location = LocationsBag.GetLocations (binaryExpression); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0])), BinaryOperatorExpression.GetOperatorRole (result.Operator)); + result.AddChild((Expression)binaryExpression.Left.Accept(this), BinaryOperatorExpression.LeftRole); + var location = LocationsBag.GetLocations(binaryExpression); + if (location != null) { + var r = BinaryOperatorExpression.GetOperatorRole (result.Operator); + result.AddChild(new CSharpTokenNode(Convert(location [0]), r), r); + } if (binaryExpression.Right != null) result.AddChild ((Expression)binaryExpression.Right.Accept (this), BinaryOperatorExpression.RightRole); return result; @@ -2410,7 +2416,7 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild ((Expression)nullCoalescingOperator.LeftExpression.Accept (this), BinaryOperatorExpression.LeftRole); var location = LocationsBag.GetLocations (nullCoalescingOperator); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0])), BinaryOperatorExpression.NullCoalescingRole); + result.AddChild (new CSharpTokenNode (Convert (location[0]), BinaryOperatorExpression.NullCoalescingRole), BinaryOperatorExpression.NullCoalescingRole); if (nullCoalescingOperator.RightExpression != null) result.AddChild ((Expression)nullCoalescingOperator.RightExpression.Accept (this), BinaryOperatorExpression.RightRole); return result; @@ -2424,11 +2430,11 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild ((Expression)conditionalExpression.Expr.Accept (this), Roles.Condition); var location = LocationsBag.GetLocations (conditionalExpression); - result.AddChild (new CSharpTokenNode (Convert (conditionalExpression.Location)), ConditionalExpression.QuestionMarkRole); + result.AddChild (new CSharpTokenNode (Convert (conditionalExpression.Location), ConditionalExpression.QuestionMarkRole), ConditionalExpression.QuestionMarkRole); if (conditionalExpression.TrueExpr != null) result.AddChild ((Expression)conditionalExpression.TrueExpr.Accept (this), ConditionalExpression.TrueRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), ConditionalExpression.ColonRole); + result.AddChild (new CSharpTokenNode (Convert (location [0]), ConditionalExpression.ColonRole), ConditionalExpression.ColonRole); if (conditionalExpression.FalseExpr != null) result.AddChild ((Expression)conditionalExpression.FalseExpr.Accept (this), ConditionalExpression.FalseRole); return result; @@ -2451,23 +2457,23 @@ namespace ICSharpCode.NRefactory.CSharp case Parameter.Modifier.OUT: parameterDeclarationExpression.ParameterModifier = ParameterModifier.Out; if (location != null) - parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [0])), ParameterDeclaration.OutModifierRole); + parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [0]), ParameterDeclaration.OutModifierRole), ParameterDeclaration.OutModifierRole); break; case Parameter.Modifier.REF: parameterDeclarationExpression.ParameterModifier = ParameterModifier.Ref; if (location != null) - parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [0])), ParameterDeclaration.RefModifierRole); + parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [0]), ParameterDeclaration.RefModifierRole), ParameterDeclaration.RefModifierRole); break; case Parameter.Modifier.PARAMS: parameterDeclarationExpression.ParameterModifier = ParameterModifier.Params; if (location != null) - parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [0])), ParameterDeclaration.ParamsModifierRole); + parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [0]), ParameterDeclaration.ParamsModifierRole), ParameterDeclaration.ParamsModifierRole); break; default: if (p.HasExtensionMethodModifier) { parameterDeclarationExpression.ParameterModifier = ParameterModifier.This; if (location != null) { - parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [0])), ParameterDeclaration.ThisModifierRole); + parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [0]), ParameterDeclaration.ThisModifierRole), ParameterDeclaration.ThisModifierRole); } } break; @@ -2478,12 +2484,12 @@ namespace ICSharpCode.NRefactory.CSharp parameterDeclarationExpression.AddChild (Identifier.Create (p.Name, Convert (p.Location)), Roles.Identifier); if (p.HasDefaultValue) { if (location != null && location.Count > 1) - parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.Assign); + parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.Assign), Roles.Assign); parameterDeclarationExpression.AddChild ((Expression)p.DefaultValue.Accept (this), Roles.Expression); } parent.AddChild (parameterDeclarationExpression, Roles.Parameter); if (paramLocation != null && i < paramLocation.Count) { - parent.AddChild (new CSharpTokenNode (Convert (paramLocation [i])), Roles.Comma); + parent.AddChild (new CSharpTokenNode (Convert (paramLocation [i]), Roles.Comma), Roles.Comma); } } } @@ -2494,10 +2500,10 @@ namespace ICSharpCode.NRefactory.CSharp return; var chevronLocs = LocationsBag.GetLocations (memberName.TypeParameters); if (chevronLocs != null) - parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 2])), Roles.LChevron); + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron); for (int i = 0; i < memberName.TypeParameters.Count; i++) { if (chevronLocs != null && i > 0 && i - 1 < chevronLocs.Count) - parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [i - 1])), Roles.Comma); + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [i - 1]), Roles.Comma), Roles.Comma); var arg = memberName.TypeParameters [i]; if (arg == null) continue; @@ -2509,13 +2515,13 @@ namespace ICSharpCode.NRefactory.CSharp tp.Variance = VarianceModifier.Contravariant; varianceLocation = LocationsBag.GetLocations (arg); if (varianceLocation != null) - tp.AddChild (new CSharpTokenNode (Convert (varianceLocation [0])), TypeParameterDeclaration.InVarianceKeywordRole); + tp.AddChild (new CSharpTokenNode (Convert (varianceLocation [0]), TypeParameterDeclaration.InVarianceKeywordRole), TypeParameterDeclaration.InVarianceKeywordRole); break; case Variance.Covariant: tp.Variance = VarianceModifier.Covariant; varianceLocation = LocationsBag.GetLocations (arg); if (varianceLocation != null) - tp.AddChild (new CSharpTokenNode (Convert (varianceLocation [0])), TypeParameterDeclaration.OutVarianceKeywordRole); + tp.AddChild (new CSharpTokenNode (Convert (varianceLocation [0]), TypeParameterDeclaration.OutVarianceKeywordRole), TypeParameterDeclaration.OutVarianceKeywordRole); break; default: tp.Variance = VarianceModifier.Invariant; @@ -2537,7 +2543,7 @@ namespace ICSharpCode.NRefactory.CSharp parent.AddChild (tp, Roles.TypeParameter); } if (chevronLocs != null) - parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 1])), Roles.RChevron); + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron); } void AddTypeArguments (AstNode parent, MemberName memberName) @@ -2546,7 +2552,7 @@ namespace ICSharpCode.NRefactory.CSharp return; var chevronLocs = LocationsBag.GetLocations (memberName.TypeParameters); if (chevronLocs != null) - parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 2])), Roles.LChevron); + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron); for (int i = 0; i < memberName.TypeParameters.Count; i++) { var arg = memberName.TypeParameters [i]; @@ -2554,11 +2560,11 @@ namespace ICSharpCode.NRefactory.CSharp continue; parent.AddChild (ConvertToType (arg), Roles.TypeArgument); if (chevronLocs != null && i < chevronLocs.Count - 2) - parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [i])), Roles.Comma); + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [i]), Roles.Comma), Roles.Comma); } if (chevronLocs != null) - parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 1])), Roles.RChevron); + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron); } void AddTypeArguments (AstNode parent, ATypeNameExpression memberName) @@ -2567,7 +2573,7 @@ namespace ICSharpCode.NRefactory.CSharp return; var chevronLocs = LocationsBag.GetLocations (memberName.TypeArguments); if (chevronLocs != null) - parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 2])), Roles.LChevron); + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron); for (int i = 0; i < memberName.TypeArguments.Count; i++) { var arg = memberName.TypeArguments.Args [i]; @@ -2575,11 +2581,11 @@ namespace ICSharpCode.NRefactory.CSharp continue; parent.AddChild (ConvertToType (arg), Roles.TypeArgument); if (chevronLocs != null && i < chevronLocs.Count - 2) - parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [i])), Roles.Comma); + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [i]), Roles.Comma), Roles.Comma); } if (chevronLocs != null) - parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 1])), Roles.RChevron); + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron); } void AddConstraints(AstNode parent, TypeParameters d) @@ -2595,17 +2601,17 @@ namespace ICSharpCode.NRefactory.CSharp continue; var location = LocationsBag.GetLocations (c); var constraint = new Constraint (); - constraint.AddChild (new CSharpTokenNode (Convert (c.Location)), Roles.WhereKeyword); + constraint.AddChild (new CSharpTokenNode (Convert (c.Location), Roles.WhereKeyword), Roles.WhereKeyword); constraint.AddChild (new SimpleType (Identifier.Create (c.TypeParameter.Value, Convert (c.TypeParameter.Location))), Roles.ConstraintTypeParameter); if (location != null) - constraint.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Colon); + constraint.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Colon), Roles.Colon); var commaLocs = LocationsBag.GetLocations (c.ConstraintExpressions); int curComma = 0; if (c.ConstraintExpressions != null) { foreach (var expr in c.ConstraintExpressions) { constraint.AddChild (ConvertToType (expr), Roles.BaseType); if (commaLocs != null && curComma < commaLocs.Count) - constraint.AddChild (new CSharpTokenNode (Convert (commaLocs [curComma++])), Roles.Comma); + constraint.AddChild (new CSharpTokenNode (Convert (commaLocs [curComma++]), Roles.Comma), Roles.Comma); } } @@ -2622,14 +2628,16 @@ namespace ICSharpCode.NRefactory.CSharp var loc = LocationsBag.GetLocations (na); if (loc != null) - newArg.AddChild (new CSharpTokenNode (Convert (loc [0])), Roles.Colon); + newArg.AddChild (new CSharpTokenNode (Convert (loc [0]), Roles.Colon), Roles.Colon); if (arg.ArgType == Argument.AType.Out || arg.ArgType == Argument.AType.Ref) { DirectionExpression direction = new DirectionExpression (); direction.FieldDirection = arg.ArgType == Argument.AType.Out ? FieldDirection.Out : FieldDirection.Ref; var argLocation = LocationsBag.GetLocations (arg); - if (argLocation != null) - direction.AddChild (new CSharpTokenNode (Convert (argLocation [0])), arg.ArgType == Argument.AType.Out ? DirectionExpression.OutKeywordRole : DirectionExpression.RefKeywordRole); + if (argLocation != null) { + var r = arg.ArgType == Argument.AType.Out ? DirectionExpression.OutKeywordRole : DirectionExpression.RefKeywordRole; + direction.AddChild (new CSharpTokenNode (Convert (argLocation [0]), r), r); + } direction.AddChild ((Expression)arg.Expr.Accept (this), Roles.Expression); newArg.AddChild (direction, Roles.Expression); } else { @@ -2642,8 +2650,10 @@ namespace ICSharpCode.NRefactory.CSharp DirectionExpression direction = new DirectionExpression (); direction.FieldDirection = arg.ArgType == Argument.AType.Out ? FieldDirection.Out : FieldDirection.Ref; var argLocation = LocationsBag.GetLocations (arg); - if (argLocation != null) - direction.AddChild (new CSharpTokenNode (Convert (argLocation [0])), arg.ArgType == Argument.AType.Out ? DirectionExpression.OutKeywordRole : DirectionExpression.RefKeywordRole); + if (argLocation != null) { + var r = arg.ArgType == Argument.AType.Out ? DirectionExpression.OutKeywordRole : DirectionExpression.RefKeywordRole; + direction.AddChild (new CSharpTokenNode (Convert (argLocation [0]), r), r); + } direction.AddChild ((Expression)arg.Expr.Accept (this), Roles.Expression); return direction; } @@ -2660,11 +2670,11 @@ namespace ICSharpCode.NRefactory.CSharp for (int i = 0; i < args.Count; i++) { parent.AddChild (ConvertArgument (args [i]), Roles.Argument); if (commaLocations != null && i < commaLocations.Count) { - parent.AddChild (new CSharpTokenNode (Convert (commaLocations [i])), Roles.Comma); + parent.AddChild (new CSharpTokenNode (Convert (commaLocations [i]), Roles.Comma), Roles.Comma); } } if (commaLocations != null && commaLocations.Count > args.Count) - parent.AddChild (new CSharpTokenNode (Convert (commaLocations [args.Count])), Roles.Comma); + parent.AddChild (new CSharpTokenNode (Convert (commaLocations [args.Count]), Roles.Comma), Roles.Comma); } public override object Visit (Invocation invocationExpression) @@ -2674,11 +2684,11 @@ namespace ICSharpCode.NRefactory.CSharp if (invocationExpression.Exp != null) result.AddChild ((Expression)invocationExpression.Exp.Accept (this), Roles.TargetExpression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); AddArguments (result, location, invocationExpression.Arguments); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); return result; } @@ -2686,16 +2696,16 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new ObjectCreateExpression (); var location = LocationsBag.GetLocations (newExpression); - result.AddChild (new CSharpTokenNode (Convert (newExpression.Location)), ObjectCreateExpression.NewKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (newExpression.Location), ObjectCreateExpression.NewKeywordRole), ObjectCreateExpression.NewKeywordRole); if (newExpression.TypeRequested != null) result.AddChild (ConvertToType (newExpression.TypeRequested), Roles.Type); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); AddArguments (result, location, newExpression.Arguments); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); return result; } @@ -2704,9 +2714,9 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new AnonymousTypeCreateExpression (); var location = LocationsBag.GetLocations (newAnonymousType); - result.AddChild (new CSharpTokenNode (Convert (newAnonymousType.Location)), ObjectCreateExpression.NewKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (newAnonymousType.Location), ObjectCreateExpression.NewKeywordRole), ObjectCreateExpression.NewKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LBrace); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LBrace), Roles.LBrace); if (newAnonymousType.Parameters != null) { foreach (var par in newAnonymousType.Parameters) { if (par == null) @@ -2719,7 +2729,7 @@ namespace ICSharpCode.NRefactory.CSharp } else { var namedExpression = new NamedExpression (); namedExpression.AddChild (Identifier.Create (par.Name, Convert (par.Location)), Roles.Identifier); - namedExpression.AddChild (new CSharpTokenNode (Convert (parLocation [0])), Roles.Assign); + namedExpression.AddChild (new CSharpTokenNode (Convert (parLocation [0]), Roles.Assign), Roles.Assign); if (par.Expr != null) namedExpression.AddChild ((Expression)par.Expr.Accept (this), Roles.Expression); result.AddChild (namedExpression, Roles.Expression); @@ -2727,7 +2737,7 @@ namespace ICSharpCode.NRefactory.CSharp } } if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RBrace); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RBrace), Roles.RBrace); return result; } @@ -2746,7 +2756,7 @@ namespace ICSharpCode.NRefactory.CSharp var commaLoc = LocationsBag.GetLocations(minit.Initializers); int curComma = 0; if (initLoc != null) - init.AddChild(new CSharpTokenNode(Convert(initLoc [0])), Roles.LBrace); + init.AddChild(new CSharpTokenNode(Convert(initLoc [0]), Roles.LBrace), Roles.LBrace); foreach (var expr in minit.Initializers) { var collectionInit = expr as CollectionElementInitializer; if (collectionInit != null) { @@ -2756,7 +2766,7 @@ namespace ICSharpCode.NRefactory.CSharp // can be identified by expr.IsSingleElement. if (!collectionInit.IsSingle) { parent = new ArrayInitializerExpression(); - parent.AddChild(new CSharpTokenNode(Convert(collectionInit.Location)), Roles.LBrace); + parent.AddChild(new CSharpTokenNode(Convert(collectionInit.Location), Roles.LBrace), Roles.LBrace); } else { parent = ArrayInitializerExpression.CreateSingleElementInitializer (); } @@ -2773,7 +2783,7 @@ namespace ICSharpCode.NRefactory.CSharp if (!collectionInit.IsSingle) { var braceLocs = LocationsBag.GetLocations(expr); if (braceLocs != null) - parent.AddChild(new CSharpTokenNode(Convert(braceLocs [0])), Roles.RBrace); + parent.AddChild(new CSharpTokenNode(Convert(braceLocs [0]), Roles.RBrace), Roles.RBrace); } init.AddChild((ArrayInitializerExpression)parent, Roles.Expression); } else { @@ -2786,7 +2796,7 @@ namespace ICSharpCode.NRefactory.CSharp ); var assignLoc = LocationsBag.GetLocations(eleInit); if (assignLoc != null) - nexpr.AddChild(new CSharpTokenNode(Convert(assignLoc [0])), Roles.Assign); + nexpr.AddChild(new CSharpTokenNode(Convert(assignLoc [0]), Roles.Assign), Roles.Assign); if (eleInit.Source != null) { if (eleInit.Source is CollectionOrObjectInitializers) { var arrInit = new ArrayInitializerExpression(); @@ -2804,13 +2814,13 @@ namespace ICSharpCode.NRefactory.CSharp } } if (commaLoc != null && curComma < commaLoc.Count) - init.AddChild(new CSharpTokenNode(Convert(commaLoc [curComma++])), Roles.Comma); + init.AddChild(new CSharpTokenNode(Convert(commaLoc [curComma++]), Roles.Comma), Roles.Comma); } if (initLoc != null) { if (initLoc.Count == 3) // optional comma - init.AddChild(new CSharpTokenNode(Convert(initLoc [1])), Roles.Comma); - init.AddChild(new CSharpTokenNode(Convert(initLoc [initLoc.Count - 1])), Roles.RBrace); + init.AddChild(new CSharpTokenNode(Convert(initLoc [1]), Roles.Comma), Roles.Comma); + init.AddChild(new CSharpTokenNode(Convert(initLoc [initLoc.Count - 1]), Roles.RBrace), Roles.RBrace); } } @@ -2818,17 +2828,17 @@ namespace ICSharpCode.NRefactory.CSharp public override object Visit (NewInitialize newInitializeExpression) { var result = new ObjectCreateExpression (); - result.AddChild (new CSharpTokenNode (Convert (newInitializeExpression.Location)), ObjectCreateExpression.NewKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (newInitializeExpression.Location), ObjectCreateExpression.NewKeywordRole), ObjectCreateExpression.NewKeywordRole); if (newInitializeExpression.TypeRequested != null) result.AddChild (ConvertToType (newInitializeExpression.TypeRequested), Roles.Type); var location = LocationsBag.GetLocations (newInitializeExpression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); AddArguments (result, location, newInitializeExpression.Arguments); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); var init = ConvertCollectionOrObjectInitializers (newInitializeExpression.Initializers); if (init != null) @@ -2842,7 +2852,7 @@ namespace ICSharpCode.NRefactory.CSharp var result = new ArrayCreateExpression (); var location = LocationsBag.GetLocations (arrayCreationExpression); - result.AddChild (new CSharpTokenNode (Convert (arrayCreationExpression.Location)), ArrayCreateExpression.NewKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (arrayCreationExpression.Location), ArrayCreateExpression.NewKeywordRole), ArrayCreateExpression.NewKeywordRole); if (arrayCreationExpression.TypeExpression != null) result.AddChild (ConvertToType (arrayCreationExpression.TypeExpression), Roles.Type); @@ -2852,26 +2862,26 @@ namespace ICSharpCode.NRefactory.CSharp next = next.Next; if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LBracket); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LBracket), Roles.LBracket); var commaLocations = LocationsBag.GetLocations (arrayCreationExpression.Arguments); for (int i = 0; i < arrayCreationExpression.Arguments.Count; i++) { result.AddChild ((Expression)arrayCreationExpression.Arguments [i].Accept (this), Roles.Argument); if (commaLocations != null && i < commaLocations.Count) - result.AddChild (new CSharpTokenNode (Convert (commaLocations [i])), Roles.Comma); + result.AddChild (new CSharpTokenNode (Convert (commaLocations [i]), Roles.Comma), Roles.Comma); } if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RBracket); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RBracket), Roles.RBracket); } while (next != null) { ArraySpecifier spec = new ArraySpecifier (next.Dimension); var loc = LocationsBag.GetLocations (next); - spec.AddChild (new CSharpTokenNode (Convert (next.Location)), Roles.LBracket); + spec.AddChild (new CSharpTokenNode (Convert (next.Location), Roles.LBracket), Roles.LBracket); result.AddChild (spec, ArrayCreateExpression.AdditionalArraySpecifierRole); if (loc != null) - result.AddChild (new CSharpTokenNode (Convert (loc [0])), Roles.RBracket); + result.AddChild (new CSharpTokenNode (Convert (loc [0]), Roles.RBracket), Roles.RBracket); next = next.Next; } @@ -2879,7 +2889,7 @@ namespace ICSharpCode.NRefactory.CSharp var initLocation = LocationsBag.GetLocations (arrayCreationExpression.Initializers); ArrayInitializerExpression initializer = new ArrayInitializerExpression (); - initializer.AddChild (new CSharpTokenNode (Convert (arrayCreationExpression.Initializers.Location)), Roles.LBrace); + initializer.AddChild (new CSharpTokenNode (Convert (arrayCreationExpression.Initializers.Location), Roles.LBrace), Roles.LBrace); var commaLocations = LocationsBag.GetLocations (arrayCreationExpression.Initializers.Elements); for (int i = 0; i < arrayCreationExpression.Initializers.Count; i++) { var init = arrayCreationExpression.Initializers [i]; @@ -2887,13 +2897,13 @@ namespace ICSharpCode.NRefactory.CSharp continue; initializer.AddChild ((Expression)init.Accept (this), Roles.Expression); if (commaLocations != null && i < commaLocations.Count) { - initializer.AddChild (new CSharpTokenNode (Convert (commaLocations [i])), Roles.Comma); + initializer.AddChild (new CSharpTokenNode (Convert (commaLocations [i]), Roles.Comma), Roles.Comma); } } if (initLocation != null) { if (initLocation.Count == 2) // optional comma - initializer.AddChild (new CSharpTokenNode(Convert(initLocation [0])), Roles.Comma); - initializer.AddChild (new CSharpTokenNode (Convert (initLocation [initLocation.Count - 1])), Roles.RBrace); + initializer.AddChild (new CSharpTokenNode(Convert(initLocation [0]), Roles.Comma), Roles.Comma); + initializer.AddChild (new CSharpTokenNode (Convert (initLocation [initLocation.Count - 1]), Roles.RBrace), Roles.RBrace); } result.AddChild (initializer, ArrayCreateExpression.InitializerRole); } @@ -2913,7 +2923,7 @@ namespace ICSharpCode.NRefactory.CSharp var result = new UndocumentedExpression () { UndocumentedExpressionType = UndocumentedExpressionType.ArgListAccess }; - result.AddChild (new CSharpTokenNode (Convert (argListAccessExpression.Location)), UndocumentedExpression.ArglistKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (argListAccessExpression.Location), UndocumentedExpression.ArglistKeywordRole), UndocumentedExpression.ArglistKeywordRole); return result; } @@ -2921,55 +2931,55 @@ namespace ICSharpCode.NRefactory.CSharp public override object Visit (Arglist argListExpression) { var result = new UndocumentedExpression () { UndocumentedExpressionType = UndocumentedExpressionType.ArgList }; - result.AddChild (new CSharpTokenNode (Convert (argListExpression.Location)), UndocumentedExpression.ArglistKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (argListExpression.Location), UndocumentedExpression.ArglistKeywordRole), UndocumentedExpression.ArglistKeywordRole); var location = LocationsBag.GetLocations (argListExpression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); AddArguments (result, location, argListExpression.Arguments); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); return result; } public override object Visit (MakeRefExpr makeRefExpr) { var result = new UndocumentedExpression () { UndocumentedExpressionType = UndocumentedExpressionType.MakeRef }; - result.AddChild (new CSharpTokenNode (Convert (makeRefExpr.Location)), UndocumentedExpression.MakerefKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (makeRefExpr.Location), UndocumentedExpression.MakerefKeywordRole), UndocumentedExpression.MakerefKeywordRole); var location = LocationsBag.GetLocations (makeRefExpr); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (makeRefExpr.Expr != null) result.AddChild ((Expression)makeRefExpr.Expr.Accept (this), Roles.Argument); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); return result; } public override object Visit (RefTypeExpr refTypeExpr) { var result = new UndocumentedExpression () { UndocumentedExpressionType = UndocumentedExpressionType.RefType }; - result.AddChild (new CSharpTokenNode (Convert (refTypeExpr.Location)), UndocumentedExpression.ReftypeKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (refTypeExpr.Location), UndocumentedExpression.ReftypeKeywordRole), UndocumentedExpression.ReftypeKeywordRole); var location = LocationsBag.GetLocations (refTypeExpr); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (refTypeExpr.Expr != null) result.AddChild ((Expression)refTypeExpr.Expr.Accept (this), Roles.Argument); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); return result; } public override object Visit (RefValueExpr refValueExpr) { var result = new UndocumentedExpression () { UndocumentedExpressionType = UndocumentedExpressionType.RefValue }; - result.AddChild (new CSharpTokenNode (Convert (refValueExpr.Location)), UndocumentedExpression.RefvalueKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (refValueExpr.Location), UndocumentedExpression.RefvalueKeywordRole), UndocumentedExpression.RefvalueKeywordRole); var location = LocationsBag.GetLocations (refValueExpr); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (refValueExpr.Expr != null) @@ -2979,7 +2989,7 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild ((Expression)refValueExpr.FullNamedExpression.Accept (this), Roles.Argument); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); return result; } #endregion @@ -2988,13 +2998,13 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new TypeOfExpression (); var location = LocationsBag.GetLocations (typeOfExpression); - result.AddChild (new CSharpTokenNode (Convert (typeOfExpression.Location)), TypeOfExpression.TypeofKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (typeOfExpression.Location), TypeOfExpression.TypeofKeywordRole), TypeOfExpression.TypeofKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (typeOfExpression.TypeExpression != null) result.AddChild (ConvertToType (typeOfExpression.TypeExpression), Roles.Type); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); return result; } @@ -3002,13 +3012,13 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new SizeOfExpression (); var location = LocationsBag.GetLocations (sizeOfExpression); - result.AddChild (new CSharpTokenNode (Convert (sizeOfExpression.Location)), SizeOfExpression.SizeofKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (sizeOfExpression.Location), SizeOfExpression.SizeofKeywordRole), SizeOfExpression.SizeofKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (sizeOfExpression.TypeExpression != null) result.AddChild (ConvertToType (sizeOfExpression.TypeExpression), Roles.Type); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); return result; } @@ -3016,13 +3026,13 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new CheckedExpression (); var location = LocationsBag.GetLocations (checkedExpression); - result.AddChild (new CSharpTokenNode (Convert (checkedExpression.Location)), CheckedExpression.CheckedKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (checkedExpression.Location), CheckedExpression.CheckedKeywordRole), CheckedExpression.CheckedKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (checkedExpression.Expr != null) result.AddChild ((Expression)checkedExpression.Expr.Accept (this), Roles.Expression); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); return result; } @@ -3030,13 +3040,13 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new UncheckedExpression (); var location = LocationsBag.GetLocations (uncheckedExpression); - result.AddChild (new CSharpTokenNode (Convert (uncheckedExpression.Location)), UncheckedExpression.UncheckedKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (uncheckedExpression.Location), UncheckedExpression.UncheckedKeywordRole), UncheckedExpression.UncheckedKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar); if (uncheckedExpression.Expr != null) result.AddChild ((Expression)uncheckedExpression.Expr.Accept (this), Roles.Expression); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar); return result; } @@ -3047,10 +3057,10 @@ namespace ICSharpCode.NRefactory.CSharp if (elementAccessExpression.Expr != null) result.AddChild ((Expression)elementAccessExpression.Expr.Accept (this), Roles.TargetExpression); - result.AddChild (new CSharpTokenNode (Convert (elementAccessExpression.Location)), Roles.LBracket); + result.AddChild (new CSharpTokenNode (Convert (elementAccessExpression.Location), Roles.LBracket), Roles.LBracket); AddArguments (result, location, elementAccessExpression.Arguments); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.RBracket); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.RBracket), Roles.RBracket); return result; } @@ -3067,15 +3077,15 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetLocations (stackAllocExpression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), StackAllocExpression.StackallocKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [0]), StackAllocExpression.StackallocKeywordRole), StackAllocExpression.StackallocKeywordRole); if (stackAllocExpression.TypeExpression != null) result.AddChild (ConvertToType (stackAllocExpression.TypeExpression), Roles.Type); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), Roles.LBracket); + result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.LBracket), Roles.LBracket); if (stackAllocExpression.CountExpression != null) result.AddChild ((Expression)stackAllocExpression.CountExpression.Accept (this), Roles.Expression); if (location != null && location.Count > 2) - result.AddChild (new CSharpTokenNode (Convert (location [2])), Roles.RBracket); + result.AddChild (new CSharpTokenNode (Convert (location [2]), Roles.RBracket), Roles.RBracket); return result; } @@ -3088,16 +3098,16 @@ namespace ICSharpCode.NRefactory.CSharp result.AddChild ((Expression)simpleAssign.Target.Accept (this), AssignmentExpression.LeftRole); var location = LocationsBag.GetLocations (simpleAssign); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0])), AssignmentExpression.AssignRole); + result.AddChild (new CSharpTokenNode (Convert (location[0]), AssignmentExpression.AssignRole), AssignmentExpression.AssignRole); if (simpleAssign.Source != null) { result.AddChild ((Expression)simpleAssign.Source.Accept (this), AssignmentExpression.RightRole); } return result; } - public override object Visit (CompoundAssign compoundAssign) + public override object Visit(CompoundAssign compoundAssign) { - var result = new AssignmentExpression (); + var result = new AssignmentExpression(); switch (compoundAssign.Op) { case Binary.Operator.Multiply: result.Operator = AssignmentOperatorType.Multiply; @@ -3132,10 +3142,12 @@ namespace ICSharpCode.NRefactory.CSharp } if (compoundAssign.Target != null) - result.AddChild ((Expression)compoundAssign.Target.Accept (this), AssignmentExpression.LeftRole); - var location = LocationsBag.GetLocations (compoundAssign); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0])), AssignmentExpression.GetOperatorRole (result.Operator)); + result.AddChild((Expression)compoundAssign.Target.Accept(this), AssignmentExpression.LeftRole); + var location = LocationsBag.GetLocations(compoundAssign); + if (location != null) { + var r = AssignmentExpression.GetOperatorRole (result.Operator); + result.AddChild(new CSharpTokenNode(Convert(location [0]), r), r); + } if (compoundAssign.Source != null) result.AddChild ((Expression)compoundAssign.Source.Accept (this), AssignmentExpression.RightRole); return result; @@ -3148,16 +3160,16 @@ namespace ICSharpCode.NRefactory.CSharp int l = 0; if (anonymousMethodExpression.IsAsync) { result.IsAsync = true; - result.AddChild (new CSharpTokenNode (Convert (location [l++])), AnonymousMethodExpression.AsyncModifierRole); + result.AddChild (new CSharpTokenNode (Convert (location [l++]), AnonymousMethodExpression.AsyncModifierRole), AnonymousMethodExpression.AsyncModifierRole); } if (location != null) { - result.AddChild (new CSharpTokenNode (Convert (location [l++])), AnonymousMethodExpression.DelegateKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [l++]), AnonymousMethodExpression.DelegateKeywordRole), AnonymousMethodExpression.DelegateKeywordRole); if (location.Count > l) { result.HasParameterList = true; - result.AddChild (new CSharpTokenNode (Convert (location [l++])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [l++]), Roles.LPar), Roles.LPar); AddParameter (result, anonymousMethodExpression.Parameters); - result.AddChild (new CSharpTokenNode (Convert (location [l++])), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [l++]), Roles.RPar), Roles.RPar); } } if (anonymousMethodExpression.Block != null) @@ -3172,19 +3184,19 @@ namespace ICSharpCode.NRefactory.CSharp int l = 0; if (lambdaExpression.IsAsync) { result.IsAsync = true; - result.AddChild (new CSharpTokenNode (Convert (location [l++])), LambdaExpression.AsyncModifierRole); + result.AddChild (new CSharpTokenNode (Convert (location [l++]), LambdaExpression.AsyncModifierRole), LambdaExpression.AsyncModifierRole); } if (location == null || location.Count == l + 1) { AddParameter (result, lambdaExpression.Parameters); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [l++])), LambdaExpression.ArrowRole); + result.AddChild (new CSharpTokenNode (Convert (location [l++]), LambdaExpression.ArrowRole), LambdaExpression.ArrowRole); } else { - result.AddChild (new CSharpTokenNode (Convert (location [l++])), Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (location [l++]), Roles.LPar), Roles.LPar); AddParameter (result, lambdaExpression.Parameters); if (location != null) { - result.AddChild (new CSharpTokenNode (Convert (location [l++])), Roles.RPar); - result.AddChild (new CSharpTokenNode (Convert (location [l++])), LambdaExpression.ArrowRole); + result.AddChild (new CSharpTokenNode (Convert (location [l++]), Roles.RPar), Roles.RPar); + result.AddChild (new CSharpTokenNode (Convert (location [l++]), LambdaExpression.ArrowRole), LambdaExpression.ArrowRole); } } if (lambdaExpression.Block != null) { @@ -3208,7 +3220,7 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new ArrayInitializerExpression (); var location = LocationsBag.GetLocations (arrayInitializer); - result.AddChild (new CSharpTokenNode (Convert (arrayInitializer.Location)), Roles.LBrace); + result.AddChild (new CSharpTokenNode (Convert (arrayInitializer.Location), Roles.LBrace), Roles.LBrace); var commaLocations = LocationsBag.GetLocations (arrayInitializer.Elements); for (int i = 0; i < arrayInitializer.Count; i++) { var init = arrayInitializer [i]; @@ -3216,13 +3228,13 @@ namespace ICSharpCode.NRefactory.CSharp continue; result.AddChild ((Expression)init.Accept (this), Roles.Expression); if (commaLocations != null && i < commaLocations.Count) - result.AddChild (new CSharpTokenNode (Convert (commaLocations [i])), Roles.Comma); + result.AddChild (new CSharpTokenNode (Convert (commaLocations [i]), Roles.Comma), Roles.Comma); } if (location != null) { if (location.Count == 2) // optional comma - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Comma); - result.AddChild (new CSharpTokenNode (Convert (location [location.Count - 1])), Roles.RBrace); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Comma), Roles.Comma); + result.AddChild (new CSharpTokenNode (Convert (location [location.Count - 1]), Roles.RBrace), Roles.RBrace); } return result; } @@ -3266,14 +3278,14 @@ namespace ICSharpCode.NRefactory.CSharp { if (queryStart.Expr == null) { var intoClause = new QueryContinuationClause (); - intoClause.AddChild (new CSharpTokenNode (Convert (queryStart.Location)), QueryContinuationClause.IntoKeywordRole); + intoClause.AddChild (new CSharpTokenNode (Convert (queryStart.Location), QueryContinuationClause.IntoKeywordRole), QueryContinuationClause.IntoKeywordRole); intoClause.AddChild (Identifier.Create (queryStart.IntoVariable.Name, Convert (queryStart.IntoVariable.Location)), Roles.Identifier); return intoClause; } var fromClause = new QueryFromClause (); - fromClause.AddChild (new CSharpTokenNode (Convert (queryStart.Location)), QueryFromClause.FromKeywordRole); + fromClause.AddChild (new CSharpTokenNode (Convert (queryStart.Location), QueryFromClause.FromKeywordRole), QueryFromClause.FromKeywordRole); if (queryStart.IdentifierType != null) fromClause.AddChild (ConvertToType (queryStart.IdentifierType), Roles.Type); @@ -3282,7 +3294,7 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetLocations (queryStart); if (location != null) - fromClause.AddChild (new CSharpTokenNode (Convert (location [0])), QueryFromClause.InKeywordRole); + fromClause.AddChild (new CSharpTokenNode (Convert (location [0]), QueryFromClause.InKeywordRole), QueryFromClause.InKeywordRole); if (queryStart.Expr != null) fromClause.AddChild ((Expression)queryStart.Expr.Accept (this), Roles.Expression); @@ -3293,7 +3305,7 @@ namespace ICSharpCode.NRefactory.CSharp { var fromClause = new QueryFromClause (); - fromClause.AddChild (new CSharpTokenNode (Convert (queryStart.Location)), QueryFromClause.FromKeywordRole); + fromClause.AddChild (new CSharpTokenNode (Convert (queryStart.Location), QueryFromClause.FromKeywordRole), QueryFromClause.FromKeywordRole); if (queryStart.IdentifierType != null) fromClause.AddChild (ConvertToType (queryStart.IdentifierType), Roles.Type); @@ -3302,7 +3314,7 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetLocations (queryStart); if (location != null) - fromClause.AddChild (new CSharpTokenNode (Convert (location [0])), QueryFromClause.InKeywordRole); + fromClause.AddChild (new CSharpTokenNode (Convert (location [0]), QueryFromClause.InKeywordRole), QueryFromClause.InKeywordRole); if (queryStart.Expr != null) fromClause.AddChild ((Expression)queryStart.Expr.Accept (this), Roles.Expression); @@ -3312,7 +3324,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object Visit (Mono.CSharp.Linq.Select sel) { var result = new QuerySelectClause (); - result.AddChild (new CSharpTokenNode (Convert (sel.Location)), QuerySelectClause.SelectKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (sel.Location), QuerySelectClause.SelectKeywordRole), QuerySelectClause.SelectKeywordRole); if (sel.Expr != null) result.AddChild ((Expression)sel.Expr.Accept (this), Roles.Expression); return result; @@ -3322,11 +3334,11 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new QueryGroupClause (); var location = LocationsBag.GetLocations (groupBy); - result.AddChild (new CSharpTokenNode (Convert (groupBy.Location)), QueryGroupClause.GroupKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (groupBy.Location), QueryGroupClause.GroupKeywordRole), QueryGroupClause.GroupKeywordRole); if (groupBy.ElementSelector != null) result.AddChild ((Expression)groupBy.ElementSelector.Accept (this), QueryGroupClause.ProjectionRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), QueryGroupClause.ByKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [0]), QueryGroupClause.ByKeywordRole), QueryGroupClause.ByKeywordRole); if (groupBy.Expr != null) result.AddChild ((Expression)groupBy.Expr.Accept (this), QueryGroupClause.KeyRole); return result; @@ -3337,10 +3349,10 @@ namespace ICSharpCode.NRefactory.CSharp var result = new QueryLetClause (); var location = LocationsBag.GetLocations (l); - result.AddChild (new CSharpTokenNode (Convert (l.Location)), QueryLetClause.LetKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (l.Location), QueryLetClause.LetKeywordRole), QueryLetClause.LetKeywordRole); result.AddChild (Identifier.Create (l.IntoVariable.Name, Convert (l.IntoVariable.Location)), Roles.Identifier); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), Roles.Assign); + result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Assign), Roles.Assign); if (l.Expr != null) result.AddChild ((Expression)l.Expr.Accept (this), Roles.Expression); return result; @@ -3351,7 +3363,7 @@ namespace ICSharpCode.NRefactory.CSharp var result = new QueryWhereClause (); var location = LocationsBag.GetLocations (w); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), QueryWhereClause.WhereKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [0]), QueryWhereClause.WhereKeywordRole), QueryWhereClause.WhereKeywordRole); if (w.Expr != null) result.AddChild ((Expression)w.Expr.Accept (this), Roles.Condition); return result; @@ -3361,24 +3373,24 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new QueryJoinClause (); var location = LocationsBag.GetLocations (join); - result.AddChild (new CSharpTokenNode (Convert (join.Location)), QueryJoinClause.JoinKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (join.Location), QueryJoinClause.JoinKeywordRole), QueryJoinClause.JoinKeywordRole); result.AddChild (Identifier.Create (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), QueryJoinClause.JoinIdentifierRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), QueryJoinClause.InKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [0]), QueryJoinClause.InKeywordRole), QueryJoinClause.InKeywordRole); if (join.Expr != null) result.AddChild ((Expression)join.Expr.Accept (this), QueryJoinClause.InExpressionRole); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), QueryJoinClause.OnKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [1]), QueryJoinClause.OnKeywordRole), QueryJoinClause.OnKeywordRole); var outer = join.OuterSelector.Statements.FirstOrDefault () as ContextualReturn; if (outer != null) result.AddChild ((Expression)outer.Expr.Accept (this), QueryJoinClause.OnExpressionRole); if (location != null && location.Count > 2) - result.AddChild (new CSharpTokenNode (Convert (location [2])), QueryJoinClause.EqualsKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [2]), QueryJoinClause.EqualsKeywordRole), QueryJoinClause.EqualsKeywordRole); var inner = join.InnerSelector.Statements.FirstOrDefault () as ContextualReturn; if (inner != null) @@ -3391,19 +3403,19 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new QueryJoinClause (); var location = LocationsBag.GetLocations (join); - result.AddChild (new CSharpTokenNode (Convert (join.Location)), QueryJoinClause.JoinKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (join.Location), QueryJoinClause.JoinKeywordRole), QueryJoinClause.JoinKeywordRole); // mcs seems to have swapped IntoVariable with JoinVariable, so we'll swap it back here result.AddChild (Identifier.Create (join.IntoVariable.Name, Convert (join.IntoVariable.Location)), QueryJoinClause.JoinIdentifierRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location [0])), QueryJoinClause.InKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [0]), QueryJoinClause.InKeywordRole), QueryJoinClause.InKeywordRole); if (join.Expr != null) result.AddChild ((Expression)join.Expr.Accept (this), QueryJoinClause.InExpressionRole); if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location [1])), QueryJoinClause.OnKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [1]), QueryJoinClause.OnKeywordRole), QueryJoinClause.OnKeywordRole); var outer = join.OuterSelector.Statements.FirstOrDefault () as ContextualReturn; if (outer != null) @@ -3411,13 +3423,13 @@ namespace ICSharpCode.NRefactory.CSharp if (location != null && location.Count > 2) - result.AddChild (new CSharpTokenNode (Convert (location [2])), QueryJoinClause.EqualsKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [2]), QueryJoinClause.EqualsKeywordRole), QueryJoinClause.EqualsKeywordRole); var inner = join.InnerSelector.Statements.FirstOrDefault () as ContextualReturn; if (inner != null) result.AddChild ((Expression)inner.Expr.Accept (this), QueryJoinClause.EqualsExpressionRole); if (location != null && location.Count > 3) - result.AddChild (new CSharpTokenNode (Convert (location [3])), QueryJoinClause.IntoKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location [3]), QueryJoinClause.IntoKeywordRole), QueryJoinClause.IntoKeywordRole); result.AddChild (Identifier.Create (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), QueryJoinClause.IntoIdentifierRole); return result; @@ -3433,7 +3445,7 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetLocations (orderByAscending); if (location != null) { ordering.Direction = QueryOrderingDirection.Ascending; - ordering.AddChild (new CSharpTokenNode (Convert (location [0])), QueryOrdering.AscendingKeywordRole); + ordering.AddChild (new CSharpTokenNode (Convert (location [0]), QueryOrdering.AscendingKeywordRole), QueryOrdering.AscendingKeywordRole); } currentQueryOrderClause.AddChild (ordering, QueryOrderClause.OrderingRole); return currentQueryOrderClause; @@ -3449,7 +3461,7 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetLocations (orderByDescending); if (location != null) { ordering.Direction = QueryOrderingDirection.Descending; - ordering.AddChild (new CSharpTokenNode (Convert (location [0])), QueryOrdering.DescendingKeywordRole); + ordering.AddChild (new CSharpTokenNode (Convert (location [0]), QueryOrdering.DescendingKeywordRole), QueryOrdering.DescendingKeywordRole); } currentQueryOrderClause.AddChild (ordering, QueryOrderClause.OrderingRole); return currentQueryOrderClause; @@ -3463,7 +3475,7 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetLocations (thenByAscending); if (location != null) { ordering.Direction = QueryOrderingDirection.Ascending; - ordering.AddChild (new CSharpTokenNode (Convert (location [0])), QueryOrdering.AscendingKeywordRole); + ordering.AddChild (new CSharpTokenNode (Convert (location [0]), QueryOrdering.AscendingKeywordRole), QueryOrdering.AscendingKeywordRole); } currentQueryOrderClause.AddChild (ordering, QueryOrderClause.OrderingRole); return null; @@ -3477,7 +3489,7 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetLocations (thenByDescending); if (location != null) { ordering.Direction = QueryOrderingDirection.Descending; - ordering.AddChild (new CSharpTokenNode (Convert (location [0])), QueryOrdering.DescendingKeywordRole); + ordering.AddChild (new CSharpTokenNode (Convert (location [0]), QueryOrdering.DescendingKeywordRole), QueryOrdering.DescendingKeywordRole); } currentQueryOrderClause.AddChild (ordering, QueryOrderClause.OrderingRole); return null; @@ -3487,7 +3499,7 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new UnaryOperatorExpression (); result.Operator = UnaryOperatorType.Await; - result.AddChild (new CSharpTokenNode (Convert (awaitExpr.Location)), UnaryOperatorExpression.AwaitRole); + result.AddChild (new CSharpTokenNode (Convert (awaitExpr.Location), UnaryOperatorExpression.AwaitRole), UnaryOperatorExpression.AwaitRole); if (awaitExpr.Expression != null) result.AddChild ((Expression)awaitExpr.Expression.Accept (this), Roles.Expression); return result; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cfold.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cfold.cs index 8724e48b52..e2f6fbdb91 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cfold.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cfold.cs @@ -149,7 +149,7 @@ namespace Mono.CSharp { case Binary.Operator.ExclusiveOr: result = BinaryFold (ec, oper, ((EnumConstant)left).Child, ((EnumConstant)right).Child, loc); if (result != null) - result = result.TryReduce (ec, lt); + result = result.Reduce (ec, lt); return result; /// @@ -158,7 +158,7 @@ namespace Mono.CSharp { case Binary.Operator.Subtraction: result = BinaryFold (ec, oper, ((EnumConstant)left).Child, ((EnumConstant)right).Child, loc); if (result != null) - result = result.TryReduce (ec, EnumSpec.GetUnderlyingType (lt)); + result = result.Reduce (ec, EnumSpec.GetUnderlyingType (lt)); return result; /// @@ -340,7 +340,7 @@ namespace Mono.CSharp { if (result == null) return null; - result = result.TryReduce (ec, lt); + result = result.Reduce (ec, lt); if (result == null) return null; @@ -459,7 +459,7 @@ namespace Mono.CSharp { if (result == null) return null; - result = result.TryReduce (ec, lt); + result = result.Reduce (ec, lt); if (result == null) return null; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/constant.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/constant.cs index 4297c521d1..39e57b2db4 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/constant.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/constant.cs @@ -251,10 +251,12 @@ namespace Mono.CSharp { return this; } - /// - /// Attempts to do a compile-time folding of a constant cast. - /// - public Constant TryReduce (ResolveContext ec, TypeSpec target_type) + // + // Attempts to do a compile-time folding of a constant cast and handles + // error reporting for constant overlows only, on normal conversion + // errors returns null + // + public Constant Reduce (ResolveContext ec, TypeSpec target_type) { try { return TryReduceConstant (ec, target_type); @@ -271,6 +273,15 @@ namespace Mono.CSharp { } } + public Constant TryReduce (ResolveContext rc, TypeSpec targetType) + { + try { + return TryReduceConstant (rc, targetType); + } catch (OverflowException) { + return null; + } + } + Constant TryReduceConstant (ResolveContext ec, TypeSpec target_type) { if (Type == target_type) { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/context.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/context.cs index 7192d305db..a3e7b285dc 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/context.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/context.cs @@ -105,6 +105,24 @@ namespace Mono.CSharp get { return return_type; } } + public bool IsUnreachable { + get { + return HasSet (Options.UnreachableScope); + } + set { + flags = value ? flags | Options.UnreachableScope : flags & ~Options.UnreachableScope; + } + } + + public bool UnreachableReported { + get { + return HasSet (Options.UnreachableReported); + } + set { + flags = value ? flags | Options.UnreachableReported : flags & ~Options.UnreachableScope; + } + } + // // Starts a new code branching. This inherits the state of all local // variables and parameters from the current branching. @@ -257,6 +275,10 @@ namespace Mono.CSharp LockScope = 1 << 13, + UnreachableScope = 1 << 14, + + UnreachableReported = 1 << 15, + /// /// Whether control flow analysis is enabled /// diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/convert.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/convert.cs index f0e743adc5..8230e89708 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/convert.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/convert.cs @@ -1196,7 +1196,7 @@ namespace Mono.CSharp { if (s_x != source_type) { var c = source as Constant; if (c != null) { - source = c.TryReduce (ec, s_x); + source = c.Reduce (ec, s_x); if (source == null) c = null; } @@ -1990,21 +1990,28 @@ namespace Mono.CSharp { if (expr_type == real_target) return EmptyCast.Create (expr, target_type); - ne = ImplicitNumericConversion (expr, real_target); - if (ne != null) - return EmptyCast.Create (ne, target_type); - - ne = ExplicitNumericConversion (ec, expr, real_target); - if (ne != null) - return EmptyCast.Create (ne, target_type); + Constant c = expr as Constant; + if (c != null) { + c = c.TryReduce (ec, real_target); + if (c != null) + return c; + } else { + ne = ImplicitNumericConversion (expr, real_target); + if (ne != null) + return EmptyCast.Create (ne, target_type); - // - // LAMESPEC: IntPtr and UIntPtr conversion to any Enum is allowed - // - if (expr_type.BuiltinType == BuiltinTypeSpec.Type.IntPtr || expr_type.BuiltinType == BuiltinTypeSpec.Type.UIntPtr) { - ne = ExplicitUserConversion (ec, expr, real_target, loc); + ne = ExplicitNumericConversion (ec, expr, real_target); if (ne != null) - return ExplicitConversionCore (ec, ne, target_type, loc); + return EmptyCast.Create (ne, target_type); + + // + // LAMESPEC: IntPtr and UIntPtr conversion to any Enum is allowed + // + if (expr_type.BuiltinType == BuiltinTypeSpec.Type.IntPtr || expr_type.BuiltinType == BuiltinTypeSpec.Type.UIntPtr) { + ne = ExplicitUserConversion (ec, expr, real_target, loc); + if (ne != null) + return ExplicitConversionCore (ec, ne, target_type, loc); + } } } else { ne = ExplicitNumericConversion (ec, expr, target_type); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs index 8aa7ddcb6b..91e8245611 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs @@ -216,6 +216,7 @@ namespace Mono.CSharp //t "$$2 :", //t "$$3 :", //t "namespace_declaration : opt_attributes NAMESPACE namespace_name $$2 OPEN_BRACE $$3 opt_extern_alias_directives opt_using_directives opt_namespace_or_type_declarations CLOSE_BRACE opt_semicolon", +//t "namespace_declaration : opt_attributes NAMESPACE namespace_name", //t "namespace_name : IDENTIFIER", //t "namespace_name : namespace_name DOT IDENTIFIER", //t "namespace_name : error", @@ -387,7 +388,7 @@ namespace Mono.CSharp //t "$$30 :", //t "$$31 :", //t "$$32 :", -//t "indexer_declaration : opt_attributes opt_modifiers member_type indexer_declaration_name OPEN_BRACKET $$30 opt_formal_parameter_list CLOSE_BRACKET OPEN_BRACE $$31 accessor_declarations $$32 CLOSE_BRACE", +//t "indexer_declaration : opt_attributes opt_modifiers member_type indexer_declaration_name OPEN_BRACKET $$30 opt_formal_parameter_list CLOSE_BRACKET $$31 OPEN_BRACE accessor_declarations $$32 CLOSE_BRACE", //t "accessor_declarations : get_accessor_declaration", //t "accessor_declarations : get_accessor_declaration accessor_declarations", //t "accessor_declarations : set_accessor_declaration", @@ -1478,20 +1479,20 @@ case 25: case 26: case_26(); break; -case 39: - case_39(); +case 27: + case_27(); break; case 40: -#line 616 "cs-parser.jay" + case_40(); + break; +case 41: +#line 625 "cs-parser.jay" { current_namespace.DeclarationFound = true; } break; -case 41: - case_41(); - break; -case 49: - case_49(); +case 42: + case_42(); break; case 50: case_50(); @@ -1515,47 +1516,47 @@ case 56: case_56(); break; case 57: -#line 730 "cs-parser.jay" - { yyVal = "event"; savedCloseLocation = GetLocation (yyVals[0+yyTop]); } + case_57(); break; case 58: -#line 731 "cs-parser.jay" - { yyVal = "return"; savedCloseLocation = GetLocation (yyVals[0+yyTop]); } +#line 739 "cs-parser.jay" + { yyVal = "event"; savedCloseLocation = GetLocation (yyVals[0+yyTop]); } break; case 59: - case_59(); +#line 740 "cs-parser.jay" + { yyVal = "return"; savedCloseLocation = GetLocation (yyVals[0+yyTop]); } break; case 60: -#line 748 "cs-parser.jay" + case_60(); + break; +case 61: +#line 757 "cs-parser.jay" { yyVal = new List (4) { (Attribute) yyVals[0+yyTop] }; } break; -case 61: - case_61(); - break; case 62: -#line 763 "cs-parser.jay" + case_62(); + break; +case 63: +#line 772 "cs-parser.jay" { ++lexer.parsing_block; } break; -case 63: - case_63(); - break; -case 65: -#line 791 "cs-parser.jay" - { yyVal = null; HadAttributeParens = false; } +case 64: + case_64(); break; case 66: - case_66(); +#line 800 "cs-parser.jay" + { yyVal = null; HadAttributeParens = false; } break; case 67: -#line 803 "cs-parser.jay" - { yyVal = null; } + case_67(); break; case 68: - case_68(); +#line 812 "cs-parser.jay" + { yyVal = null; } break; case 69: case_69(); @@ -1567,63 +1568,63 @@ case 71: case_71(); break; case 72: -#line 847 "cs-parser.jay" + case_72(); + break; +case 73: +#line 856 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; -case 74: -#line 855 "cs-parser.jay" +case 75: +#line 864 "cs-parser.jay" { ++lexer.parsing_block; } break; -case 75: - case_75(); - break; case 76: case_76(); break; case 77: -#line 881 "cs-parser.jay" - { yyVal = null; } + case_77(); break; case 78: -#line 885 "cs-parser.jay" +#line 890 "cs-parser.jay" + { yyVal = null; } + break; +case 79: +#line 894 "cs-parser.jay" { yyVal = Argument.AType.Ref; } break; -case 79: -#line 889 "cs-parser.jay" +case 80: +#line 898 "cs-parser.jay" { yyVal = Argument.AType.Out; } break; -case 82: -#line 901 "cs-parser.jay" +case 83: +#line 910 "cs-parser.jay" { lexer.parsing_modifiers = true; } break; -case 83: -#line 905 "cs-parser.jay" +case 84: +#line 914 "cs-parser.jay" { lexer.parsing_modifiers = true; } break; -case 95: - case_95(); - break; case 96: -#line 936 "cs-parser.jay" + case_96(); + break; +case 97: +#line 945 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; -case 97: - case_97(); - break; case 98: case_98(); break; @@ -1637,46 +1638,46 @@ case 101: case_101(); break; case 102: -#line 979 "cs-parser.jay" + case_102(); + break; +case 103: +#line 988 "cs-parser.jay" { Error_SyntaxError (yyToken); } break; -case 103: - case_103(); - break; case 104: case_104(); break; -case 107: -#line 1020 "cs-parser.jay" - { - current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); - } +case 105: + case_105(); break; case 108: -#line 1024 "cs-parser.jay" +#line 1029 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 109: - case_109(); +#line 1033 "cs-parser.jay" + { + current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); + } break; case 110: -#line 1040 "cs-parser.jay" + case_110(); + break; +case 111: +#line 1049 "cs-parser.jay" { ++lexer.parsing_block; } break; -case 111: - case_111(); - break; case 112: case_112(); break; -case 115: - case_115(); +case 113: + case_113(); break; case 116: case_116(); @@ -1688,70 +1689,70 @@ case 118: case_118(); break; case 119: -#line 1119 "cs-parser.jay" + case_119(); + break; +case 120: +#line 1128 "cs-parser.jay" { report.Error (1641, GetLocation (yyVals[-1+yyTop]), "A fixed size buffer field must have the array size specifier after the field name"); } break; -case 121: - case_121(); - break; case 122: case_122(); break; -case 125: -#line 1149 "cs-parser.jay" - { - current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); - } +case 123: + case_123(); break; case 126: -#line 1153 "cs-parser.jay" +#line 1158 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 127: - case_127(); +#line 1162 "cs-parser.jay" + { + current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); + } break; case 128: -#line 1166 "cs-parser.jay" + case_128(); + break; +case 129: +#line 1175 "cs-parser.jay" { ++lexer.parsing_block; } break; -case 129: - case_129(); +case 130: + case_130(); break; -case 132: -#line 1185 "cs-parser.jay" +case 133: +#line 1194 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; -case 133: -#line 1189 "cs-parser.jay" +case 134: +#line 1198 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; -case 134: - case_134(); - break; case 135: -#line 1205 "cs-parser.jay" + case_135(); + break; +case 136: +#line 1214 "cs-parser.jay" { ++lexer.parsing_block; } break; -case 136: - case_136(); - break; case 137: case_137(); break; -case 140: - case_140(); +case 138: + case_138(); break; case 141: case_141(); @@ -1760,54 +1761,54 @@ case 142: case_142(); break; case 143: -#line 1276 "cs-parser.jay" + case_143(); + break; +case 144: +#line 1285 "cs-parser.jay" { valid_param_mod = ParameterModifierType.All; } break; -case 144: -#line 1280 "cs-parser.jay" +case 145: +#line 1289 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; -case 145: - case_145(); - break; case 146: -#line 1306 "cs-parser.jay" + case_146(); + break; +case 147: +#line 1315 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; -case 147: - case_147(); - break; case 148: -#line 1316 "cs-parser.jay" + case_148(); + break; +case 149: +#line 1325 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; -case 149: - case_149(); - break; case 150: case_150(); break; case 151: case_151(); break; -case 153: -#line 1381 "cs-parser.jay" - { savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; } +case 152: + case_152(); break; case 154: -#line 1385 "cs-parser.jay" - { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } +#line 1390 "cs-parser.jay" + { savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; } break; -case 156: - case_156(); +case 155: +#line 1394 "cs-parser.jay" + { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 157: case_157(); @@ -1828,20 +1829,20 @@ case 162: case_162(); break; case 163: -#line 1457 "cs-parser.jay" + case_163(); + break; +case 164: +#line 1466 "cs-parser.jay" { yyVal = new ParametersCompiled (new Parameter[] { (Parameter) yyVals[0+yyTop] } ); } break; -case 164: -#line 1461 "cs-parser.jay" +case 165: +#line 1470 "cs-parser.jay" { yyVal = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation (yyVals[0+yyTop])) }, true); } break; -case 165: - case_165(); - break; case 166: case_166(); break; @@ -1861,27 +1862,27 @@ case 171: case_171(); break; case 172: -#line 1542 "cs-parser.jay" + case_172(); + break; +case 173: +#line 1551 "cs-parser.jay" { ++lexer.parsing_block; } break; -case 173: - case_173(); - break; case 174: -#line 1583 "cs-parser.jay" + case_174(); + break; +case 175: +#line 1592 "cs-parser.jay" { yyVal = Parameter.Modifier.NONE; } break; -case 176: -#line 1591 "cs-parser.jay" +case 177: +#line 1600 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; -case 177: - case_177(); - break; case 178: case_178(); break; @@ -1907,14 +1908,14 @@ case 185: case_185(); break; case 186: -#line 1685 "cs-parser.jay" + case_186(); + break; +case 187: +#line 1694 "cs-parser.jay" { Error_DuplicateParameterModifier (GetLocation (yyVals[-1+yyTop]), Parameter.Modifier.PARAMS); } break; -case 187: - case_187(); - break; case 188: case_188(); break; @@ -1928,25 +1929,25 @@ case 191: case_191(); break; case 192: -#line 1739 "cs-parser.jay" + case_192(); + break; +case 193: +#line 1748 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Params | ParameterModifierType.DefaultValue; } break; -case 193: - case_193(); - break; case 194: -#line 1768 "cs-parser.jay" + case_194(); + break; +case 195: +#line 1777 "cs-parser.jay" { lexer.PropertyParsing = false; } break; -case 195: - case_195(); - break; -case 200: - case_200(); +case 196: + case_196(); break; case 201: case_201(); @@ -1960,21 +1961,21 @@ case 203: case 204: case_204(); break; -case 206: - case_206(); +case 205: + case_205(); break; case 207: case_207(); break; case 208: -#line 1917 "cs-parser.jay" + case_208(); + break; +case 209: +#line 1926 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; -case 209: - case_209(); - break; case 210: case_210(); break; @@ -1985,183 +1986,183 @@ case 212: case_212(); break; case 213: -#line 1956 "cs-parser.jay" + case_213(); + break; +case 214: +#line 1965 "cs-parser.jay" { Error_SyntaxError (yyToken); } break; -case 216: -#line 1968 "cs-parser.jay" +case 217: +#line 1977 "cs-parser.jay" { lexer.parsing_modifiers = true; } break; -case 217: -#line 1972 "cs-parser.jay" +case 218: +#line 1981 "cs-parser.jay" { lexer.parsing_modifiers = true; } break; -case 218: -#line 1979 "cs-parser.jay" +case 219: +#line 1988 "cs-parser.jay" { report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; -case 219: -#line 1983 "cs-parser.jay" +case 220: +#line 1992 "cs-parser.jay" { report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; -case 224: -#line 1991 "cs-parser.jay" +case 225: +#line 2000 "cs-parser.jay" { report.Error (567, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain operators"); } break; -case 225: -#line 1995 "cs-parser.jay" +case 226: +#line 2004 "cs-parser.jay" { report.Error (526, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain contructors"); } break; -case 226: -#line 1999 "cs-parser.jay" +case 227: +#line 2008 "cs-parser.jay" { report.Error (524, GetLocation (yyVals[0+yyTop]), "Interfaces cannot declare classes, structs, interfaces, delegates, or enumerations"); } break; -case 227: -#line 2005 "cs-parser.jay" +case 228: +#line 2014 "cs-parser.jay" { } break; -case 228: - case_228(); +case 229: + case_229(); break; -case 230: -#line 2038 "cs-parser.jay" +case 231: +#line 2047 "cs-parser.jay" { savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; } break; -case 232: - case_232(); - break; case 233: -#line 2054 "cs-parser.jay" + case_233(); + break; +case 234: +#line 2063 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; -case 234: - case_234(); +case 235: + case_235(); break; -case 236: -#line 2100 "cs-parser.jay" +case 237: +#line 2109 "cs-parser.jay" { yyVal = Operator.OpType.LogicalNot; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 237: -#line 2101 "cs-parser.jay" +case 238: +#line 2110 "cs-parser.jay" { yyVal = Operator.OpType.OnesComplement; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 238: -#line 2102 "cs-parser.jay" +case 239: +#line 2111 "cs-parser.jay" { yyVal = Operator.OpType.Increment; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 239: -#line 2103 "cs-parser.jay" +case 240: +#line 2112 "cs-parser.jay" { yyVal = Operator.OpType.Decrement; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 240: -#line 2104 "cs-parser.jay" +case 241: +#line 2113 "cs-parser.jay" { yyVal = Operator.OpType.True; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 241: -#line 2105 "cs-parser.jay" +case 242: +#line 2114 "cs-parser.jay" { yyVal = Operator.OpType.False; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 242: -#line 2107 "cs-parser.jay" +case 243: +#line 2116 "cs-parser.jay" { yyVal = Operator.OpType.Addition; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 243: -#line 2108 "cs-parser.jay" +case 244: +#line 2117 "cs-parser.jay" { yyVal = Operator.OpType.Subtraction; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 244: -#line 2110 "cs-parser.jay" +case 245: +#line 2119 "cs-parser.jay" { yyVal = Operator.OpType.Multiply; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 245: -#line 2111 "cs-parser.jay" +case 246: +#line 2120 "cs-parser.jay" { yyVal = Operator.OpType.Division; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 246: -#line 2112 "cs-parser.jay" +case 247: +#line 2121 "cs-parser.jay" { yyVal = Operator.OpType.Modulus; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 247: -#line 2113 "cs-parser.jay" +case 248: +#line 2122 "cs-parser.jay" { yyVal = Operator.OpType.BitwiseAnd; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 248: -#line 2114 "cs-parser.jay" +case 249: +#line 2123 "cs-parser.jay" { yyVal = Operator.OpType.BitwiseOr; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 249: -#line 2115 "cs-parser.jay" +case 250: +#line 2124 "cs-parser.jay" { yyVal = Operator.OpType.ExclusiveOr; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 250: -#line 2116 "cs-parser.jay" +case 251: +#line 2125 "cs-parser.jay" { yyVal = Operator.OpType.LeftShift; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 251: -#line 2117 "cs-parser.jay" +case 252: +#line 2126 "cs-parser.jay" { yyVal = Operator.OpType.RightShift; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 252: -#line 2118 "cs-parser.jay" +case 253: +#line 2127 "cs-parser.jay" { yyVal = Operator.OpType.Equality; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 253: -#line 2119 "cs-parser.jay" +case 254: +#line 2128 "cs-parser.jay" { yyVal = Operator.OpType.Inequality; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 254: -#line 2120 "cs-parser.jay" +case 255: +#line 2129 "cs-parser.jay" { yyVal = Operator.OpType.GreaterThan; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 255: -#line 2121 "cs-parser.jay" +case 256: +#line 2130 "cs-parser.jay" { yyVal = Operator.OpType.LessThan; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 256: -#line 2122 "cs-parser.jay" +case 257: +#line 2131 "cs-parser.jay" { yyVal = Operator.OpType.GreaterThanOrEqual; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 257: -#line 2123 "cs-parser.jay" +case 258: +#line 2132 "cs-parser.jay" { yyVal = Operator.OpType.LessThanOrEqual; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; -case 258: -#line 2130 "cs-parser.jay" +case 259: +#line 2139 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; -case 259: - case_259(); - break; case 260: -#line 2149 "cs-parser.jay" + case_260(); + break; +case 261: +#line 2158 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; -case 261: - case_261(); - break; case 262: case_262(); break; @@ -2180,28 +2181,28 @@ case 266: case 267: case_267(); break; -case 269: -#line 2255 "cs-parser.jay" +case 268: + case_268(); + break; +case 270: +#line 2264 "cs-parser.jay" { current_block = null; yyVal = null; } break; -case 272: -#line 2267 "cs-parser.jay" +case 273: +#line 2276 "cs-parser.jay" { ++lexer.parsing_block; } break; -case 273: - case_273(); - break; case 274: -#line 2277 "cs-parser.jay" + case_274(); + break; +case 275: +#line 2286 "cs-parser.jay" { ++lexer.parsing_block; } break; -case 275: - case_275(); - break; case 276: case_276(); break; @@ -2229,51 +2230,51 @@ case 283: case 284: case_284(); break; -case 286: -#line 2393 "cs-parser.jay" +case 285: + case_285(); + break; +case 287: +#line 2402 "cs-parser.jay" { ++lexer.parsing_block; } break; -case 287: - case_287(); +case 288: + case_288(); break; -case 290: -#line 2410 "cs-parser.jay" +case 291: +#line 2419 "cs-parser.jay" { current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; -case 291: -#line 2414 "cs-parser.jay" +case 292: +#line 2423 "cs-parser.jay" { current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; -case 292: - case_292(); - break; case 293: -#line 2427 "cs-parser.jay" + case_293(); + break; +case 294: +#line 2436 "cs-parser.jay" { ++lexer.parsing_block; } break; -case 294: - case_294(); - break; case 295: case_295(); break; case 296: -#line 2452 "cs-parser.jay" + case_296(); + break; +case 297: +#line 2461 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; -case 299: - case_299(); - break; case 300: case_300(); break; @@ -2295,8 +2296,8 @@ case 305: case 306: case_306(); break; -case 308: - case_308(); +case 307: + case_307(); break; case 309: case_309(); @@ -2310,21 +2311,21 @@ case 311: case 312: case_312(); break; -case 314: - case_314(); +case 313: + case_313(); break; case 315: case_315(); break; -case 318: -#line 2620 "cs-parser.jay" +case 316: + case_316(); + break; +case 319: +#line 2629 "cs-parser.jay" { lbag.AppendToMember (current_container, GetLocation (yyVals[0+yyTop])); } break; -case 320: - case_320(); - break; case 321: case_321(); break; @@ -2337,38 +2338,38 @@ case 323: case 324: case_324(); break; -case 326: -#line 2694 "cs-parser.jay" +case 325: + case_325(); + break; +case 327: +#line 2703 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out | ParameterModifierType.Params | ParameterModifierType.DefaultValue; } break; -case 327: - case_327(); - break; case 328: -#line 2713 "cs-parser.jay" + case_328(); + break; +case 329: +#line 2722 "cs-parser.jay" { lexer.ConstraintsParsing = false; } break; -case 329: - case_329(); - break; -case 331: - case_331(); +case 330: + case_330(); break; -case 333: - case_333(); +case 332: + case_332(); break; -case 335: - case_335(); +case 334: + case_334(); break; case 336: case_336(); break; -case 338: - case_338(); +case 337: + case_337(); break; case 339: case_339(); @@ -2380,19 +2381,19 @@ case 341: case_341(); break; case 342: -#line 2819 "cs-parser.jay" + case_342(); + break; +case 343: +#line 2828 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; -case 343: - case_343(); - break; case 344: case_344(); break; -case 346: - case_346(); +case 345: + case_345(); break; case 347: case_347(); @@ -2409,8 +2410,8 @@ case 350: case 351: case_351(); break; -case 353: - case_353(); +case 352: + case_352(); break; case 354: case_354(); @@ -2424,60 +2425,60 @@ case 356: case 357: case_357(); break; -case 359: -#line 2941 "cs-parser.jay" +case 358: + case_358(); + break; +case 360: +#line 2950 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } break; -case 360: -#line 2948 "cs-parser.jay" +case 361: +#line 2957 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; -case 362: - case_362(); +case 363: + case_363(); break; -case 364: - case_364(); +case 365: + case_365(); break; -case 366: - case_366(); +case 367: + case_367(); break; -case 368: -#line 2986 "cs-parser.jay" +case 369: +#line 2995 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; -case 369: - case_369(); - break; case 370: -#line 3005 "cs-parser.jay" + case_370(); + break; +case 371: +#line 3014 "cs-parser.jay" { yyVal = new ComposedCast ((ATypeNameExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; -case 371: - case_371(); - break; case 372: -#line 3014 "cs-parser.jay" + case_372(); + break; +case 373: +#line 3023 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; -case 373: -#line 3018 "cs-parser.jay" +case 374: +#line 3027 "cs-parser.jay" { yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; -case 374: - case_374(); - break; case 375: case_375(); break; @@ -2485,95 +2486,95 @@ case 376: case_376(); break; case 377: -#line 3052 "cs-parser.jay" - { yyVal = new TypeExpression (compiler.BuiltinTypes.Object, GetLocation (yyVals[0+yyTop])); } + case_377(); break; case 378: -#line 3053 "cs-parser.jay" - { yyVal = new TypeExpression (compiler.BuiltinTypes.String, GetLocation (yyVals[0+yyTop])); } +#line 3061 "cs-parser.jay" + { yyVal = new TypeExpression (compiler.BuiltinTypes.Object, GetLocation (yyVals[0+yyTop])); } break; case 379: -#line 3054 "cs-parser.jay" - { yyVal = new TypeExpression (compiler.BuiltinTypes.Bool, GetLocation (yyVals[0+yyTop])); } +#line 3062 "cs-parser.jay" + { yyVal = new TypeExpression (compiler.BuiltinTypes.String, GetLocation (yyVals[0+yyTop])); } break; case 380: -#line 3055 "cs-parser.jay" - { yyVal = new TypeExpression (compiler.BuiltinTypes.Decimal, GetLocation (yyVals[0+yyTop])); } +#line 3063 "cs-parser.jay" + { yyVal = new TypeExpression (compiler.BuiltinTypes.Bool, GetLocation (yyVals[0+yyTop])); } break; case 381: -#line 3056 "cs-parser.jay" - { yyVal = new TypeExpression (compiler.BuiltinTypes.Float, GetLocation (yyVals[0+yyTop])); } +#line 3064 "cs-parser.jay" + { yyVal = new TypeExpression (compiler.BuiltinTypes.Decimal, GetLocation (yyVals[0+yyTop])); } break; case 382: -#line 3057 "cs-parser.jay" +#line 3065 "cs-parser.jay" + { yyVal = new TypeExpression (compiler.BuiltinTypes.Float, GetLocation (yyVals[0+yyTop])); } + break; +case 383: +#line 3066 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Double, GetLocation (yyVals[0+yyTop])); } break; -case 384: -#line 3062 "cs-parser.jay" +case 385: +#line 3071 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.SByte, GetLocation (yyVals[0+yyTop])); } break; -case 385: -#line 3063 "cs-parser.jay" +case 386: +#line 3072 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Byte, GetLocation (yyVals[0+yyTop])); } break; -case 386: -#line 3064 "cs-parser.jay" +case 387: +#line 3073 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Short, GetLocation (yyVals[0+yyTop])); } break; -case 387: -#line 3065 "cs-parser.jay" +case 388: +#line 3074 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.UShort, GetLocation (yyVals[0+yyTop])); } break; -case 388: -#line 3066 "cs-parser.jay" +case 389: +#line 3075 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Int, GetLocation (yyVals[0+yyTop])); } break; -case 389: -#line 3067 "cs-parser.jay" +case 390: +#line 3076 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.UInt, GetLocation (yyVals[0+yyTop])); } break; -case 390: -#line 3068 "cs-parser.jay" +case 391: +#line 3077 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Long, GetLocation (yyVals[0+yyTop])); } break; -case 391: -#line 3069 "cs-parser.jay" +case 392: +#line 3078 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.ULong, GetLocation (yyVals[0+yyTop])); } break; -case 392: -#line 3070 "cs-parser.jay" +case 393: +#line 3079 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Char, GetLocation (yyVals[0+yyTop])); } break; -case 413: - case_413(); - break; case 414: case_414(); break; -case 418: -#line 3117 "cs-parser.jay" - { yyVal = new NullLiteral (GetLocation (yyVals[0+yyTop])); } +case 415: + case_415(); break; case 419: -#line 3121 "cs-parser.jay" - { yyVal = new BoolLiteral (compiler.BuiltinTypes, true, GetLocation (yyVals[0+yyTop])); } +#line 3126 "cs-parser.jay" + { yyVal = new NullLiteral (GetLocation (yyVals[0+yyTop])); } break; case 420: -#line 3122 "cs-parser.jay" - { yyVal = new BoolLiteral (compiler.BuiltinTypes, false, GetLocation (yyVals[0+yyTop])); } +#line 3130 "cs-parser.jay" + { yyVal = new BoolLiteral (compiler.BuiltinTypes, true, GetLocation (yyVals[0+yyTop])); } break; -case 425: - case_425(); +case 421: +#line 3131 "cs-parser.jay" + { yyVal = new BoolLiteral (compiler.BuiltinTypes, false, GetLocation (yyVals[0+yyTop])); } break; case 426: -#line 3155 "cs-parser.jay" + case_426(); + break; +case 427: +#line 3164 "cs-parser.jay" { yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop]); } break; -case 427: - case_427(); - break; case 428: case_428(); break; @@ -2584,23 +2585,23 @@ case 430: case_430(); break; case 431: -#line 3190 "cs-parser.jay" + case_431(); + break; +case 432: +#line 3199 "cs-parser.jay" { yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null,GetLocation (yyVals[0+yyTop])); } break; -case 432: - case_432(); - break; case 433: -#line 3198 "cs-parser.jay" + case_433(); + break; +case 434: +#line 3207 "cs-parser.jay" { yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null, lexer.Location); } break; -case 434: - case_434(); - break; case 435: case_435(); break; @@ -2608,28 +2609,28 @@ case 436: case_436(); break; case 437: -#line 3222 "cs-parser.jay" - { yyVal = null; } + case_437(); break; -case 439: - case_439(); +case 438: +#line 3231 "cs-parser.jay" + { yyVal = null; } break; case 440: case_440(); break; case 441: -#line 3245 "cs-parser.jay" - { yyVal = null; } + case_441(); break; case 442: -#line 3249 "cs-parser.jay" +#line 3254 "cs-parser.jay" + { yyVal = null; } + break; +case 443: +#line 3258 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; -case 443: - case_443(); - break; case 444: case_444(); break; @@ -2640,26 +2641,26 @@ case 446: case_446(); break; case 447: -#line 3282 "cs-parser.jay" + case_447(); + break; +case 448: +#line 3291 "cs-parser.jay" { yyVal = new CompletionElementInitializer (null, GetLocation (yyVals[0+yyTop])); } break; -case 448: - case_448(); - break; case 449: case_449(); break; case 450: case_450(); break; -case 453: -#line 3313 "cs-parser.jay" - { yyVal = null; } +case 451: + case_451(); break; -case 455: - case_455(); +case 454: +#line 3322 "cs-parser.jay" + { yyVal = null; } break; case 456: case_456(); @@ -2674,14 +2675,14 @@ case 459: case_459(); break; case 460: -#line 3366 "cs-parser.jay" + case_460(); + break; +case 461: +#line 3376 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; -case 464: - case_464(); - break; case 465: case_465(); break; @@ -2691,8 +2692,8 @@ case 466: case 467: case_467(); break; -case 469: - case_469(); +case 468: + case_468(); break; case 470: case_470(); @@ -2716,38 +2717,38 @@ case 476: case_476(); break; case 477: -#line 3463 "cs-parser.jay" + case_477(); + break; +case 478: +#line 3473 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; -case 479: -#line 3471 "cs-parser.jay" +case 480: +#line 3481 "cs-parser.jay" { yyVal = new This (GetLocation (yyVals[0+yyTop])); } break; -case 480: - case_480(); - break; case 481: case_481(); break; case 482: -#line 3491 "cs-parser.jay" + case_482(); + break; +case 483: +#line 3501 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PostIncrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; -case 483: -#line 3498 "cs-parser.jay" +case 484: +#line 3508 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PostDecrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; -case 484: - case_484(); - break; case 485: case_485(); break; @@ -2767,23 +2768,23 @@ case 490: case_490(); break; case 491: -#line 3565 "cs-parser.jay" + case_491(); + break; +case 492: +#line 3575 "cs-parser.jay" { ++lexer.parsing_type; } break; -case 492: - case_492(); - break; case 493: case_493(); break; -case 496: -#line 3592 "cs-parser.jay" - { yyVal = null; } +case 494: + case_494(); break; -case 498: - case_498(); +case 497: +#line 3602 "cs-parser.jay" + { yyVal = null; } break; case 499: case_499(); @@ -2800,8 +2801,8 @@ case 502: case 503: case_503(); break; -case 507: - case_507(); +case 504: + case_504(); break; case 508: case_508(); @@ -2810,32 +2811,32 @@ case 509: case_509(); break; case 510: -#line 3670 "cs-parser.jay" + case_510(); + break; +case 511: +#line 3680 "cs-parser.jay" { yyVal = 2; } break; -case 511: -#line 3674 "cs-parser.jay" +case 512: +#line 3684 "cs-parser.jay" { yyVal = ((int) yyVals[-1+yyTop]) + 1; } break; -case 512: -#line 3681 "cs-parser.jay" +case 513: +#line 3691 "cs-parser.jay" { yyVal = null; } break; -case 513: -#line 3685 "cs-parser.jay" +case 514: +#line 3695 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; -case 514: - case_514(); - break; case 515: case_515(); break; @@ -2846,16 +2847,16 @@ case 517: case_517(); break; case 518: -#line 3729 "cs-parser.jay" + case_518(); + break; +case 519: +#line 3739 "cs-parser.jay" { lexer.TypeOfParsing = true; } break; -case 519: - case_519(); - break; -case 522: - case_522(); +case 520: + case_520(); break; case 523: case_523(); @@ -2891,130 +2892,130 @@ case 533: case_533(); break; case 534: -#line 3849 "cs-parser.jay" + case_534(); + break; +case 535: +#line 3859 "cs-parser.jay" { start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], false, GetLocation (yyVals[-1+yyTop])); } break; -case 535: - case_535(); - break; case 536: -#line 3862 "cs-parser.jay" + case_536(); + break; +case 537: +#line 3872 "cs-parser.jay" { start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], true, GetLocation (yyVals[-2+yyTop])); } break; -case 537: - case_537(); - break; case 538: -#line 3879 "cs-parser.jay" + case_538(); + break; +case 539: +#line 3889 "cs-parser.jay" { yyVal = ParametersCompiled.Undefined; } break; -case 540: -#line 3887 "cs-parser.jay" +case 541: +#line 3897 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; -case 541: - case_541(); - break; case 542: case_542(); break; -case 544: -#line 3913 "cs-parser.jay" +case 543: + case_543(); + break; +case 545: +#line 3923 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.LogicalNot, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 545: -#line 3917 "cs-parser.jay" +case 546: +#line 3927 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.OnesComplement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 546: - case_546(); - break; case 547: case_547(); break; -case 549: -#line 3953 "cs-parser.jay" +case 548: + case_548(); + break; +case 550: +#line 3963 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.UnaryPlus, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 550: -#line 3957 "cs-parser.jay" +case 551: +#line 3967 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.UnaryNegation, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 551: -#line 3961 "cs-parser.jay" +case 552: +#line 3971 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PreIncrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 552: -#line 3965 "cs-parser.jay" +case 553: +#line 3975 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PreDecrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 553: -#line 3969 "cs-parser.jay" +case 554: +#line 3979 "cs-parser.jay" { yyVal = new Indirection ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 554: -#line 3973 "cs-parser.jay" +case 555: +#line 3983 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.AddressOf, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 556: - case_556(); - break; case 557: case_557(); break; case 558: case_558(); break; -case 560: - case_560(); +case 559: + case_559(); break; case 561: case_561(); break; case 562: -#line 4010 "cs-parser.jay" + case_562(); + break; +case 563: +#line 4020 "cs-parser.jay" { yyVal = new As ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 563: -#line 4014 "cs-parser.jay" +case 564: +#line 4024 "cs-parser.jay" { yyVal = new Is ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 565: - case_565(); - break; case 566: case_566(); break; -case 568: - case_568(); +case 567: + case_567(); break; case 569: case_569(); @@ -3025,32 +3026,32 @@ case 570: case 571: case_571(); break; -case 573: - case_573(); +case 572: + case_572(); break; case 574: case_574(); break; -case 576: - case_576(); +case 575: + case_575(); break; -case 578: - case_578(); +case 577: + case_577(); break; -case 580: - case_580(); +case 579: + case_579(); break; -case 582: - case_582(); +case 581: + case_581(); break; -case 584: - case_584(); +case 583: + case_583(); break; -case 586: - case_586(); +case 585: + case_585(); break; -case 588: - case_588(); +case 587: + case_587(); break; case 589: case_589(); @@ -3104,23 +3105,23 @@ case 605: case_605(); break; case 606: -#line 4242 "cs-parser.jay" - { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } + case_606(); break; case 607: - case_607(); +#line 4252 "cs-parser.jay" + { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; -case 610: -#line 4258 "cs-parser.jay" +case 608: + case_608(); + break; +case 611: +#line 4268 "cs-parser.jay" { start_block (Location.Null); } break; -case 611: - case_611(); - break; -case 613: - case_613(); +case 612: + case_612(); break; case 614: case_614(); @@ -3135,59 +3136,59 @@ case 617: case_617(); break; case 618: -#line 4303 "cs-parser.jay" + case_618(); + break; +case 619: +#line 4313 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; -case 619: - case_619(); - break; case 620: case_620(); break; case 621: -#line 4317 "cs-parser.jay" + case_621(); + break; +case 622: +#line 4327 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; -case 622: - case_622(); - break; case 623: case_623(); break; -case 629: -#line 4342 "cs-parser.jay" +case 624: + case_624(); + break; +case 630: +#line 4352 "cs-parser.jay" { yyVal = new ArglistAccess (GetLocation (yyVals[0+yyTop])); } break; -case 630: - case_630(); - break; case 631: case_631(); break; case 632: case_632(); break; -case 634: -#line 4371 "cs-parser.jay" +case 633: + case_633(); + break; +case 635: +#line 4381 "cs-parser.jay" { yyVal = new BooleanExpression ((Expression) yyVals[0+yyTop]); } break; -case 635: -#line 4384 "cs-parser.jay" +case 636: +#line 4394 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; -case 636: - case_636(); - break; case 637: case_637(); break; @@ -3198,25 +3199,25 @@ case 639: case_639(); break; case 640: -#line 4429 "cs-parser.jay" - { yyVal = null; } + case_640(); break; case 641: -#line 4431 "cs-parser.jay" - { yyVal = yyVals[0+yyTop]; StoreModifierLocation (Modifiers.PARTIAL, GetLocation (yyVals[0+yyTop])); } +#line 4439 "cs-parser.jay" + { yyVal = null; } break; case 642: - case_642(); +#line 4441 "cs-parser.jay" + { yyVal = yyVals[0+yyTop]; StoreModifierLocation (Modifiers.PARTIAL, GetLocation (yyVals[0+yyTop])); } break; case 643: -#line 4444 "cs-parser.jay" + case_643(); + break; +case 644: +#line 4454 "cs-parser.jay" { lexer.parsing_modifiers = false; } break; -case 645: - case_645(); - break; case 646: case_646(); break; @@ -3262,21 +3263,21 @@ case 659: case 660: case_660(); break; -case 662: - case_662(); +case 661: + case_661(); break; case 663: case_663(); break; -case 665: -#line 4570 "cs-parser.jay" +case 664: + case_664(); + break; +case 666: +#line 4580 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; -case 666: - case_666(); - break; case 667: case_667(); break; @@ -3299,26 +3300,26 @@ case 673: case_673(); break; case 674: -#line 4663 "cs-parser.jay" + case_674(); + break; +case 675: +#line 4673 "cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Class, GetLocation (yyVals[0+yyTop])); } break; -case 675: -#line 4667 "cs-parser.jay" +case 676: +#line 4677 "cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Struct, GetLocation (yyVals[0+yyTop])); } break; -case 676: -#line 4674 "cs-parser.jay" +case 677: +#line 4684 "cs-parser.jay" { yyVal = Variance.None; } break; -case 677: - case_677(); - break; case 678: case_678(); break; @@ -3329,14 +3330,14 @@ case 680: case_680(); break; case 681: -#line 4719 "cs-parser.jay" + case_681(); + break; +case 682: +#line 4729 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; -case 682: - case_682(); - break; case 683: case_683(); break; @@ -3349,39 +3350,39 @@ case 685: case 686: case_686(); break; -case 691: -#line 4768 "cs-parser.jay" +case 687: + case_687(); + break; +case 692: +#line 4778 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; -case 692: -#line 4772 "cs-parser.jay" +case 693: +#line 4782 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; -case 694: - case_694(); - break; case 695: case_695(); break; -case 698: -#line 4806 "cs-parser.jay" +case 696: + case_696(); + break; +case 699: +#line 4816 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; -case 699: -#line 4810 "cs-parser.jay" +case 700: +#line 4820 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; -case 728: - case_728(); - break; case 729: case_729(); break; @@ -3394,8 +3395,8 @@ case 731: case 732: case_732(); break; -case 735: - case_735(); +case 733: + case_733(); break; case 736: case_736(); @@ -3407,32 +3408,32 @@ case 738: case_738(); break; case 739: -#line 4954 "cs-parser.jay" + case_739(); + break; +case 740: +#line 4964 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; -case 740: -#line 4958 "cs-parser.jay" +case 741: +#line 4968 "cs-parser.jay" { yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; -case 741: - case_741(); - break; -case 743: - case_743(); +case 742: + case_742(); break; case 744: -#line 4979 "cs-parser.jay" + case_744(); + break; +case 745: +#line 4989 "cs-parser.jay" { yyVal = ComposedTypeSpecifier.CreatePointer (GetLocation (yyVals[0+yyTop])); } break; -case 746: - case_746(); - break; case 747: case_747(); break; @@ -3445,11 +3446,11 @@ case 749: case 750: case_750(); break; -case 752: - case_752(); +case 751: + case_751(); break; -case 754: - case_754(); +case 753: + case_753(); break; case 755: case_755(); @@ -3457,29 +3458,29 @@ case 755: case 756: case_756(); break; -case 760: - case_760(); +case 757: + case_757(); break; -case 763: - case_763(); +case 761: + case_761(); break; case 764: case_764(); break; case 765: -#line 5114 "cs-parser.jay" + case_765(); + break; +case 766: +#line 5124 "cs-parser.jay" { report.Error (145, lexer.Location, "A const field requires a value to be provided"); } break; -case 766: - case_766(); - break; -case 771: - case_771(); +case 767: + case_767(); break; -case 773: - case_773(); +case 772: + case_772(); break; case 774: case_774(); @@ -3488,22 +3489,22 @@ case 775: case_775(); break; case 776: -#line 5164 "cs-parser.jay" - { yyVal = yyVals[-1+yyTop]; } + case_776(); break; case 777: - case_777(); - break; -case 778: #line 5174 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; +case 778: + case_778(); + break; case 779: -#line 5175 "cs-parser.jay" +#line 5184 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 780: - case_780(); +#line 5185 "cs-parser.jay" + { yyVal = yyVals[-1+yyTop]; } break; case 781: case_781(); @@ -3511,8 +3512,8 @@ case 781: case 782: case_782(); break; -case 785: - case_785(); +case 783: + case_783(); break; case 786: case_786(); @@ -3521,22 +3522,22 @@ case 787: case_787(); break; case 788: -#line 5250 "cs-parser.jay" + case_788(); + break; +case 789: +#line 5260 "cs-parser.jay" { start_block (GetLocation (yyVals[0+yyTop])); } break; -case 789: - case_789(); - break; case 790: case_790(); break; case 791: case_791(); break; -case 793: - case_793(); +case 792: + case_792(); break; case 794: case_794(); @@ -3545,20 +3546,20 @@ case 795: case_795(); break; case 796: -#line 5301 "cs-parser.jay" + case_796(); + break; +case 797: +#line 5311 "cs-parser.jay" { current_block = current_block.CreateSwitchBlock (lexer.Location); } break; -case 797: -#line 5305 "cs-parser.jay" +case 798: +#line 5315 "cs-parser.jay" { yyVal = new SwitchSection ((List) yyVals[-2+yyTop], current_block); } break; -case 798: - case_798(); - break; case 799: case_799(); break; @@ -3569,14 +3570,14 @@ case 801: case_801(); break; case 802: -#line 5339 "cs-parser.jay" + case_802(); + break; +case 803: +#line 5349 "cs-parser.jay" { yyVal = new SwitchLabel (null, GetLocation (yyVals[0+yyTop])); } break; -case 807: - case_807(); - break; case 808: case_808(); break; @@ -3593,35 +3594,35 @@ case 812: case_812(); break; case 813: -#line 5400 "cs-parser.jay" + case_813(); + break; +case 814: +#line 5410 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; -case 814: - case_814(); - break; case 815: -#line 5415 "cs-parser.jay" + case_815(); + break; +case 816: +#line 5425 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; -case 816: - case_816(); - break; case 817: case_817(); break; case 818: -#line 5436 "cs-parser.jay" + case_818(); + break; +case 819: +#line 5446 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; -case 819: - case_819(); - break; case 820: case_820(); break; @@ -3629,26 +3630,26 @@ case 821: case_821(); break; case 822: -#line 5470 "cs-parser.jay" - { yyVal = new EmptyStatement (lexer.Location); } + case_822(); break; -case 824: - case_824(); +case 823: +#line 5480 "cs-parser.jay" + { yyVal = new EmptyStatement (lexer.Location); } break; case 825: case_825(); break; -case 827: -#line 5491 "cs-parser.jay" +case 826: + case_826(); + break; +case 828: +#line 5501 "cs-parser.jay" { yyVal = null; } break; -case 829: -#line 5496 "cs-parser.jay" +case 830: +#line 5506 "cs-parser.jay" { yyVal = new EmptyStatement (lexer.Location); } break; -case 833: - case_833(); - break; case 834: case_834(); break; @@ -3667,8 +3668,8 @@ case 838: case 839: case_839(); break; -case 846: - case_846(); +case 840: + case_840(); break; case 847: case_847(); @@ -3709,15 +3710,15 @@ case 858: case 859: case_859(); break; -case 862: -#line 5736 "cs-parser.jay" +case 860: + case_860(); + break; +case 863: +#line 5746 "cs-parser.jay" { yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false); } break; -case 863: - case_863(); - break; case 864: case_864(); break; @@ -3730,48 +3731,48 @@ case 866: case 867: case_867(); break; -case 870: -#line 5786 "cs-parser.jay" +case 868: + case_868(); + break; +case 871: +#line 5796 "cs-parser.jay" { yyVal = new Catch ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 871: - case_871(); - break; case 872: -#line 5805 "cs-parser.jay" + case_872(); + break; +case 873: +#line 5815 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; -case 873: - case_873(); - break; case 874: -#line 5823 "cs-parser.jay" + case_874(); + break; +case 875: +#line 5833 "cs-parser.jay" { yyVal = new Checked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 875: -#line 5830 "cs-parser.jay" +case 876: +#line 5840 "cs-parser.jay" { yyVal = new Unchecked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 876: - case_876(); - break; case 877: -#line 5840 "cs-parser.jay" + case_877(); + break; +case 878: +#line 5850 "cs-parser.jay" { yyVal = new Unsafe ((Block) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } break; -case 878: - case_878(); - break; case 879: case_879(); break; @@ -3799,18 +3800,18 @@ case 886: case 887: case_887(); break; -case 889: - case_889(); +case 888: + case_888(); break; case 890: -#line 5945 "cs-parser.jay" + case_890(); + break; +case 891: +#line 5955 "cs-parser.jay" { Error_MissingInitializer (lexer.Location); } break; -case 891: - case_891(); - break; case 892: case_892(); break; @@ -3836,44 +3837,44 @@ case 899: case_899(); break; case 900: -#line 6050 "cs-parser.jay" + case_900(); + break; +case 901: +#line 6060 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; -case 901: - case_901(); - break; case 902: -#line 6066 "cs-parser.jay" + case_902(); + break; +case 903: +#line 6076 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; -case 903: - case_903(); - break; case 904: case_904(); break; case 905: case_905(); break; -case 907: - case_907(); +case 906: + case_906(); break; case 908: case_908(); break; case 909: -#line 6130 "cs-parser.jay" + case_909(); + break; +case 910: +#line 6140 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; -case 910: - case_910(); - break; case 911: case_911(); break; @@ -3883,27 +3884,27 @@ case 912: case 913: case_913(); break; -case 915: - case_915(); +case 914: + case_914(); break; -case 921: -#line 6184 "cs-parser.jay" +case 916: + case_916(); + break; +case 922: +#line 6194 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; -case 922: - case_922(); - break; case 923: -#line 6203 "cs-parser.jay" + case_923(); + break; +case 924: +#line 6213 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; -case 924: - case_924(); - break; case 925: case_925(); break; @@ -3928,99 +3929,99 @@ case 931: case 932: case_932(); break; -case 934: - case_934(); +case 933: + case_933(); break; case 935: -#line 6357 "cs-parser.jay" + case_935(); + break; +case 936: +#line 6367 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; -case 936: - case_936(); - break; -case 938: - case_938(); +case 937: + case_937(); break; case 939: case_939(); break; -case 941: - case_941(); +case 940: + case_940(); break; case 942: case_942(); break; case 943: -#line 6403 "cs-parser.jay" + case_943(); + break; +case 944: +#line 6413 "cs-parser.jay" { yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); } break; -case 944: - case_944(); - break; case 945: case_945(); break; case 946: -#line 6420 "cs-parser.jay" + case_946(); + break; +case 947: +#line 6430 "cs-parser.jay" { yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); } break; -case 947: - case_947(); - break; case 948: case_948(); break; -case 950: - case_950(); +case 949: + case_949(); break; case 951: case_951(); break; -case 954: - case_954(); +case 952: + case_952(); break; case 955: case_955(); break; -case 963: -#line 6542 "cs-parser.jay" +case 956: + case_956(); + break; +case 964: +#line 6552 "cs-parser.jay" { module.DocumentationBuilder.ParsedName = (MemberName) yyVals[0+yyTop]; } break; -case 964: -#line 6549 "cs-parser.jay" +case 965: +#line 6559 "cs-parser.jay" { module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; } break; -case 965: - case_965(); - break; case 966: case_966(); break; case 967: -#line 6566 "cs-parser.jay" + case_967(); + break; +case 968: +#line 6576 "cs-parser.jay" { yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], MemberCache.IndexerNameAlias, Location.Null); } break; -case 968: -#line 6570 "cs-parser.jay" +case 969: +#line 6580 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; -case 969: - case_969(); - break; case 970: case_970(); break; @@ -4030,39 +4031,42 @@ case 971: case 972: case_972(); break; -case 974: -#line 6606 "cs-parser.jay" +case 973: + case_973(); + break; +case 975: +#line 6616 "cs-parser.jay" { yyVal = new MemberName (((MemberName) yyVals[-2+yyTop]), (MemberName) yyVals[0+yyTop]); } break; -case 976: -#line 6614 "cs-parser.jay" +case 977: +#line 6624 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; -case 977: -#line 6618 "cs-parser.jay" +case 978: +#line 6628 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; -case 978: -#line 6625 "cs-parser.jay" +case 979: +#line 6635 "cs-parser.jay" { yyVal = new List (0); } break; -case 980: - case_980(); - break; case 981: case_981(); break; case 982: case_982(); break; +case 983: + case_983(); + break; #line default } yyTop -= yyLen[yyN]; @@ -4228,14 +4232,25 @@ void case_23() } void case_24() -#line 545 "cs-parser.jay" +#line 542 "cs-parser.jay" +{ + report.Error (1514, lexer.Location, "Unexpected symbol `{0}', expecting `.' or `{{'", GetSymbolName (yyToken)); + + var name = (MemberName) yyVals[0+yyTop]; + var ns = new NamespaceContainer (name, current_namespace); + lbag.AddLocation (current_container, GetLocation (yyVals[-1+yyTop])); + current_namespace.AddTypeContainer (ns); + } + +void case_25() +#line 554 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new MemberName (lt.Value, lt.Location); } -void case_25() -#line 550 "cs-parser.jay" +void case_26() +#line 559 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], lt.Value, lt.Location) { @@ -4243,15 +4258,15 @@ void case_25() }; } -void case_26() -#line 557 "cs-parser.jay" +void case_27() +#line 566 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new MemberName ("", lexer.Location); } -void case_39() -#line 595 "cs-parser.jay" +void case_40() +#line 604 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { TypeContainer ds = (TypeContainer)yyVals[0+yyTop]; @@ -4271,16 +4286,16 @@ void case_39() current_namespace.DeclarationFound = true; } -void case_41() -#line 617 "cs-parser.jay" +void case_42() +#line 626 "cs-parser.jay" { current_namespace.UnattachedAttributes = (Attributes) yyVals[-1+yyTop]; report.Error (1518, lexer.Location, "Attributes must be attached to class, delegate, enum, interface or struct"); lexer.putback ('}'); } -void case_49() -#line 650 "cs-parser.jay" +void case_50() +#line 659 "cs-parser.jay" { var sect = (List) yyVals[0+yyTop]; yyVal = new Attributes (sect); @@ -4292,8 +4307,8 @@ void case_49() } } -void case_50() -#line 661 "cs-parser.jay" +void case_51() +#line 670 "cs-parser.jay" { Attributes attrs = yyVals[-1+yyTop] as Attributes; var sect = (List) yyVals[0+yyTop]; @@ -4307,22 +4322,22 @@ void case_50() yyVal = attrs; } -void case_51() -#line 677 "cs-parser.jay" +void case_52() +#line 686 "cs-parser.jay" { lexer.parsing_attribute_section = true; savedOpenLocation = GetLocation (yyVals[0+yyTop]); } -void case_52() -#line 682 "cs-parser.jay" +void case_53() +#line 691 "cs-parser.jay" { lexer.parsing_attribute_section = false; yyVal = yyVals[0+yyTop]; } -void case_53() -#line 690 "cs-parser.jay" +void case_54() +#line 699 "cs-parser.jay" { current_attr_target = (string) yyVals[-1+yyTop]; if (current_attr_target == "assembly" || current_attr_target == "module") { @@ -4330,8 +4345,8 @@ void case_53() } } -void case_54() -#line 697 "cs-parser.jay" +void case_55() +#line 706 "cs-parser.jay" { /* when attribute target is invalid*/ if (current_attr_target == string.Empty) @@ -4348,8 +4363,8 @@ void case_54() } } -void case_55() -#line 713 "cs-parser.jay" +void case_56() +#line 722 "cs-parser.jay" { yyVal = yyVals[-2+yyTop]; if (yyVals[-1+yyTop] != null) { @@ -4359,16 +4374,16 @@ void case_55() } } -void case_56() -#line 725 "cs-parser.jay" +void case_57() +#line 734 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = CheckAttributeTarget (lt.Value, lt.Location); savedCloseLocation = GetLocation (yyVals[0+yyTop]); } -void case_59() -#line 733 "cs-parser.jay" +void case_60() +#line 742 "cs-parser.jay" { if (yyToken == Token.IDENTIFIER) { Error_SyntaxError (yyToken); @@ -4379,8 +4394,8 @@ void case_59() } } -void case_61() -#line 750 "cs-parser.jay" +void case_62() +#line 759 "cs-parser.jay" { var attrs = (List) yyVals[-2+yyTop]; attrs.Add ((Attribute) yyVals[0+yyTop]); @@ -4389,8 +4404,8 @@ void case_61() yyVal = attrs; } -void case_63() -#line 765 "cs-parser.jay" +void case_64() +#line 774 "cs-parser.jay" { --lexer.parsing_block; @@ -4411,8 +4426,8 @@ void case_63() } } -void case_66() -#line 793 "cs-parser.jay" +void case_67() +#line 802 "cs-parser.jay" { savedAttrParenOpenLocation = GetLocation (yyVals[-2+yyTop]); savedAttrParenCloseLocation = GetLocation (yyVals[0+yyTop]); @@ -4420,24 +4435,24 @@ void case_66() HadAttributeParens = true; } -void case_68() -#line 805 "cs-parser.jay" +void case_69() +#line 814 "cs-parser.jay" { Arguments a = new Arguments (4); a.Add ((Argument) yyVals[0+yyTop]); yyVal = new Arguments [] { a, null }; } -void case_69() -#line 811 "cs-parser.jay" +void case_70() +#line 820 "cs-parser.jay" { Arguments a = new Arguments (4); a.Add ((Argument) yyVals[0+yyTop]); yyVal = new Arguments [] { null, a }; } -void case_70() -#line 817 "cs-parser.jay" +void case_71() +#line 826 "cs-parser.jay" { Arguments[] o = (Arguments[]) yyVals[-2+yyTop]; if (o [1] != null) { @@ -4453,8 +4468,8 @@ void case_70() attributeArgumentCommas.Add (GetLocation (yyVals[-1+yyTop])); } -void case_71() -#line 832 "cs-parser.jay" +void case_72() +#line 841 "cs-parser.jay" { Arguments[] o = (Arguments[]) yyVals[-2+yyTop]; if (o [1] == null) { @@ -4465,8 +4480,8 @@ void case_71() attributeArgumentCommas.Add (GetLocation (yyVals[-1+yyTop])); } -void case_75() -#line 857 "cs-parser.jay" +void case_76() +#line 866 "cs-parser.jay" { --lexer.parsing_block; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; @@ -4474,8 +4489,8 @@ void case_75() lbag.AddLocation (yyVal, GetLocation(yyVals[-2+yyTop])); } -void case_76() -#line 867 "cs-parser.jay" +void case_77() +#line 876 "cs-parser.jay" { if (lang_version <= LanguageVersion.V_3) FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "named argument"); @@ -4488,8 +4503,8 @@ void case_76() lbag.AddLocation (yyVal, GetLocation(yyVals[-2+yyTop])); } -void case_95() -#line 921 "cs-parser.jay" +void case_96() +#line 930 "cs-parser.jay" { report.Error (1519, lexer.Location, "Unexpected symbol `{0}' in class, struct, or interface member declaration", GetSymbolName (yyToken)); @@ -4497,15 +4512,15 @@ void case_95() lexer.parsing_generic_declaration = false; } -void case_97() -#line 938 "cs-parser.jay" +void case_98() +#line 947 "cs-parser.jay" { push_current_container (new Struct (current_container, (MemberName) yyVals[0+yyTop], (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]); lbag.AddMember (current_container, GetModifierLocations (), GetLocation (yyVals[-2+yyTop])); } -void case_98() -#line 944 "cs-parser.jay" +void case_99() +#line 953 "cs-parser.jay" { lexer.ConstraintsParsing = false; @@ -4519,23 +4534,23 @@ void case_98() lexer.parsing_modifiers = true; } -void case_99() -#line 957 "cs-parser.jay" +void case_100() +#line 966 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } -void case_100() -#line 962 "cs-parser.jay" +void case_101() +#line 971 "cs-parser.jay" { --lexer.parsing_declaration; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } -void case_101() -#line 968 "cs-parser.jay" +void case_102() +#line 977 "cs-parser.jay" { if (yyVals[0+yyTop] == null) { lbag.AppendToMember (current_container, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop])); @@ -4545,8 +4560,8 @@ void case_101() yyVal = pop_current_class (); } -void case_103() -#line 986 "cs-parser.jay" +void case_104() +#line 995 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var mod = (Modifiers) yyVals[-3+yyTop]; @@ -4560,8 +4575,8 @@ void case_103() yyVal = current_field; } -void case_104() -#line 999 "cs-parser.jay" +void case_105() +#line 1008 "cs-parser.jay" { if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); @@ -4573,31 +4588,31 @@ void case_104() current_field = null; } -void case_109() -#line 1029 "cs-parser.jay" +void case_110() +#line 1038 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (ConstInitializer) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_111() -#line 1042 "cs-parser.jay" +void case_112() +#line 1051 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstInitializer (current_field, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_112() -#line 1048 "cs-parser.jay" +void case_113() +#line 1057 "cs-parser.jay" { report.Error (145, lexer.Location, "A const field requires a value to be provided"); yyVal = null; } -void case_115() -#line 1063 "cs-parser.jay" +void case_116() +#line 1072 "cs-parser.jay" { lexer.parsing_generic_declaration = false; @@ -4611,8 +4626,8 @@ void case_115() yyVal = current_field; } -void case_116() -#line 1078 "cs-parser.jay" +void case_117() +#line 1087 "cs-parser.jay" { if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); @@ -4624,8 +4639,8 @@ void case_116() current_field = null; } -void case_117() -#line 1091 "cs-parser.jay" +void case_118() +#line 1100 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "fixed size buffers"); @@ -4637,8 +4652,8 @@ void case_117() current_type.AddField (current_field); } -void case_118() -#line 1102 "cs-parser.jay" +void case_119() +#line 1111 "cs-parser.jay" { if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); @@ -4651,16 +4666,16 @@ void case_118() current_field = null; } -void case_121() -#line 1125 "cs-parser.jay" +void case_122() +#line 1134 "cs-parser.jay" { ++lexer.parsing_block; current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; start_block (GetLocation (yyVals[0+yyTop])); } -void case_122() -#line 1131 "cs-parser.jay" +void case_123() +#line 1140 "cs-parser.jay" { --lexer.parsing_block; current_field.Initializer = (Expression) yyVals[0+yyTop]; @@ -4669,16 +4684,16 @@ void case_122() current_local_parameters = null; } -void case_127() -#line 1158 "cs-parser.jay" +void case_128() +#line 1167 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_129() -#line 1168 "cs-parser.jay" +void case_130() +#line 1177 "cs-parser.jay" { --lexer.parsing_block; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; @@ -4686,39 +4701,39 @@ void case_129() lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_134() -#line 1194 "cs-parser.jay" +void case_135() +#line 1203 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (ConstInitializer) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_136() -#line 1207 "cs-parser.jay" +void case_137() +#line 1216 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstInitializer (current_field, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_137() -#line 1213 "cs-parser.jay" +void case_138() +#line 1222 "cs-parser.jay" { report.Error (443, lexer.Location, "Value or constant expected"); yyVal = null; } -void case_140() -#line 1223 "cs-parser.jay" +void case_141() +#line 1232 "cs-parser.jay" { /* It has to be here for the parent to safely restore artificial block*/ Error_SyntaxError (yyToken); yyVal = null; } -void case_141() -#line 1232 "cs-parser.jay" +void case_142() +#line 1241 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.NotAllowed; @@ -4729,8 +4744,8 @@ void case_141() current_type.AddMember (m); } -void case_142() -#line 1242 "cs-parser.jay" +void case_143() +#line 1251 "cs-parser.jay" { Method method = (Method) yyVals[-2+yyTop]; method.Block = (ToplevelBlock) yyVals[0+yyTop]; @@ -4757,8 +4772,8 @@ void case_142() Lexer.doc_state = XmlCommentState.Allowed; } -void case_145() -#line 1282 "cs-parser.jay" +void case_146() +#line 1291 "cs-parser.jay" { lexer.ConstraintsParsing = false; valid_param_mod = 0; @@ -4778,15 +4793,15 @@ void case_145() yyVal = method; } -void case_147() -#line 1309 "cs-parser.jay" +void case_148() +#line 1318 "cs-parser.jay" { lexer.parsing_generic_declaration = false; valid_param_mod = ParameterModifierType.All; } -void case_149() -#line 1318 "cs-parser.jay" +void case_150() +#line 1327 "cs-parser.jay" { lexer.ConstraintsParsing = false; valid_param_mod = 0; @@ -4811,8 +4826,8 @@ void case_149() yyVal = method; } -void case_150() -#line 1345 "cs-parser.jay" +void case_151() +#line 1354 "cs-parser.jay" { MemberName name = (MemberName) yyVals[-3+yyTop]; report.Error (1585, name.Location, @@ -4829,8 +4844,8 @@ void case_150() yyVal = method; } -void case_151() -#line 1364 "cs-parser.jay" +void case_152() +#line 1373 "cs-parser.jay" { Error_SyntaxError (yyToken); current_local_parameters = ParametersCompiled.Undefined; @@ -4845,16 +4860,16 @@ void case_151() yyVal = method; } -void case_156() -#line 1391 "cs-parser.jay" +void case_157() +#line 1400 "cs-parser.jay" { var pars_list = (List) yyVals[0+yyTop]; yyVal = new ParametersCompiled (pars_list.ToArray ()); lbag.AddLocation (yyVal, parameterListCommas); } -void case_157() -#line 1397 "cs-parser.jay" +void case_158() +#line 1406 "cs-parser.jay" { var pars_list = (List) yyVals[-2+yyTop]; pars_list.Add ((Parameter) yyVals[0+yyTop]); @@ -4864,8 +4879,8 @@ void case_157() lbag.AddLocation (yyVal, parameterListCommas); } -void case_158() -#line 1406 "cs-parser.jay" +void case_159() +#line 1415 "cs-parser.jay" { var pars_list = (List) yyVals[-2+yyTop]; pars_list.Add (new ArglistParameter (GetLocation (yyVals[0+yyTop]))); @@ -4875,8 +4890,8 @@ void case_158() lbag.AddLocation (yyVal, parameterListCommas); } -void case_159() -#line 1415 "cs-parser.jay" +void case_160() +#line 1424 "cs-parser.jay" { if (yyVals[-2+yyTop] != null) report.Error (231, ((Parameter) yyVals[-2+yyTop]).Location, "A params parameter must be the last parameter in a formal parameter list"); @@ -4885,8 +4900,8 @@ void case_159() lbag.AddLocation (yyVal, parameterListCommas); } -void case_160() -#line 1423 "cs-parser.jay" +void case_161() +#line 1432 "cs-parser.jay" { if (yyVals[-2+yyTop] != null) report.Error (231, ((Parameter) yyVals[-2+yyTop]).Location, "A params parameter must be the last parameter in a formal parameter list"); @@ -4900,8 +4915,8 @@ void case_160() lbag.AddLocation (yyVal, parameterListCommas); } -void case_161() -#line 1436 "cs-parser.jay" +void case_162() +#line 1445 "cs-parser.jay" { report.Error (257, GetLocation (yyVals[-2+yyTop]), "An __arglist parameter must be the last parameter in a formal parameter list"); @@ -4909,8 +4924,8 @@ void case_161() lbag.AddLocation (yyVal, parameterListCommas); } -void case_162() -#line 1443 "cs-parser.jay" +void case_163() +#line 1452 "cs-parser.jay" { report.Error (257, GetLocation (yyVals[-2+yyTop]), "An __arglist parameter must be the last parameter in a formal parameter list"); @@ -4923,15 +4938,15 @@ void case_162() lbag.AddLocation (yyVal, parameterListCommas); } -void case_165() -#line 1463 "cs-parser.jay" +void case_166() +#line 1472 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = ParametersCompiled.EmptyReadOnlyParameters; } -void case_166() -#line 1471 "cs-parser.jay" +void case_167() +#line 1480 "cs-parser.jay" { parameters_bucket.Clear (); Parameter p = (Parameter) yyVals[0+yyTop]; @@ -4941,8 +4956,8 @@ void case_166() yyVal = parameters_bucket; } -void case_167() -#line 1480 "cs-parser.jay" +void case_168() +#line 1489 "cs-parser.jay" { var pars = (List) yyVals[-2+yyTop]; Parameter p = (Parameter) yyVals[0+yyTop]; @@ -4961,16 +4976,16 @@ void case_167() yyVal = yyVals[-2+yyTop]; } -void case_168() -#line 1504 "cs-parser.jay" +void case_169() +#line 1513 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Parameter.Modifier) yyVals[-2+yyTop], (Attributes) yyVals[-3+yyTop], lt.Location); lbag.AddLocation (yyVal, parameterModifierLocation); } -void case_169() -#line 1513 "cs-parser.jay" +void case_170() +#line 1522 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; report.Error (1552, lt.Location, "Array type specifier, [], must appear before parameter name"); @@ -4978,16 +4993,16 @@ void case_169() lbag.AddLocation (yyVal, parameterModifierLocation); } -void case_170() -#line 1520 "cs-parser.jay" +void case_171() +#line 1529 "cs-parser.jay" { Error_SyntaxError (yyToken); Location l = GetLocation (yyVals[0+yyTop]); yyVal = new Parameter (null, null, Parameter.Modifier.NONE, (Attributes) yyVals[-1+yyTop], l); } -void case_171() -#line 1529 "cs-parser.jay" +void case_172() +#line 1538 "cs-parser.jay" { Error_SyntaxError (yyToken); Location l = GetLocation (yyVals[0+yyTop]); @@ -4995,8 +5010,8 @@ void case_171() lbag.AddLocation (yyVal, parameterModifierLocation); } -void case_173() -#line 1544 "cs-parser.jay" +void case_174() +#line 1553 "cs-parser.jay" { --lexer.parsing_block; if (lang_version <= LanguageVersion.V_3) { @@ -5034,8 +5049,8 @@ void case_173() ((Parameter) yyVal).DefaultValue = new DefaultParameterValueExpression ((Expression) yyVals[0+yyTop]); } -void case_177() -#line 1593 "cs-parser.jay" +void case_178() +#line 1602 "cs-parser.jay" { Parameter.Modifier p2 = (Parameter.Modifier)yyVals[0+yyTop]; Parameter.Modifier mod = (Parameter.Modifier)yyVals[-1+yyTop] | p2; @@ -5057,8 +5072,8 @@ void case_177() yyVal = mod; } -void case_178() -#line 1617 "cs-parser.jay" +void case_179() +#line 1626 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Ref) == 0) Error_ParameterModifierNotValid ("ref", GetLocation (yyVals[0+yyTop])); @@ -5066,8 +5081,8 @@ void case_178() yyVal = Parameter.Modifier.REF; } -void case_179() -#line 1624 "cs-parser.jay" +void case_180() +#line 1633 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Out) == 0) Error_ParameterModifierNotValid ("out", GetLocation (yyVals[0+yyTop])); @@ -5075,8 +5090,8 @@ void case_179() yyVal = Parameter.Modifier.OUT; } -void case_180() -#line 1631 "cs-parser.jay" +void case_181() +#line 1640 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.This) == 0) Error_ParameterModifierNotValid ("this", GetLocation (yyVals[0+yyTop])); @@ -5087,16 +5102,16 @@ void case_180() yyVal = Parameter.Modifier.This; } -void case_181() -#line 1644 "cs-parser.jay" +void case_182() +#line 1653 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new ParamsParameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Attributes) yyVals[-3+yyTop], lt.Location); lbag.AddLocation (yyVal, savedLocation); } -void case_182() -#line 1650 "cs-parser.jay" +void case_183() +#line 1659 "cs-parser.jay" { report.Error (1751, GetLocation (yyVals[-4+yyTop]), "Cannot specify a default value for a parameter array"); @@ -5105,24 +5120,24 @@ void case_182() lbag.AddLocation (yyVal, savedLocation); } -void case_183() -#line 1658 "cs-parser.jay" +void case_184() +#line 1667 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new ParamsParameter ((FullNamedExpression) yyVals[-1+yyTop], null, (Attributes) yyVals[-3+yyTop], Location.Null); } -void case_184() -#line 1667 "cs-parser.jay" +void case_185() +#line 1676 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Params) == 0) report.Error (1670, (GetLocation (yyVals[0+yyTop])), "The `params' modifier is not allowed in current context"); savedLocation = GetLocation (yyVals[0+yyTop]); } -void case_185() -#line 1673 "cs-parser.jay" +void case_186() +#line 1682 "cs-parser.jay" { Parameter.Modifier mod = (Parameter.Modifier)yyVals[0+yyTop]; if ((mod & Parameter.Modifier.This) != 0) { @@ -5133,22 +5148,22 @@ void case_185() savedLocation = GetLocation (yyVals[-1+yyTop]); } -void case_187() -#line 1690 "cs-parser.jay" +void case_188() +#line 1699 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Arglist) == 0) report.Error (1669, GetLocation (yyVals[0+yyTop]), "__arglist is not valid in this context"); } -void case_188() -#line 1701 "cs-parser.jay" +void case_189() +#line 1710 "cs-parser.jay" { if (doc_support) tmpComment = Lexer.consume_doc_comment (); } -void case_189() -#line 1706 "cs-parser.jay" +void case_190() +#line 1715 "cs-parser.jay" { var type = (FullNamedExpression) yyVals[-3+yyTop]; current_property = new Property (current_type, type, (Modifiers) yyVals[-4+yyTop], @@ -5163,8 +5178,8 @@ void case_189() lexer.PropertyParsing = true; } -void case_190() -#line 1720 "cs-parser.jay" +void case_191() +#line 1729 "cs-parser.jay" { lexer.PropertyParsing = false; @@ -5172,30 +5187,30 @@ void case_190() current_property.DocComment = ConsumeStoredComment (); } -void case_191() -#line 1727 "cs-parser.jay" +void case_192() +#line 1736 "cs-parser.jay" { lbag.AppendToMember (current_property, GetLocation (yyVals[0+yyTop])); current_property = null; } -void case_193() -#line 1741 "cs-parser.jay" +void case_194() +#line 1750 "cs-parser.jay" { valid_param_mod = 0; - var type = (FullNamedExpression) yyVals[-6+yyTop]; - Indexer indexer = new Indexer (current_type, type, (MemberName) yyVals[-5+yyTop], (Modifiers) yyVals[-7+yyTop], (ParametersCompiled) yyVals[-2+yyTop], (Attributes) yyVals[-8+yyTop]); + var type = (FullNamedExpression) yyVals[-5+yyTop]; + Indexer indexer = new Indexer (current_type, type, (MemberName) yyVals[-4+yyTop], (Modifiers) yyVals[-6+yyTop], (ParametersCompiled) yyVals[-1+yyTop], (Attributes) yyVals[-7+yyTop]); current_property = indexer; current_type.AddIndexer (indexer); - lbag.AddMember (current_property, GetModifierLocations (), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); + lbag.AddMember (current_property, GetModifierLocations (), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); if (type.Type != null && type.Type.Kind == MemberKind.Void) - report.Error (620, GetLocation (yyVals[-6+yyTop]), "`{0}': indexer return type cannot be `void'", indexer.GetSignatureForError ()); + report.Error (620, GetLocation (yyVals[-5+yyTop]), "`{0}': indexer return type cannot be `void'", indexer.GetSignatureForError ()); if (indexer.ParameterInfo.IsEmpty) { - report.Error (1551, GetLocation (yyVals[-4+yyTop]), "Indexers must have at least one parameter"); + report.Error (1551, GetLocation (yyVals[-3+yyTop]), "Indexers must have at least one parameter"); } if (doc_support) { @@ -5206,8 +5221,8 @@ void case_193() lexer.PropertyParsing = true; } -void case_195() -#line 1770 "cs-parser.jay" +void case_196() +#line 1779 "cs-parser.jay" { if (current_property.AccessorFirst != null && current_property.AccessorFirst.Block == null) ((Indexer) current_property).ParameterInfo.CheckParameters (current_property); @@ -5215,12 +5230,12 @@ void case_195() if (doc_support) current_property.DocComment = ConsumeStoredComment (); - lbag.AppendToMember (current_property, GetLocation (yyVals[-1+yyTop])); + lbag.AppendToMember (current_property, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); current_property = null; } -void case_200() -#line 1789 "cs-parser.jay" +void case_201() +#line 1798 "cs-parser.jay" { if (yyToken == Token.CLOSE_BRACE) { report.Error (548, lexer.Location, "`{0}': property or indexer must have at least one accessor", current_property.GetSignatureForError ()); @@ -5232,8 +5247,8 @@ void case_200() } } -void case_201() -#line 1803 "cs-parser.jay" +void case_202() +#line 1812 "cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone && lang_version == LanguageVersion.ISO_1) { FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "access modifiers on properties"); @@ -5255,8 +5270,8 @@ void case_201() lexer.PropertyParsing = false; } -void case_202() -#line 1824 "cs-parser.jay" +void case_203() +#line 1833 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { current_property.Get.Block = (ToplevelBlock) yyVals[0+yyTop]; @@ -5278,8 +5293,8 @@ void case_202() Lexer.doc_state = XmlCommentState.NotAllowed; } -void case_203() -#line 1848 "cs-parser.jay" +void case_204() +#line 1857 "cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone && lang_version == LanguageVersion.ISO_1) { FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "access modifiers on properties"); @@ -5306,8 +5321,8 @@ void case_203() lexer.PropertyParsing = false; } -void case_204() -#line 1874 "cs-parser.jay" +void case_205() +#line 1883 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { current_property.Set.Block = (ToplevelBlock) yyVals[0+yyTop]; @@ -5329,29 +5344,29 @@ void case_204() Lexer.doc_state = XmlCommentState.NotAllowed; } -void case_206() -#line 1899 "cs-parser.jay" +void case_207() +#line 1908 "cs-parser.jay" { savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; } -void case_207() -#line 1904 "cs-parser.jay" +void case_208() +#line 1913 "cs-parser.jay" { Error_SyntaxError (1043, yyToken, "Invalid accessor body"); yyVal = null; } -void case_209() -#line 1919 "cs-parser.jay" +void case_210() +#line 1928 "cs-parser.jay" { push_current_container (new Interface (current_container, (MemberName) yyVals[0+yyTop], (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]); lbag.AddMember (current_container, GetModifierLocations (), GetLocation (yyVals[-2+yyTop])); } -void case_210() -#line 1925 "cs-parser.jay" +void case_211() +#line 1934 "cs-parser.jay" { lexer.ConstraintsParsing = false; @@ -5366,16 +5381,16 @@ void case_210() lexer.parsing_modifiers = true; } -void case_211() -#line 1939 "cs-parser.jay" +void case_212() +#line 1948 "cs-parser.jay" { --lexer.parsing_declaration; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } -void case_212() -#line 1945 "cs-parser.jay" +void case_213() +#line 1954 "cs-parser.jay" { if (yyVals[0+yyTop] == null) { lbag.AppendToMember (current_container, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); @@ -5385,8 +5400,8 @@ void case_212() yyVal = pop_current_class (); } -void case_228() -#line 2007 "cs-parser.jay" +void case_229() +#line 2016 "cs-parser.jay" { OperatorDeclaration decl = (OperatorDeclaration) yyVals[-2+yyTop]; if (decl != null) { @@ -5415,15 +5430,15 @@ void case_228() current_local_parameters = null; } -void case_232() -#line 2044 "cs-parser.jay" +void case_233() +#line 2053 "cs-parser.jay" { report.Error (590, GetLocation (yyVals[0+yyTop]), "User-defined operators cannot return void"); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } -void case_234() -#line 2056 "cs-parser.jay" +void case_235() +#line 2065 "cs-parser.jay" { valid_param_mod = 0; @@ -5464,8 +5479,8 @@ void case_234() lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), savedOperatorLocation, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_259() -#line 2132 "cs-parser.jay" +void case_260() +#line 2141 "cs-parser.jay" { valid_param_mod = 0; @@ -5481,8 +5496,8 @@ void case_259() lbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_261() -#line 2151 "cs-parser.jay" +void case_262() +#line 2160 "cs-parser.jay" { valid_param_mod = 0; @@ -5498,24 +5513,24 @@ void case_261() lbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_262() -#line 2166 "cs-parser.jay" +void case_263() +#line 2175 "cs-parser.jay" { Error_SyntaxError (yyToken); current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; yyVal = new OperatorDeclaration (Operator.OpType.Implicit, null, GetLocation (yyVals[-1+yyTop])); } -void case_263() -#line 2172 "cs-parser.jay" +void case_264() +#line 2181 "cs-parser.jay" { Error_SyntaxError (yyToken); current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; yyVal = new OperatorDeclaration (Operator.OpType.Explicit, null, GetLocation (yyVals[-1+yyTop])); } -void case_264() -#line 2182 "cs-parser.jay" +void case_265() +#line 2191 "cs-parser.jay" { Constructor c = (Constructor) yyVals[-1+yyTop]; c.Block = (ToplevelBlock) yyVals[0+yyTop]; @@ -5528,8 +5543,8 @@ void case_264() Lexer.doc_state = XmlCommentState.Allowed; } -void case_265() -#line 2199 "cs-parser.jay" +void case_266() +#line 2208 "cs-parser.jay" { if (doc_support) { tmpComment = Lexer.consume_doc_comment (); @@ -5539,8 +5554,8 @@ void case_265() valid_param_mod = ParameterModifierType.All; } -void case_266() -#line 2208 "cs-parser.jay" +void case_267() +#line 2217 "cs-parser.jay" { valid_param_mod = 0; current_local_parameters = (ParametersCompiled) yyVals[-1+yyTop]; @@ -5570,8 +5585,8 @@ void case_266() start_block (lexer.Location); } -void case_267() -#line 2237 "cs-parser.jay" +void case_268() +#line 2246 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { var c = (Constructor) yyVals[-1+yyTop]; @@ -5587,39 +5602,39 @@ void case_267() yyVal = yyVals[-1+yyTop]; } -void case_273() -#line 2269 "cs-parser.jay" +void case_274() +#line 2278 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstructorBaseInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_275() -#line 2279 "cs-parser.jay" +void case_276() +#line 2288 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstructorThisInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_276() -#line 2285 "cs-parser.jay" +void case_277() +#line 2294 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new ConstructorThisInitializer (null, GetLocation (yyVals[0+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_277() -#line 2291 "cs-parser.jay" +void case_278() +#line 2300 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } -void case_278() -#line 2299 "cs-parser.jay" +void case_279() +#line 2308 "cs-parser.jay" { if (doc_support) { tmpComment = Lexer.consume_doc_comment (); @@ -5629,8 +5644,8 @@ void case_278() current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; } -void case_279() -#line 2308 "cs-parser.jay" +void case_280() +#line 2317 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; if (lt.Value != current_container.MemberName.Name){ @@ -5652,8 +5667,8 @@ void case_279() current_local_parameters = null; } -void case_280() -#line 2334 "cs-parser.jay" +void case_281() +#line 2343 "cs-parser.jay" { current_event_field = new EventField (current_type, (FullNamedExpression) yyVals[-1+yyTop], (Modifiers) yyVals[-3+yyTop], (MemberName) yyVals[0+yyTop], (Attributes) yyVals[-4+yyTop]); current_type.AddMember (current_event_field); @@ -5666,8 +5681,8 @@ void case_280() yyVal = current_event_field; } -void case_281() -#line 2348 "cs-parser.jay" +void case_282() +#line 2357 "cs-parser.jay" { if (doc_support) { current_event_field.DocComment = Lexer.consume_doc_comment (); @@ -5678,8 +5693,8 @@ void case_281() current_event_field = null; } -void case_282() -#line 2361 "cs-parser.jay" +void case_283() +#line 2370 "cs-parser.jay" { current_event = new EventProperty (current_type, (FullNamedExpression) yyVals[-2+yyTop], (Modifiers) yyVals[-4+yyTop], (MemberName) yyVals[-1+yyTop], (Attributes) yyVals[-5+yyTop]); current_type.AddMember (current_event); @@ -5688,8 +5703,8 @@ void case_282() lexer.EventParsing = true; } -void case_283() -#line 2369 "cs-parser.jay" +void case_284() +#line 2378 "cs-parser.jay" { if (current_container.Kind == MemberKind.Interface) report.Error (69, GetLocation (yyVals[-2+yyTop]), "Event in interface cannot have add or remove accessors"); @@ -5697,8 +5712,8 @@ void case_283() lexer.EventParsing = false; } -void case_284() -#line 2376 "cs-parser.jay" +void case_285() +#line 2385 "cs-parser.jay" { if (doc_support) { current_event.DocComment = Lexer.consume_doc_comment (); @@ -5710,23 +5725,23 @@ void case_284() current_local_parameters = null; } -void case_287() -#line 2395 "cs-parser.jay" +void case_288() +#line 2404 "cs-parser.jay" { --lexer.parsing_block; current_event_field.Initializer = (Expression) yyVals[0+yyTop]; } -void case_292() -#line 2419 "cs-parser.jay" +void case_293() +#line 2428 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_294() -#line 2429 "cs-parser.jay" +void case_295() +#line 2438 "cs-parser.jay" { --lexer.parsing_block; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; @@ -5734,8 +5749,8 @@ void case_294() lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_295() -#line 2438 "cs-parser.jay" +void case_296() +#line 2447 "cs-parser.jay" { if (current_container.Kind == MemberKind.Interface) { report.Error (68, lexer.Location, "`{0}': event in interface cannot have an initializer", @@ -5748,29 +5763,29 @@ void case_295() } } -void case_299() -#line 2459 "cs-parser.jay" +void case_300() +#line 2468 "cs-parser.jay" { report.Error (65, lexer.Location, "`{0}': event property must have both add and remove accessors", current_event.GetSignatureForError ()); } -void case_300() -#line 2464 "cs-parser.jay" +void case_301() +#line 2473 "cs-parser.jay" { report.Error (65, lexer.Location, "`{0}': event property must have both add and remove accessors", current_event.GetSignatureForError ()); } -void case_301() -#line 2469 "cs-parser.jay" +void case_302() +#line 2478 "cs-parser.jay" { report.Error (1055, GetLocation (yyVals[0+yyTop]), "An add or remove accessor expected"); yyVal = null; } -void case_302() -#line 2477 "cs-parser.jay" +void case_303() +#line 2486 "cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone) { report.Error (1609, GetLocation (yyVals[-1+yyTop]), "Modifiers cannot be placed on event accessor declarations"); @@ -5783,8 +5798,8 @@ void case_302() lexer.EventParsing = false; } -void case_303() -#line 2489 "cs-parser.jay" +void case_304() +#line 2498 "cs-parser.jay" { lexer.EventParsing = true; @@ -5798,8 +5813,8 @@ void case_303() current_local_parameters = null; } -void case_304() -#line 2505 "cs-parser.jay" +void case_305() +#line 2514 "cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone) { report.Error (1609, GetLocation (yyVals[-1+yyTop]), "Modifiers cannot be placed on event accessor declarations"); @@ -5812,8 +5827,8 @@ void case_304() lexer.EventParsing = false; } -void case_305() -#line 2517 "cs-parser.jay" +void case_306() +#line 2526 "cs-parser.jay" { lexer.EventParsing = true; @@ -5827,30 +5842,30 @@ void case_305() current_local_parameters = null; } -void case_306() -#line 2533 "cs-parser.jay" +void case_307() +#line 2542 "cs-parser.jay" { report.Error (73, lexer.Location, "An add or remove accessor must have a body"); yyVal = null; } -void case_308() -#line 2542 "cs-parser.jay" +void case_309() +#line 2551 "cs-parser.jay" { current_type.UnattachedAttributes = (Attributes) yyVals[-1+yyTop]; report.Error (1519, GetLocation (yyVals[-1+yyTop]), "An attribute is missing member declaration"); lexer.putback ('}'); } -void case_309() -#line 2555 "cs-parser.jay" +void case_310() +#line 2564 "cs-parser.jay" { if (doc_support) enumTypeComment = Lexer.consume_doc_comment (); } -void case_310() -#line 2560 "cs-parser.jay" +void case_311() +#line 2569 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; @@ -5868,16 +5883,16 @@ void case_310() } } -void case_311() -#line 2577 "cs-parser.jay" +void case_312() +#line 2586 "cs-parser.jay" { /* here will be evaluated after CLOSE_BLACE is consumed.*/ if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } -void case_312() -#line 2583 "cs-parser.jay" +void case_313() +#line 2592 "cs-parser.jay" { lbag.AppendToMember (current_container, GetLocation (yyVals[-1+yyTop])); if (yyVals[0+yyTop] != null) { @@ -5894,29 +5909,29 @@ void case_312() yyVal = pop_current_class (); } -void case_314() -#line 2603 "cs-parser.jay" +void case_315() +#line 2612 "cs-parser.jay" { savedLocation = GetLocation (yyVals[-1+yyTop]); yyVal = yyVals[0+yyTop]; } -void case_315() -#line 2608 "cs-parser.jay" +void case_316() +#line 2617 "cs-parser.jay" { Error_TypeExpected (GetLocation (yyVals[-1+yyTop])); yyVal = null; } -void case_320() -#line 2626 "cs-parser.jay" +void case_321() +#line 2635 "cs-parser.jay" { lbag.AppendToMember (current_container, GetLocation (yyVals[-1+yyTop])); yyVal = yyVals[0+yyTop]; } -void case_321() -#line 2634 "cs-parser.jay" +void case_322() +#line 2643 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var em = new EnumMember ((Enum) current_type, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-1+yyTop]); @@ -5930,8 +5945,8 @@ void case_321() yyVal = em; } -void case_322() -#line 2647 "cs-parser.jay" +void case_323() +#line 2656 "cs-parser.jay" { ++lexer.parsing_block; if (doc_support) { @@ -5940,8 +5955,8 @@ void case_322() } } -void case_323() -#line 2655 "cs-parser.jay" +void case_324() +#line 2664 "cs-parser.jay" { --lexer.parsing_block; @@ -5956,8 +5971,8 @@ void case_323() yyVal = em; } -void case_324() -#line 2669 "cs-parser.jay" +void case_325() +#line 2678 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -5973,8 +5988,8 @@ void case_324() yyVal = em; } -void case_327() -#line 2696 "cs-parser.jay" +void case_328() +#line 2705 "cs-parser.jay" { valid_param_mod = 0; @@ -5990,8 +6005,8 @@ void case_327() lexer.ConstraintsParsing = true; } -void case_329() -#line 2715 "cs-parser.jay" +void case_330() +#line 2724 "cs-parser.jay" { if (doc_support) { current_delegate.DocComment = Lexer.consume_doc_comment (); @@ -6007,8 +6022,8 @@ void case_329() current_delegate = null; } -void case_331() -#line 2734 "cs-parser.jay" +void case_332() +#line 2743 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "nullable types"); @@ -6016,8 +6031,8 @@ void case_331() yyVal = ComposedTypeSpecifier.CreateNullable (GetLocation (yyVals[0+yyTop])); } -void case_333() -#line 2745 "cs-parser.jay" +void case_334() +#line 2754 "cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; @@ -6026,23 +6041,23 @@ void case_333() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_335() -#line 2757 "cs-parser.jay" +void case_336() +#line 2766 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_336() -#line 2766 "cs-parser.jay" +void case_337() +#line 2775 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new SimpleName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } -void case_338() -#line 2778 "cs-parser.jay" +void case_339() +#line 2787 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "generics"); @@ -6054,15 +6069,15 @@ void case_338() yyVal = yyVals[-1+yyTop];; } -void case_339() -#line 2789 "cs-parser.jay" +void case_340() +#line 2798 "cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = new TypeArguments (); } -void case_340() -#line 2797 "cs-parser.jay" +void case_341() +#line 2806 "cs-parser.jay" { TypeArguments type_args = new TypeArguments (); type_args.Add ((FullNamedExpression) yyVals[0+yyTop]); @@ -6070,8 +6085,8 @@ void case_340() locationListStack.Push (new List ()); } -void case_341() -#line 2804 "cs-parser.jay" +void case_342() +#line 2813 "cs-parser.jay" { TypeArguments type_args = (TypeArguments) yyVals[-2+yyTop]; type_args.Add ((FullNamedExpression) yyVals[0+yyTop]); @@ -6079,16 +6094,16 @@ void case_341() locationListStack.Peek ().Add (GetLocation (yyVals[-1+yyTop])); } -void case_343() -#line 2821 "cs-parser.jay" +void case_344() +#line 2830 "cs-parser.jay" { lexer.parsing_generic_declaration = false; var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberName (lt.Value, (TypeParameters)yyVals[0+yyTop], lt.Location); } -void case_344() -#line 2830 "cs-parser.jay" +void case_345() +#line 2839 "cs-parser.jay" { MemberName mn = (MemberName)yyVals[0+yyTop]; if (mn.TypeParameters != null) @@ -6096,38 +6111,38 @@ void case_344() mn.GetSignatureForError ())); } -void case_346() -#line 2841 "cs-parser.jay" +void case_347() +#line 2850 "cs-parser.jay" { lexer.parsing_generic_declaration = false; var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberName (lt.Value, (TypeParameters) yyVals[0+yyTop], (ATypeNameExpression) yyVals[-2+yyTop], lt.Location); } -void case_347() -#line 2850 "cs-parser.jay" +void case_348() +#line 2859 "cs-parser.jay" { lexer.parsing_generic_declaration = false; yyVal = new MemberName (TypeDefinition.DefaultIndexerName, GetLocation (yyVals[0+yyTop])); } -void case_348() -#line 2855 "cs-parser.jay" +void case_349() +#line 2864 "cs-parser.jay" { lexer.parsing_generic_declaration = false; yyVal = new MemberName (TypeDefinition.DefaultIndexerName, null, (ATypeNameExpression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } -void case_349() -#line 2863 "cs-parser.jay" +void case_350() +#line 2872 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new SimpleName (lt.Value, (TypeArguments) yyVals[-1+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_350() -#line 2869 "cs-parser.jay" +void case_351() +#line 2878 "cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; @@ -6136,16 +6151,16 @@ void case_350() lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_351() -#line 2877 "cs-parser.jay" +void case_352() +#line 2886 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberAccess ((ATypeNameExpression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[-1+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_353() -#line 2887 "cs-parser.jay" +void case_354() +#line 2896 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "generics"); @@ -6157,8 +6172,8 @@ void case_353() lbag.AddLocation (yyVals[-1+yyTop], list); } -void case_354() -#line 2901 "cs-parser.jay" +void case_355() +#line 2910 "cs-parser.jay" { var tparams = new TypeParameters (); tparams.Add ((TypeParameter)yyVals[0+yyTop]); @@ -6166,8 +6181,8 @@ void case_354() locationListStack.Push (new List ()); } -void case_355() -#line 2908 "cs-parser.jay" +void case_356() +#line 2917 "cs-parser.jay" { var tparams = (TypeParameters) yyVals[-2+yyTop]; tparams.Add ((TypeParameter)yyVals[0+yyTop]); @@ -6175,15 +6190,15 @@ void case_355() locationListStack.Peek ().Add (GetLocation (yyVals[-1+yyTop])); } -void case_356() -#line 2918 "cs-parser.jay" +void case_357() +#line 2927 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken)yyVals[0+yyTop]; yyVal = new TypeParameter (new MemberName (lt.Value, lt.Location), (Attributes)yyVals[-2+yyTop], (Variance) yyVals[-1+yyTop]); } -void case_357() -#line 2923 "cs-parser.jay" +void case_358() +#line 2932 "cs-parser.jay" { if (GetTokenName (yyToken) == "type") report.Error (81, GetLocation (yyVals[0+yyTop]), "Type parameter declaration must be an identifier not a type"); @@ -6193,29 +6208,29 @@ void case_357() yyVal = new TypeParameter (MemberName.Null, null, Variance.None); } -void case_362() -#line 2957 "cs-parser.jay" +void case_363() +#line 2966 "cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } -void case_364() -#line 2966 "cs-parser.jay" +void case_365() +#line 2975 "cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } -void case_366() -#line 2975 "cs-parser.jay" +void case_367() +#line 2984 "cs-parser.jay" { report.Error (1536, GetLocation (yyVals[0+yyTop]), "Invalid parameter type `void'"); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } -void case_369() -#line 2991 "cs-parser.jay" +void case_370() +#line 3000 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { yyVal = new ComposedCast ((ATypeNameExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); @@ -6228,23 +6243,23 @@ void case_369() } } -void case_371() -#line 3007 "cs-parser.jay" +void case_372() +#line 3016 "cs-parser.jay" { if (yyVals[0+yyTop] != null) yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } -void case_374() -#line 3023 "cs-parser.jay" +void case_375() +#line 3032 "cs-parser.jay" { var types = new List (2); types.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = types; } -void case_375() -#line 3029 "cs-parser.jay" +void case_376() +#line 3038 "cs-parser.jay" { var types = (List) yyVals[-2+yyTop]; types.Add ((FullNamedExpression) yyVals[0+yyTop]); @@ -6252,8 +6267,8 @@ void case_375() yyVal = types; } -void case_376() -#line 3039 "cs-parser.jay" +void case_377() +#line 3048 "cs-parser.jay" { if (yyVals[0+yyTop] is ComposedCast) { report.Error (1521, GetLocation (yyVals[0+yyTop]), "Invalid base type `{0}'", ((ComposedCast)yyVals[0+yyTop]).GetSignatureForError ()); @@ -6261,29 +6276,29 @@ void case_376() yyVal = yyVals[0+yyTop]; } -void case_413() -#line 3103 "cs-parser.jay" +void case_414() +#line 3112 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new SimpleName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } -void case_414() -#line 3107 "cs-parser.jay" +void case_415() +#line 3116 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionSimpleName (MemberName.MakeName (lt.Value, null), lt.Location); } -void case_425() -#line 3148 "cs-parser.jay" +void case_426() +#line 3157 "cs-parser.jay" { yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_427() -#line 3160 "cs-parser.jay" +void case_428() +#line 3169 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location) { @@ -6291,8 +6306,8 @@ void case_427() }; } -void case_428() -#line 3167 "cs-parser.jay" +void case_429() +#line 3176 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location) { @@ -6300,8 +6315,8 @@ void case_428() }; } -void case_429() -#line 3174 "cs-parser.jay" +void case_430() +#line 3183 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess (new BaseThis (GetLocation (yyVals[-3+yyTop])), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location) { @@ -6309,8 +6324,8 @@ void case_429() }; } -void case_430() -#line 3181 "cs-parser.jay" +void case_431() +#line 3190 "cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; @@ -6319,29 +6334,29 @@ void case_430() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_432() -#line 3191 "cs-parser.jay" +void case_433() +#line 3200 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionMemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, lt.Location); } -void case_434() -#line 3199 "cs-parser.jay" +void case_435() +#line 3208 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionMemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, lt.Location); } -void case_435() -#line 3207 "cs-parser.jay" +void case_436() +#line 3216 "cs-parser.jay" { yyVal = new Invocation ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_436() -#line 3212 "cs-parser.jay" +void case_437() +#line 3221 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -6349,8 +6364,8 @@ void case_436() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_439() -#line 3228 "cs-parser.jay" +void case_440() +#line 3237 "cs-parser.jay" { if (yyVals[-1+yyTop] == null) { yyVal = new CollectionOrObjectInitializers (new List (), GetLocation (yyVals[-2+yyTop])); @@ -6361,23 +6376,23 @@ void case_439() } } -void case_440() -#line 3238 "cs-parser.jay" +void case_441() +#line 3247 "cs-parser.jay" { yyVal = new CollectionOrObjectInitializers ((List) yyVals[-2+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_443() -#line 3254 "cs-parser.jay" +void case_444() +#line 3263 "cs-parser.jay" { var a = new List (); a.Add ((Expression) yyVals[0+yyTop]); yyVal = a; } -void case_444() -#line 3260 "cs-parser.jay" +void case_445() +#line 3269 "cs-parser.jay" { var a = (List)yyVals[-2+yyTop]; a.Add ((Expression) yyVals[0+yyTop]); @@ -6385,23 +6400,23 @@ void case_444() yyVal = a; } -void case_445() -#line 3266 "cs-parser.jay" +void case_446() +#line 3275 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = yyVals[-1+yyTop]; } -void case_446() -#line 3274 "cs-parser.jay" +void case_447() +#line 3283 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new ElementInitializer (lt.Value, (Expression)yyVals[0+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_448() -#line 3283 "cs-parser.jay" +void case_449() +#line 3292 "cs-parser.jay" { CompletionSimpleName csn = yyVals[-1+yyTop] as CompletionSimpleName; if (csn == null) @@ -6410,8 +6425,8 @@ void case_448() yyVal = new CompletionElementInitializer (csn.Prefix, csn.Location); } -void case_449() -#line 3291 "cs-parser.jay" +void case_450() +#line 3300 "cs-parser.jay" { if (yyVals[-1+yyTop] == null) yyVal = null; @@ -6421,24 +6436,24 @@ void case_449() } } -void case_450() -#line 3300 "cs-parser.jay" +void case_451() +#line 3309 "cs-parser.jay" { report.Error (1920, GetLocation (yyVals[-1+yyTop]), "An element initializer cannot be empty"); yyVal = new CollectionElementInitializer (new List (), GetLocation (yyVals[-1+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_455() -#line 3319 "cs-parser.jay" +void case_456() +#line 3328 "cs-parser.jay" { Arguments list = new Arguments (4); list.Add ((Argument) yyVals[0+yyTop]); yyVal = list; } -void case_456() -#line 3325 "cs-parser.jay" +void case_457() +#line 3334 "cs-parser.jay" { Arguments list = (Arguments) yyVals[-2+yyTop]; if (list [list.Count - 1] is NamedArgument) @@ -6449,8 +6464,8 @@ void case_456() yyVal = list; } -void case_457() -#line 3335 "cs-parser.jay" +void case_458() +#line 3344 "cs-parser.jay" { Arguments list = (Arguments) yyVals[-2+yyTop]; NamedArgument a = (NamedArgument) yyVals[0+yyTop]; @@ -6466,80 +6481,81 @@ void case_457() yyVal = list; } -void case_458() -#line 3350 "cs-parser.jay" +void case_459() +#line 3359 "cs-parser.jay" { - lexer.putback (')'); /* TODO: Wrong but what can I do*/ + if (lexer.putback_char == -1) + lexer.putback (')'); /* TODO: Wrong but what can I do*/ Error_SyntaxError (yyToken); yyVal = yyVals[-2+yyTop]; } -void case_459() -#line 3356 "cs-parser.jay" +void case_460() +#line 3366 "cs-parser.jay" { report.Error (839, GetLocation (yyVals[-1+yyTop]), "An argument is missing"); yyVal = null; } -void case_464() -#line 3377 "cs-parser.jay" +void case_465() +#line 3387 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Ref); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_465() -#line 3382 "cs-parser.jay" +void case_466() +#line 3392 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Out); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_466() -#line 3387 "cs-parser.jay" +void case_467() +#line 3397 "cs-parser.jay" { yyVal = new Argument (new Arglist ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]))); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_467() -#line 3392 "cs-parser.jay" +void case_468() +#line 3402 "cs-parser.jay" { yyVal = new Argument (new Arglist (GetLocation (yyVals[-2+yyTop]))); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_469() -#line 3404 "cs-parser.jay" +void case_470() +#line 3414 "cs-parser.jay" { yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_470() -#line 3409 "cs-parser.jay" +void case_471() +#line 3419 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_471() -#line 3414 "cs-parser.jay" +void case_472() +#line 3424 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new ElementAccess ((Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-1+yyTop])); } -void case_472() -#line 3422 "cs-parser.jay" +void case_473() +#line 3432 "cs-parser.jay" { var list = new List (4); list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } -void case_473() -#line 3428 "cs-parser.jay" +void case_474() +#line 3438 "cs-parser.jay" { var list = (List) yyVals[-2+yyTop]; list.Add ((Expression) yyVals[0+yyTop]); @@ -6547,23 +6563,23 @@ void case_473() yyVal = list; } -void case_474() -#line 3434 "cs-parser.jay" +void case_475() +#line 3444 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = yyVals[-1+yyTop]; } -void case_475() -#line 3442 "cs-parser.jay" +void case_476() +#line 3452 "cs-parser.jay" { Arguments args = new Arguments (4); args.Add ((Argument) yyVals[0+yyTop]); yyVal = args; } -void case_476() -#line 3448 "cs-parser.jay" +void case_477() +#line 3458 "cs-parser.jay" { Arguments args = (Arguments) yyVals[-2+yyTop]; if (args [args.Count - 1] is NamedArgument && !(yyVals[0+yyTop] is NamedArgument)) @@ -6574,22 +6590,22 @@ void case_476() yyVal = args; } -void case_480() -#line 3476 "cs-parser.jay" +void case_481() +#line 3486 "cs-parser.jay" { yyVal = new ElementAccess (new BaseThis (GetLocation (yyVals[-3+yyTop])), (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_481() -#line 3481 "cs-parser.jay" +void case_482() +#line 3491 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new ElementAccess (null, null, GetLocation (yyVals[-1+yyTop])); } -void case_484() -#line 3503 "cs-parser.jay" +void case_485() +#line 3513 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { if (lang_version <= LanguageVersion.ISO_2) @@ -6603,8 +6619,8 @@ void case_484() lbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_485() -#line 3516 "cs-parser.jay" +void case_486() +#line 3526 "cs-parser.jay" { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "collection initializers"); @@ -6612,8 +6628,8 @@ void case_485() yyVal = new NewInitialize ((FullNamedExpression) yyVals[-1+yyTop], null, (CollectionOrObjectInitializers) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_486() -#line 3528 "cs-parser.jay" +void case_487() +#line 3538 "cs-parser.jay" { yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-5+yyTop], (List) yyVals[-3+yyTop], new ComposedTypeSpecifier (((List) yyVals[-3+yyTop]).Count, GetLocation (yyVals[-4+yyTop])) { @@ -6622,8 +6638,8 @@ void case_486() lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_487() -#line 3536 "cs-parser.jay" +void case_488() +#line 3546 "cs-parser.jay" { if (yyVals[0+yyTop] == null) report.Error (1586, GetLocation (yyVals[-3+yyTop]), "Array creation must have array size or array initializer"); @@ -6631,8 +6647,8 @@ void case_487() yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-2+yyTop], (ComposedTypeSpecifier) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); } -void case_488() -#line 3543 "cs-parser.jay" +void case_489() +#line 3553 "cs-parser.jay" { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "implicitly typed arrays"); @@ -6640,30 +6656,30 @@ void case_488() yyVal = new ImplicitlyTypedArrayCreation ((ComposedTypeSpecifier) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_489() -#line 3550 "cs-parser.jay" +void case_490() +#line 3560 "cs-parser.jay" { report.Error (178, GetLocation (yyVals[-1+yyTop]), "Invalid rank specifier, expecting `,' or `]'"); yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-5+yyTop], null, GetLocation (yyVals[-6+yyTop])); } -void case_490() -#line 3555 "cs-parser.jay" +void case_491() +#line 3565 "cs-parser.jay" { Error_SyntaxError (yyToken); /* It can be any of new expression, create the most common one*/ yyVal = new New ((FullNamedExpression) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop])); } -void case_492() -#line 3567 "cs-parser.jay" +void case_493() +#line 3577 "cs-parser.jay" { --lexer.parsing_type; yyVal = yyVals[0+yyTop]; } -void case_493() -#line 3575 "cs-parser.jay" +void case_494() +#line 3585 "cs-parser.jay" { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "anonymous types"); @@ -6674,16 +6690,16 @@ void case_493() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_498() -#line 3598 "cs-parser.jay" +void case_499() +#line 3608 "cs-parser.jay" { var a = new List (4); a.Add ((AnonymousTypeParameter) yyVals[0+yyTop]); yyVal = a; } -void case_499() -#line 3604 "cs-parser.jay" +void case_500() +#line 3614 "cs-parser.jay" { var a = (List) yyVals[-2+yyTop]; a.Add ((AnonymousTypeParameter) yyVals[0+yyTop]); @@ -6692,60 +6708,60 @@ void case_499() yyVal = a; } -void case_500() -#line 3615 "cs-parser.jay" +void case_501() +#line 3625 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken)yyVals[-2+yyTop]; yyVal = new AnonymousTypeParameter ((Expression)yyVals[0+yyTop], lt.Value, lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_501() -#line 3621 "cs-parser.jay" +void case_502() +#line 3631 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken)yyVals[0+yyTop]; yyVal = new AnonymousTypeParameter (new SimpleName (lt.Value, lt.Location), lt.Value, lt.Location); } -void case_502() -#line 3627 "cs-parser.jay" +void case_503() +#line 3637 "cs-parser.jay" { MemberAccess ma = (MemberAccess) yyVals[0+yyTop]; yyVal = new AnonymousTypeParameter (ma, ma.Name, ma.Location); } -void case_503() -#line 3632 "cs-parser.jay" +void case_504() +#line 3642 "cs-parser.jay" { report.Error (746, lexer.Location, "Invalid anonymous type member declarator. Anonymous type members must be a member assignment, simple name or member access expression"); yyVal = null; } -void case_507() -#line 3647 "cs-parser.jay" +void case_508() +#line 3657 "cs-parser.jay" { ((ComposedTypeSpecifier) yyVals[-1+yyTop]).Next = (ComposedTypeSpecifier) yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } -void case_508() -#line 3655 "cs-parser.jay" +void case_509() +#line 3665 "cs-parser.jay" { yyVal = ComposedTypeSpecifier.CreateArrayDimension (1, GetLocation (yyVals[-1+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_509() -#line 3660 "cs-parser.jay" +void case_510() +#line 3670 "cs-parser.jay" { yyVal = ComposedTypeSpecifier.CreateArrayDimension ((int)yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_514() -#line 3690 "cs-parser.jay" +void case_515() +#line 3700 "cs-parser.jay" { var ai = new ArrayInitializer (0, GetLocation (yyVals[-1+yyTop])); ai.VariableDeclaration = current_variable; @@ -6753,8 +6769,8 @@ void case_514() yyVal = ai; } -void case_515() -#line 3697 "cs-parser.jay" +void case_516() +#line 3707 "cs-parser.jay" { var ai = new ArrayInitializer ((List) yyVals[-2+yyTop], GetLocation (yyVals[-3+yyTop])); ai.VariableDeclaration = current_variable; @@ -6766,16 +6782,16 @@ void case_515() yyVal = ai; } -void case_516() -#line 3711 "cs-parser.jay" +void case_517() +#line 3721 "cs-parser.jay" { var list = new List (4); list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } -void case_517() -#line 3717 "cs-parser.jay" +void case_518() +#line 3727 "cs-parser.jay" { var list = (List) yyVals[-2+yyTop]; list.Add ((Expression) yyVals[0+yyTop]); @@ -6783,31 +6799,31 @@ void case_517() yyVal = list; } -void case_519() -#line 3731 "cs-parser.jay" +void case_520() +#line 3741 "cs-parser.jay" { lexer.TypeOfParsing = false; yyVal = new TypeOf ((FullNamedExpression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_522() -#line 3742 "cs-parser.jay" +void case_523() +#line 3752 "cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = null; } -void case_523() -#line 3750 "cs-parser.jay" +void case_524() +#line 3760 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new SimpleName (lt.Value, (int) yyVals[0+yyTop], lt.Location); } -void case_524() -#line 3756 "cs-parser.jay" +void case_525() +#line 3766 "cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; @@ -6816,8 +6832,8 @@ void case_524() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_525() -#line 3764 "cs-parser.jay" +void case_526() +#line 3774 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; @@ -6826,8 +6842,8 @@ void case_525() }; } -void case_526() -#line 3772 "cs-parser.jay" +void case_527() +#line 3782 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; @@ -6836,8 +6852,8 @@ void case_526() }; } -void case_527() -#line 3780 "cs-parser.jay" +void case_528() +#line 3790 "cs-parser.jay" { var tne = (ATypeNameExpression) yyVals[-3+yyTop]; if (tne.HasTypeArguments) @@ -6849,8 +6865,8 @@ void case_527() }; } -void case_528() -#line 3794 "cs-parser.jay" +void case_529() +#line 3804 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "generics"); @@ -6858,8 +6874,8 @@ void case_528() yyVal = yyVals[0+yyTop]; } -void case_529() -#line 3804 "cs-parser.jay" +void case_530() +#line 3814 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; if (lang_version == LanguageVersion.ISO_1) @@ -6868,36 +6884,36 @@ void case_529() yyVal = lt; } -void case_530() -#line 3815 "cs-parser.jay" +void case_531() +#line 3825 "cs-parser.jay" { yyVal = new SizeOf ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_531() -#line 3823 "cs-parser.jay" +void case_532() +#line 3833 "cs-parser.jay" { yyVal = new CheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_532() -#line 3831 "cs-parser.jay" +void case_533() +#line 3841 "cs-parser.jay" { yyVal = new UnCheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_533() -#line 3839 "cs-parser.jay" +void case_534() +#line 3849 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess (new Indirection ((Expression) yyVals[-3+yyTop], GetLocation (yyVals[-2+yyTop])), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); } -void case_535() -#line 3851 "cs-parser.jay" +void case_536() +#line 3861 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); if ((ParametersCompiled) yyVals[-2+yyTop] != ParametersCompiled.Undefined) { @@ -6907,8 +6923,8 @@ void case_535() } } -void case_537() -#line 3864 "cs-parser.jay" +void case_538() +#line 3874 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); @@ -6919,8 +6935,8 @@ void case_537() } } -void case_541() -#line 3889 "cs-parser.jay" +void case_542() +#line 3899 "cs-parser.jay" { valid_param_mod = 0; yyVal = yyVals[-1+yyTop]; @@ -6928,8 +6944,8 @@ void case_541() savedCloseLocation = GetLocation (yyVals[-2+yyTop]); } -void case_542() -#line 3899 "cs-parser.jay" +void case_543() +#line 3909 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "default value expression"); @@ -6938,15 +6954,15 @@ void case_542() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_546() -#line 3919 "cs-parser.jay" +void case_547() +#line 3929 "cs-parser.jay" { yyVal = new Cast ((FullNamedExpression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_547() -#line 3924 "cs-parser.jay" +void case_548() +#line 3934 "cs-parser.jay" { if (!async_block) { if (current_anonymous_method is LambdaExpression) { @@ -6966,134 +6982,134 @@ void case_547() yyVal = new Await ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_556() -#line 3979 "cs-parser.jay" +void case_557() +#line 3989 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Multiply, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_557() -#line 3984 "cs-parser.jay" +void case_558() +#line 3994 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Division, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_558() -#line 3989 "cs-parser.jay" +void case_559() +#line 3999 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Modulus, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_560() -#line 3998 "cs-parser.jay" +void case_561() +#line 4008 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Addition, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_561() -#line 4003 "cs-parser.jay" +void case_562() +#line 4013 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_565() -#line 4020 "cs-parser.jay" +void case_566() +#line 4030 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LeftShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_566() -#line 4025 "cs-parser.jay" +void case_567() +#line 4035 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.RightShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_568() -#line 4034 "cs-parser.jay" +void case_569() +#line 4044 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LessThan, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_569() -#line 4039 "cs-parser.jay" +void case_570() +#line 4049 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.GreaterThan, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_570() -#line 4044 "cs-parser.jay" +void case_571() +#line 4054 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LessThanOrEqual, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_571() -#line 4049 "cs-parser.jay" +void case_572() +#line 4059 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.GreaterThanOrEqual, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_573() -#line 4058 "cs-parser.jay" +void case_574() +#line 4068 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Equality, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_574() -#line 4063 "cs-parser.jay" +void case_575() +#line 4073 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Inequality, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_576() -#line 4072 "cs-parser.jay" +void case_577() +#line 4082 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.BitwiseAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_578() -#line 4081 "cs-parser.jay" +void case_579() +#line 4091 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.ExclusiveOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_580() -#line 4090 "cs-parser.jay" +void case_581() +#line 4100 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.BitwiseOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_582() -#line 4099 "cs-parser.jay" +void case_583() +#line 4109 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LogicalAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_584() -#line 4108 "cs-parser.jay" +void case_585() +#line 4118 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LogicalOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_586() -#line 4117 "cs-parser.jay" +void case_587() +#line 4127 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "null coalescing operator"); @@ -7102,99 +7118,99 @@ void case_586() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_588() -#line 4129 "cs-parser.jay" +void case_589() +#line 4139 "cs-parser.jay" { yyVal = new Conditional (new BooleanExpression ((Expression) yyVals[-4+yyTop]), (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_589() -#line 4134 "cs-parser.jay" +void case_590() +#line 4144 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Conditional (new BooleanExpression ((Expression) yyVals[-3+yyTop]), (Expression) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop])); } -void case_590() -#line 4142 "cs-parser.jay" +void case_591() +#line 4152 "cs-parser.jay" { yyVal = new SimpleAssign ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_591() -#line 4147 "cs-parser.jay" +void case_592() +#line 4157 "cs-parser.jay" { yyVal = new CompoundAssign (Binary.Operator.Multiply, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_592() -#line 4152 "cs-parser.jay" +void case_593() +#line 4162 "cs-parser.jay" { yyVal = new CompoundAssign (Binary.Operator.Division, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_593() -#line 4157 "cs-parser.jay" +void case_594() +#line 4167 "cs-parser.jay" { yyVal = new CompoundAssign (Binary.Operator.Modulus, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_594() -#line 4162 "cs-parser.jay" +void case_595() +#line 4172 "cs-parser.jay" { yyVal = new CompoundAssign (Binary.Operator.Addition, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_595() -#line 4167 "cs-parser.jay" +void case_596() +#line 4177 "cs-parser.jay" { yyVal = new CompoundAssign (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_596() -#line 4172 "cs-parser.jay" +void case_597() +#line 4182 "cs-parser.jay" { yyVal = new CompoundAssign (Binary.Operator.LeftShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_597() -#line 4177 "cs-parser.jay" +void case_598() +#line 4187 "cs-parser.jay" { yyVal = new CompoundAssign (Binary.Operator.RightShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_598() -#line 4182 "cs-parser.jay" +void case_599() +#line 4192 "cs-parser.jay" { yyVal = new CompoundAssign (Binary.Operator.BitwiseAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_599() -#line 4187 "cs-parser.jay" +void case_600() +#line 4197 "cs-parser.jay" { yyVal = new CompoundAssign (Binary.Operator.BitwiseOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_600() -#line 4192 "cs-parser.jay" +void case_601() +#line 4202 "cs-parser.jay" { yyVal = new CompoundAssign (Binary.Operator.ExclusiveOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_601() -#line 4200 "cs-parser.jay" +void case_602() +#line 4210 "cs-parser.jay" { var pars = new List (4); pars.Add ((Parameter) yyVals[0+yyTop]); @@ -7202,8 +7218,8 @@ void case_601() yyVal = pars; } -void case_602() -#line 4207 "cs-parser.jay" +void case_603() +#line 4217 "cs-parser.jay" { var pars = (List) yyVals[-2+yyTop]; Parameter p = (Parameter)yyVals[0+yyTop]; @@ -7217,39 +7233,39 @@ void case_602() yyVal = pars; } -void case_603() -#line 4223 "cs-parser.jay" +void case_604() +#line 4233 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Parameter.Modifier) yyVals[-2+yyTop], null, lt.Location); } -void case_604() -#line 4229 "cs-parser.jay" +void case_605() +#line 4239 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, Parameter.Modifier.NONE, null, lt.Location); } -void case_605() -#line 4235 "cs-parser.jay" +void case_606() +#line 4245 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new ImplicitLambdaParameter (lt.Value, lt.Location); } -void case_607() -#line 4243 "cs-parser.jay" +void case_608() +#line 4253 "cs-parser.jay" { var pars_list = (List) yyVals[0+yyTop]; yyVal = new ParametersCompiled (pars_list.ToArray ()); lbag.AddLocation (yyVal, parameterListCommas); } -void case_611() -#line 4260 "cs-parser.jay" +void case_612() +#line 4270 "cs-parser.jay" { Block b = end_block (Location.Null); b.IsCompilerGenerated = true; @@ -7257,94 +7273,94 @@ void case_611() yyVal = b; } -void case_613() -#line 4271 "cs-parser.jay" +void case_614() +#line 4281 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = EmptyExpression.Null; } -void case_614() -#line 4279 "cs-parser.jay" +void case_615() +#line 4289 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; Parameter p = new ImplicitLambdaParameter (lt.Value, lt.Location); start_anonymous (true, new ParametersCompiled (p), false, lt.Location); } -void case_615() -#line 4285 "cs-parser.jay" +void case_616() +#line 4295 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_616() -#line 4290 "cs-parser.jay" +void case_617() +#line 4300 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; Parameter p = new ImplicitLambdaParameter (lt.Value, lt.Location); start_anonymous (true, new ParametersCompiled (p), true, lt.Location); } -void case_617() -#line 4296 "cs-parser.jay" +void case_618() +#line 4306 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_619() -#line 4305 "cs-parser.jay" +void case_620() +#line 4315 "cs-parser.jay" { valid_param_mod = 0; start_anonymous (true, (ParametersCompiled) yyVals[-2+yyTop], false, GetLocation (yyVals[-4+yyTop])); } -void case_620() -#line 4310 "cs-parser.jay" +void case_621() +#line 4320 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_622() -#line 4319 "cs-parser.jay" +void case_623() +#line 4329 "cs-parser.jay" { valid_param_mod = 0; start_anonymous (true, (ParametersCompiled) yyVals[-2+yyTop], true, GetLocation (yyVals[-5+yyTop])); } -void case_623() -#line 4324 "cs-parser.jay" +void case_624() +#line 4334 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_630() -#line 4347 "cs-parser.jay" +void case_631() +#line 4357 "cs-parser.jay" { yyVal = new RefValueExpr ((Expression) yyVals[-3+yyTop], (FullNamedExpression) yyVals[-1+yyTop], GetLocation (yyVals[-5+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_631() -#line 4352 "cs-parser.jay" +void case_632() +#line 4362 "cs-parser.jay" { yyVal = new RefTypeExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_632() -#line 4357 "cs-parser.jay" +void case_633() +#line 4367 "cs-parser.jay" { yyVal = new MakeRefExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_636() -#line 4386 "cs-parser.jay" +void case_637() +#line 4396 "cs-parser.jay" { Class c = new Class (current_container, (MemberName) yyVals[0+yyTop], (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]); if (((c.ModFlags & Modifiers.STATIC) != 0) && lang_version == LanguageVersion.ISO_1) { @@ -7355,8 +7371,8 @@ void case_636() lbag.AddMember (current_container, GetModifierLocations (), GetLocation (yyVals[-2+yyTop])); } -void case_637() -#line 4397 "cs-parser.jay" +void case_638() +#line 4407 "cs-parser.jay" { lexer.ConstraintsParsing = false; @@ -7371,16 +7387,16 @@ void case_637() lexer.parsing_modifiers = true; } -void case_638() -#line 4411 "cs-parser.jay" +void case_639() +#line 4421 "cs-parser.jay" { --lexer.parsing_declaration; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } -void case_639() -#line 4417 "cs-parser.jay" +void case_640() +#line 4427 "cs-parser.jay" { if (yyVals[0+yyTop] == null) { lbag.AppendToMember (current_container, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); @@ -7390,16 +7406,16 @@ void case_639() yyVal = pop_current_class (); } -void case_642() -#line 4436 "cs-parser.jay" +void case_643() +#line 4446 "cs-parser.jay" { mod_locations = null; yyVal = ModifierNone; lexer.parsing_modifiers = false; } -void case_645() -#line 4450 "cs-parser.jay" +void case_646() +#line 4460 "cs-parser.jay" { var m1 = (Modifiers) yyVals[-1+yyTop]; var m2 = (Modifiers) yyVals[0+yyTop]; @@ -7416,8 +7432,8 @@ void case_645() yyVal = m1 | m2; } -void case_646() -#line 4469 "cs-parser.jay" +void case_647() +#line 4479 "cs-parser.jay" { yyVal = Modifiers.NEW; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); @@ -7426,92 +7442,92 @@ void case_646() report.Error (1530, GetLocation (yyVals[0+yyTop]), "Keyword `new' is not allowed on namespace elements"); } -void case_647() -#line 4477 "cs-parser.jay" +void case_648() +#line 4487 "cs-parser.jay" { yyVal = Modifiers.PUBLIC; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_648() -#line 4482 "cs-parser.jay" +void case_649() +#line 4492 "cs-parser.jay" { yyVal = Modifiers.PROTECTED; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_649() -#line 4487 "cs-parser.jay" +void case_650() +#line 4497 "cs-parser.jay" { yyVal = Modifiers.INTERNAL; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_650() -#line 4492 "cs-parser.jay" +void case_651() +#line 4502 "cs-parser.jay" { yyVal = Modifiers.PRIVATE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_651() -#line 4497 "cs-parser.jay" +void case_652() +#line 4507 "cs-parser.jay" { yyVal = Modifiers.ABSTRACT; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_652() -#line 4502 "cs-parser.jay" +void case_653() +#line 4512 "cs-parser.jay" { yyVal = Modifiers.SEALED; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_653() -#line 4507 "cs-parser.jay" +void case_654() +#line 4517 "cs-parser.jay" { yyVal = Modifiers.STATIC; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_654() -#line 4512 "cs-parser.jay" +void case_655() +#line 4522 "cs-parser.jay" { yyVal = Modifiers.READONLY; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_655() -#line 4517 "cs-parser.jay" +void case_656() +#line 4527 "cs-parser.jay" { yyVal = Modifiers.VIRTUAL; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_656() -#line 4522 "cs-parser.jay" +void case_657() +#line 4532 "cs-parser.jay" { yyVal = Modifiers.OVERRIDE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_657() -#line 4527 "cs-parser.jay" +void case_658() +#line 4537 "cs-parser.jay" { yyVal = Modifiers.EXTERN; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_658() -#line 4532 "cs-parser.jay" +void case_659() +#line 4542 "cs-parser.jay" { yyVal = Modifiers.VOLATILE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_659() -#line 4537 "cs-parser.jay" +void case_660() +#line 4547 "cs-parser.jay" { yyVal = Modifiers.UNSAFE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); @@ -7519,38 +7535,38 @@ void case_659() Error_UnsafeCodeNotAllowed (GetLocation (yyVals[0+yyTop])); } -void case_660() -#line 4544 "cs-parser.jay" +void case_661() +#line 4554 "cs-parser.jay" { yyVal = Modifiers.ASYNC; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_662() -#line 4553 "cs-parser.jay" +void case_663() +#line 4563 "cs-parser.jay" { current_type.AddBasesForPart ((List) yyVals[0+yyTop]); lbag.AppendToMember (current_type, GetLocation (yyVals[-1+yyTop])); } -void case_663() -#line 4558 "cs-parser.jay" +void case_664() +#line 4568 "cs-parser.jay" { Error_SyntaxError (yyToken); current_type.AddBasesForPart ((List) yyVals[-1+yyTop]); } -void case_666() -#line 4575 "cs-parser.jay" +void case_667() +#line 4585 "cs-parser.jay" { var constraints = new List (1); constraints.Add ((Constraints) yyVals[0+yyTop]); yyVal = constraints; } -void case_667() -#line 4581 "cs-parser.jay" +void case_668() +#line 4591 "cs-parser.jay" { var constraints = (List) yyVals[-1+yyTop]; Constraints new_constraint = (Constraints)yyVals[0+yyTop]; @@ -7567,16 +7583,16 @@ void case_667() yyVal = constraints; } -void case_668() -#line 4600 "cs-parser.jay" +void case_669() +#line 4610 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new Constraints (new SimpleMemberName (lt.Value, lt.Location), (List) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_669() -#line 4606 "cs-parser.jay" +void case_670() +#line 4616 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7584,16 +7600,16 @@ void case_669() yyVal = new Constraints (new SimpleMemberName (lt.Value, lt.Location), null, GetLocation (yyVals[-2+yyTop])); } -void case_670() -#line 4616 "cs-parser.jay" +void case_671() +#line 4626 "cs-parser.jay" { var constraints = new List (1); constraints.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = constraints; } -void case_671() -#line 4622 "cs-parser.jay" +void case_672() +#line 4632 "cs-parser.jay" { var constraints = (List) yyVals[-2+yyTop]; var prev = constraints [constraints.Count - 1] as SpecialContraintExpr; @@ -7618,8 +7634,8 @@ void case_671() yyVal = constraints; } -void case_672() -#line 4649 "cs-parser.jay" +void case_673() +#line 4659 "cs-parser.jay" { if (yyVals[0+yyTop] is ComposedCast) report.Error (706, GetLocation (yyVals[0+yyTop]), "Invalid constraint type `{0}'", ((ComposedCast)yyVals[0+yyTop]).GetSignatureForError ()); @@ -7627,15 +7643,15 @@ void case_672() yyVal = yyVals[0+yyTop]; } -void case_673() -#line 4656 "cs-parser.jay" +void case_674() +#line 4666 "cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Constructor, GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_677() -#line 4676 "cs-parser.jay" +void case_678() +#line 4686 "cs-parser.jay" { if (lang_version <= LanguageVersion.V_3) FeatureIsNotAvailable (lexer.Location, "generic type variance"); @@ -7643,65 +7659,65 @@ void case_677() yyVal = yyVals[0+yyTop]; } -void case_678() -#line 4686 "cs-parser.jay" +void case_679() +#line 4696 "cs-parser.jay" { yyVal = Variance.Covariant; savedLocation = GetLocation (yyVals[0+yyTop]); } -void case_679() -#line 4691 "cs-parser.jay" +void case_680() +#line 4701 "cs-parser.jay" { yyVal = Variance.Contravariant; savedLocation = GetLocation (yyVals[0+yyTop]); } -void case_680() -#line 4712 "cs-parser.jay" +void case_681() +#line 4722 "cs-parser.jay" { ++lexer.parsing_block; start_block (GetLocation (yyVals[0+yyTop])); } -void case_682() -#line 4724 "cs-parser.jay" +void case_683() +#line 4734 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_683() -#line 4729 "cs-parser.jay" +void case_684() +#line 4739 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (lexer.Location); } -void case_684() -#line 4738 "cs-parser.jay" +void case_685() +#line 4748 "cs-parser.jay" { ++lexer.parsing_block; current_block.StartLocation = GetLocation (yyVals[0+yyTop]); } -void case_685() -#line 4743 "cs-parser.jay" +void case_686() +#line 4753 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_686() -#line 4747 "cs-parser.jay" +void case_687() +#line 4757 "cs-parser.jay" { report.Error (1525, GetLocation (yyVals[0+yyTop]), "Unexpected symbol '}', expected '{'"); lexer.putback ('}'); yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_694() -#line 4776 "cs-parser.jay" +void case_695() +#line 4786 "cs-parser.jay" { Error_SyntaxError (yyToken); var lt =(Tokenizer.LocatedToken) yyVals[-1+yyTop]; @@ -7710,43 +7726,43 @@ void case_694() yyVal = null; } -void case_695() -#line 4785 "cs-parser.jay" +void case_696() +#line 4795 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } -void case_728() -#line 4849 "cs-parser.jay" +void case_729() +#line 4859 "cs-parser.jay" { report.Error (1023, GetLocation (yyVals[0+yyTop]), "An embedded statement may not be a declaration or labeled statement"); yyVal = null; } -void case_729() -#line 4854 "cs-parser.jay" +void case_730() +#line 4864 "cs-parser.jay" { report.Error (1023, GetLocation (yyVals[0+yyTop]), "An embedded statement may not be a declaration or labeled statement"); yyVal = null; } -void case_730() -#line 4859 "cs-parser.jay" +void case_731() +#line 4869 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop])); } -void case_731() -#line 4867 "cs-parser.jay" +void case_732() +#line 4877 "cs-parser.jay" { /* Uses lexer.Location because semicolon location is not kept in quick mode*/ yyVal = new EmptyStatement (lexer.Location); } -void case_732() -#line 4875 "cs-parser.jay" +void case_733() +#line 4885 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; LabeledStatement labeled = new LabeledStatement (lt.Value, current_block, lt.Location); @@ -7755,8 +7771,8 @@ void case_732() current_block.AddStatement (labeled); } -void case_735() -#line 4888 "cs-parser.jay" +void case_736() +#line 4898 "cs-parser.jay" { if (yyVals[-1+yyTop] is VarExpr) yyVals[-1+yyTop] = new SimpleName ("var", ((VarExpr) yyVals[-1+yyTop]).Location); @@ -7764,8 +7780,8 @@ void case_735() yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } -void case_736() -#line 4904 "cs-parser.jay" +void case_737() +#line 4914 "cs-parser.jay" { /* Ok, the above "primary_expression" is there to get rid of*/ /* both reduce/reduce and shift/reduces in the grammar, it should*/ @@ -7796,8 +7812,8 @@ void case_736() } } -void case_737() -#line 4934 "cs-parser.jay" +void case_738() +#line 4944 "cs-parser.jay" { ATypeNameExpression expr = yyVals[-1+yyTop] as ATypeNameExpression; @@ -7809,8 +7825,8 @@ void case_737() } } -void case_738() -#line 4945 "cs-parser.jay" +void case_739() +#line 4955 "cs-parser.jay" { if (yyVals[0+yyTop] == null) yyVal = yyVals[-1+yyTop]; @@ -7818,22 +7834,22 @@ void case_738() yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } -void case_741() -#line 4960 "cs-parser.jay" +void case_742() +#line 4970 "cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } -void case_743() -#line 4969 "cs-parser.jay" +void case_744() +#line 4979 "cs-parser.jay" { ((ComposedTypeSpecifier) yyVals[-1+yyTop]).Next = (ComposedTypeSpecifier) yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } -void case_746() -#line 4985 "cs-parser.jay" +void case_747() +#line 4995 "cs-parser.jay" { if (async_block) { report.Error (4003, GetLocation (yyVals[0+yyTop]), "`await' cannot be used as an identifier within an async method or lambda expression"); @@ -7841,8 +7857,8 @@ void case_746() } } -void case_747() -#line 4995 "cs-parser.jay" +void case_748() +#line 5005 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, lt.Location); @@ -7850,16 +7866,16 @@ void case_747() current_variable = new BlockVariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_748() -#line 5002 "cs-parser.jay" +void case_749() +#line 5012 "cs-parser.jay" { yyVal = current_variable; current_variable = null; lbag.AppendTo (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_749() -#line 5008 "cs-parser.jay" +void case_750() +#line 5018 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location); @@ -7867,8 +7883,8 @@ void case_749() current_variable = new BlockConstantDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_750() -#line 5015 "cs-parser.jay" +void case_751() +#line 5025 "cs-parser.jay" { if (current_variable.Initializer != null) { lbag.AddLocation (current_variable, GetLocation (yyVals[-6+yyTop]), savedLocation, GetLocation (yyVals[0+yyTop])); @@ -7879,8 +7895,8 @@ void case_750() current_variable = null; } -void case_752() -#line 5028 "cs-parser.jay" +void case_753() +#line 5038 "cs-parser.jay" { /* Redundant, but wont regress*/ report.Error (1525, lexer.Location, "Unexpected symbol }"); @@ -7888,15 +7904,15 @@ void case_752() yyVal = yyVals[0+yyTop]; } -void case_754() -#line 5039 "cs-parser.jay" +void case_755() +#line 5049 "cs-parser.jay" { current_variable.Initializer = (Expression) yyVals[0+yyTop]; lbag.AppendTo (current_variable, GetLocation (yyVals[-1+yyTop])); } -void case_755() -#line 5044 "cs-parser.jay" +void case_756() +#line 5054 "cs-parser.jay" { if (yyToken == Token.OPEN_BRACKET_EXPR) { report.Error (650, lexer.Location, @@ -7911,8 +7927,8 @@ void case_755() lbag.AppendTo (current_variable, GetLocation (yyVals[-1+yyTop])); } -void case_756() -#line 5058 "cs-parser.jay" +void case_757() +#line 5068 "cs-parser.jay" { if (yyToken == Token.OPEN_BRACKET_EXPR) { report.Error (650, lexer.Location, @@ -7922,8 +7938,8 @@ void case_756() } } -void case_760() -#line 5076 "cs-parser.jay" +void case_761() +#line 5086 "cs-parser.jay" { foreach (var d in current_variable.Declarators) { if (d.Initializer == null) @@ -7931,8 +7947,8 @@ void case_760() } } -void case_763() -#line 5091 "cs-parser.jay" +void case_764() +#line 5101 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location); @@ -7942,8 +7958,8 @@ void case_763() lbag.AddLocation (d, GetLocation (yyVals[-1+yyTop])); } -void case_764() -#line 5100 "cs-parser.jay" +void case_765() +#line 5110 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location); @@ -7953,15 +7969,15 @@ void case_764() lbag.AddLocation (d, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_766() -#line 5116 "cs-parser.jay" +void case_767() +#line 5126 "cs-parser.jay" { savedLocation = GetLocation (yyVals[-1+yyTop]); current_variable.Initializer = (Expression) yyVals[0+yyTop]; } -void case_771() -#line 5134 "cs-parser.jay" +void case_772() +#line 5144 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location); @@ -7971,37 +7987,37 @@ void case_771() lbag.AddLocation (d, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_773() -#line 5147 "cs-parser.jay" +void case_774() +#line 5157 "cs-parser.jay" { yyVal = new StackAlloc ((Expression) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_774() -#line 5152 "cs-parser.jay" +void case_775() +#line 5162 "cs-parser.jay" { report.Error (1575, GetLocation (yyVals[-1+yyTop]), "A stackalloc expression requires [] after type"); yyVal = new StackAlloc ((Expression) yyVals[0+yyTop], null, GetLocation (yyVals[-1+yyTop])); } -void case_775() -#line 5160 "cs-parser.jay" +void case_776() +#line 5170 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_777() -#line 5166 "cs-parser.jay" +void case_778() +#line 5176 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; report.Error (1002, GetLocation (yyVals[0+yyTop]), "; expected"); lexer.putback ('}'); } -void case_780() -#line 5184 "cs-parser.jay" +void case_781() +#line 5194 "cs-parser.jay" { ExpressionStatement s = yyVals[0+yyTop] as ExpressionStatement; if (s == null) { @@ -8012,8 +8028,8 @@ void case_780() } } -void case_781() -#line 5197 "cs-parser.jay" +void case_782() +#line 5207 "cs-parser.jay" { Expression expr = (Expression) yyVals[0+yyTop]; ExpressionStatement s; @@ -8022,15 +8038,15 @@ void case_781() yyVal = new StatementExpression (s); } -void case_782() -#line 5205 "cs-parser.jay" +void case_783() +#line 5215 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop])); } -void case_785() -#line 5219 "cs-parser.jay" +void case_786() +#line 5229 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8039,8 +8055,8 @@ void case_785() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_786() -#line 5228 "cs-parser.jay" +void case_787() +#line 5238 "cs-parser.jay" { yyVal = new If ((BooleanExpression) yyVals[-4+yyTop], (Statement) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-6+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); @@ -8051,8 +8067,8 @@ void case_786() Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); } -void case_787() -#line 5238 "cs-parser.jay" +void case_788() +#line 5248 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8060,16 +8076,16 @@ void case_787() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_789() -#line 5252 "cs-parser.jay" +void case_790() +#line 5262 "cs-parser.jay" { yyVal = new Switch ((Expression) yyVals[-5+yyTop], (ExplicitBlock) current_block.Explicit, (List) yyVals[-1+yyTop], GetLocation (yyVals[-7+yyTop])); end_block (GetLocation (yyVals[0+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_790() -#line 5258 "cs-parser.jay" +void case_791() +#line 5268 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8077,15 +8093,15 @@ void case_790() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_791() -#line 5268 "cs-parser.jay" +void case_792() +#line 5278 "cs-parser.jay" { report.Warning (1522, 1, current_block.StartLocation, "Empty switch block"); yyVal = new List (); } -void case_793() -#line 5277 "cs-parser.jay" +void case_794() +#line 5287 "cs-parser.jay" { var sections = new List (4); @@ -8093,8 +8109,8 @@ void case_793() yyVal = sections; } -void case_794() -#line 5284 "cs-parser.jay" +void case_795() +#line 5294 "cs-parser.jay" { var sections = (List) yyVals[-1+yyTop]; @@ -8102,15 +8118,15 @@ void case_794() yyVal = sections; } -void case_795() -#line 5291 "cs-parser.jay" +void case_796() +#line 5301 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new List (); } -void case_798() -#line 5310 "cs-parser.jay" +void case_799() +#line 5320 "cs-parser.jay" { var labels = new List (2); @@ -8118,8 +8134,8 @@ void case_798() yyVal = labels; } -void case_799() -#line 5317 "cs-parser.jay" +void case_800() +#line 5327 "cs-parser.jay" { var labels = (List) (yyVals[-1+yyTop]); labels.Add ((SwitchLabel) yyVals[0+yyTop]); @@ -8127,22 +8143,22 @@ void case_799() yyVal = labels; } -void case_800() -#line 5327 "cs-parser.jay" +void case_801() +#line 5337 "cs-parser.jay" { yyVal = new SwitchLabel ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_801() -#line 5332 "cs-parser.jay" +void case_802() +#line 5342 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new SwitchLabel ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_807() -#line 5351 "cs-parser.jay" +void case_808() +#line 5361 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8151,8 +8167,8 @@ void case_807() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_808() -#line 5359 "cs-parser.jay" +void case_809() +#line 5369 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8160,22 +8176,22 @@ void case_808() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_809() -#line 5369 "cs-parser.jay" +void case_810() +#line 5379 "cs-parser.jay" { yyVal = new Do ((Statement) yyVals[-5+yyTop], (BooleanExpression) yyVals[-2+yyTop], GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-4+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_810() -#line 5374 "cs-parser.jay" +void case_811() +#line 5384 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Do ((Statement) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop]), Location.Null); } -void case_811() -#line 5379 "cs-parser.jay" +void case_812() +#line 5389 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8183,8 +8199,8 @@ void case_811() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_812() -#line 5389 "cs-parser.jay" +void case_813() +#line 5399 "cs-parser.jay" { start_block (GetLocation (yyVals[0+yyTop])); current_block.IsCompilerGenerated = true; @@ -8194,8 +8210,8 @@ void case_812() yyVal = f; } -void case_814() -#line 5406 "cs-parser.jay" +void case_815() +#line 5416 "cs-parser.jay" { For f = (For) yyVals[-2+yyTop]; f.Initializer = (Statement) yyVals[-1+yyTop]; @@ -8203,8 +8219,8 @@ void case_814() yyVal = f; } -void case_816() -#line 5416 "cs-parser.jay" +void case_817() +#line 5426 "cs-parser.jay" { report.Error (1525, GetLocation (yyVals[0+yyTop]), "Unexpected symbol ')', expected ';'"); For f = (For) yyVals[-2+yyTop]; @@ -8213,8 +8229,8 @@ void case_816() yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_817() -#line 5427 "cs-parser.jay" +void case_818() +#line 5437 "cs-parser.jay" { For f = (For) yyVals[-2+yyTop]; f.Condition = (BooleanExpression) yyVals[-1+yyTop]; @@ -8222,8 +8238,8 @@ void case_817() yyVal = f; } -void case_819() -#line 5438 "cs-parser.jay" +void case_820() +#line 5448 "cs-parser.jay" { report.Error (1525, GetLocation (yyVals[0+yyTop]), "Unexpected symbol ')', expected ';'"); For f = (For) yyVals[-2+yyTop]; @@ -8232,8 +8248,8 @@ void case_819() yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_820() -#line 5450 "cs-parser.jay" +void case_821() +#line 5460 "cs-parser.jay" { For f = (For) yyVals[-3+yyTop]; f.Iterator = (Statement) yyVals[-2+yyTop]; @@ -8247,15 +8263,15 @@ void case_820() yyVal = end_block (GetLocation (yyVals[-1+yyTop])); } -void case_821() -#line 5463 "cs-parser.jay" +void case_822() +#line 5473 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = end_block (current_block.StartLocation); } -void case_824() -#line 5476 "cs-parser.jay" +void case_825() +#line 5486 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, lt.Location); @@ -8263,15 +8279,15 @@ void case_824() current_variable = new BlockVariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_825() -#line 5483 "cs-parser.jay" +void case_826() +#line 5493 "cs-parser.jay" { yyVal = current_variable; current_variable = null; } -void case_833() -#line 5507 "cs-parser.jay" +void case_834() +#line 5517 "cs-parser.jay" { var sl = yyVals[-2+yyTop] as StatementList; if (sl == null) { @@ -8286,8 +8302,8 @@ void case_833() yyVal = sl; } -void case_834() -#line 5524 "cs-parser.jay" +void case_835() +#line 5534 "cs-parser.jay" { report.Error (230, GetLocation (yyVals[-3+yyTop]), "Type and identifier are both required in a foreach statement"); @@ -8301,8 +8317,8 @@ void case_834() yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_835() -#line 5537 "cs-parser.jay" +void case_836() +#line 5547 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8320,8 +8336,8 @@ void case_835() yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_836() -#line 5554 "cs-parser.jay" +void case_837() +#line 5564 "cs-parser.jay" { start_block (GetLocation (yyVals[-5+yyTop])); current_block.IsCompilerGenerated = true; @@ -8331,8 +8347,8 @@ void case_836() yyVal = li; } -void case_837() -#line 5563 "cs-parser.jay" +void case_838() +#line 5573 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8344,8 +8360,8 @@ void case_837() yyVal = f; } -void case_838() -#line 5574 "cs-parser.jay" +void case_839() +#line 5584 "cs-parser.jay" { start_block (GetLocation (yyVals[-3+yyTop])); current_block.IsCompilerGenerated = true; @@ -8359,8 +8375,8 @@ void case_838() yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_839() -#line 5587 "cs-parser.jay" +void case_840() +#line 5597 "cs-parser.jay" { Foreach f = new Foreach ((Expression) yyVals[-1+yyTop], null, null, null, null, GetLocation (yyVals[-3+yyTop])); current_block.AddStatement (f); @@ -8369,86 +8385,86 @@ void case_839() yyVal = f; } -void case_846() -#line 5607 "cs-parser.jay" +void case_847() +#line 5617 "cs-parser.jay" { yyVal = new Break (GetLocation (yyVals[-1+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_847() -#line 5615 "cs-parser.jay" +void case_848() +#line 5625 "cs-parser.jay" { yyVal = new Continue (GetLocation (yyVals[-1+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_848() -#line 5620 "cs-parser.jay" +void case_849() +#line 5630 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Continue (GetLocation (yyVals[-1+yyTop])); } -void case_849() -#line 5628 "cs-parser.jay" +void case_850() +#line 5638 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new Goto (lt.Value, GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_850() -#line 5634 "cs-parser.jay" +void case_851() +#line 5644 "cs-parser.jay" { yyVal = new GotoCase ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_851() -#line 5639 "cs-parser.jay" +void case_852() +#line 5649 "cs-parser.jay" { yyVal = new GotoDefault (GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_852() -#line 5647 "cs-parser.jay" +void case_853() +#line 5657 "cs-parser.jay" { yyVal = new Return ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_853() -#line 5652 "cs-parser.jay" +void case_854() +#line 5662 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Return ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_854() -#line 5657 "cs-parser.jay" +void case_855() +#line 5667 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Return (null, GetLocation (yyVals[-1+yyTop])); } -void case_855() -#line 5665 "cs-parser.jay" +void case_856() +#line 5675 "cs-parser.jay" { yyVal = new Throw ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_856() -#line 5670 "cs-parser.jay" +void case_857() +#line 5680 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Throw (null, GetLocation (yyVals[-1+yyTop])); } -void case_857() -#line 5678 "cs-parser.jay" +void case_858() +#line 5688 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; string s = lt.Value; @@ -8465,8 +8481,8 @@ void case_857() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_858() -#line 5694 "cs-parser.jay" +void case_859() +#line 5704 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8485,8 +8501,8 @@ void case_858() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_859() -#line 5712 "cs-parser.jay" +void case_860() +#line 5722 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; string s = lt.Value; @@ -8501,30 +8517,30 @@ void case_859() lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_863() -#line 5738 "cs-parser.jay" +void case_864() +#line 5748 "cs-parser.jay" { yyVal = new TryFinally ((Statement) yyVals[-2+yyTop], (Block) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_864() -#line 5743 "cs-parser.jay" +void case_865() +#line 5753 "cs-parser.jay" { var loc = GetLocation (yyVals[-4+yyTop]); yyVal = new TryFinally (new TryCatch ((Block) yyVals[-3+yyTop], (List) yyVals[-2+yyTop], loc, true), (Block) yyVals[0+yyTop], loc); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_865() -#line 5749 "cs-parser.jay" +void case_866() +#line 5759 "cs-parser.jay" { Error_SyntaxError (1524, yyToken); yyVal = new TryCatch ((Block) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop]), false); } -void case_866() -#line 5757 "cs-parser.jay" +void case_867() +#line 5767 "cs-parser.jay" { var l = new List (2); @@ -8532,8 +8548,8 @@ void case_866() yyVal = l; } -void case_867() -#line 5764 "cs-parser.jay" +void case_868() +#line 5774 "cs-parser.jay" { var l = (List) yyVals[-1+yyTop]; @@ -8546,8 +8562,8 @@ void case_867() yyVal = l; } -void case_871() -#line 5788 "cs-parser.jay" +void case_872() +#line 5798 "cs-parser.jay" { start_block (GetLocation (yyVals[-3+yyTop])); var c = new Catch (current_block, GetLocation (yyVals[-4+yyTop])); @@ -8563,8 +8579,8 @@ void case_871() yyVal = c; } -void case_873() -#line 5807 "cs-parser.jay" +void case_874() +#line 5817 "cs-parser.jay" { if (yyToken == Token.CLOSE_PARENS) { report.Error (1015, lexer.Location, @@ -8576,15 +8592,15 @@ void case_873() yyVal = new Catch (null, GetLocation (yyVals[-2+yyTop])); } -void case_876() -#line 5835 "cs-parser.jay" +void case_877() +#line 5845 "cs-parser.jay" { if (!settings.Unsafe) Error_UnsafeCodeNotAllowed (GetLocation (yyVals[0+yyTop])); } -void case_878() -#line 5845 "cs-parser.jay" +void case_879() +#line 5855 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8593,8 +8609,8 @@ void case_878() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_879() -#line 5853 "cs-parser.jay" +void case_880() +#line 5863 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8602,8 +8618,8 @@ void case_879() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_880() -#line 5863 "cs-parser.jay" +void case_881() +#line 5873 "cs-parser.jay" { start_block (GetLocation (yyVals[-2+yyTop])); @@ -8614,15 +8630,15 @@ void case_880() current_variable = new Fixed.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_881() -#line 5873 "cs-parser.jay" +void case_882() +#line 5883 "cs-parser.jay" { yyVal = current_variable; current_variable = null; } -void case_882() -#line 5878 "cs-parser.jay" +void case_883() +#line 5888 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8633,8 +8649,8 @@ void case_882() yyVal = end_block (GetLocation (yyVals[-2+yyTop])); } -void case_883() -#line 5891 "cs-parser.jay" +void case_884() +#line 5901 "cs-parser.jay" { start_block (GetLocation (yyVals[-2+yyTop])); @@ -8645,15 +8661,15 @@ void case_883() current_variable = new Using.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_884() -#line 5901 "cs-parser.jay" +void case_885() +#line 5911 "cs-parser.jay" { yyVal = current_variable; current_variable = null; } -void case_885() -#line 5906 "cs-parser.jay" +void case_886() +#line 5916 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8664,8 +8680,8 @@ void case_885() yyVal = end_block (GetLocation (yyVals[-2+yyTop])); } -void case_886() -#line 5916 "cs-parser.jay" +void case_887() +#line 5926 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8674,8 +8690,8 @@ void case_886() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_887() -#line 5924 "cs-parser.jay" +void case_888() +#line 5934 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8683,23 +8699,23 @@ void case_887() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_889() -#line 5935 "cs-parser.jay" +void case_890() +#line 5945 "cs-parser.jay" { /* It has to be here for the parent to safely restore artificial block*/ Error_SyntaxError (yyToken); } -void case_891() -#line 5947 "cs-parser.jay" +void case_892() +#line 5957 "cs-parser.jay" { current_variable.Initializer = (Expression) yyVals[0+yyTop]; lbag.AppendTo (current_variable, GetLocation (yyVals[-1+yyTop])); yyVal = current_variable; } -void case_892() -#line 5959 "cs-parser.jay" +void case_893() +#line 5969 "cs-parser.jay" { lexer.query_parsing = false; @@ -8712,8 +8728,8 @@ void case_892() current_block = current_block.Parent; } -void case_893() -#line 5971 "cs-parser.jay" +void case_894() +#line 5981 "cs-parser.jay" { Linq.AQueryClause from = yyVals[-1+yyTop] as Linq.AQueryClause; @@ -8724,8 +8740,8 @@ void case_893() current_block = current_block.Parent; } -void case_894() -#line 5982 "cs-parser.jay" +void case_895() +#line 5992 "cs-parser.jay" { lexer.query_parsing = false; yyVal = yyVals[-1+yyTop]; @@ -8734,16 +8750,16 @@ void case_894() current_block = current_block.Parent; } -void case_895() -#line 5989 "cs-parser.jay" +void case_896() +#line 5999 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } -void case_896() -#line 5998 "cs-parser.jay" +void case_897() +#line 6008 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); @@ -8754,8 +8770,8 @@ void case_896() yyVal = new Linq.QueryExpression (start); } -void case_897() -#line 6008 "cs-parser.jay" +void case_898() +#line 6018 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); @@ -8768,8 +8784,8 @@ void case_897() yyVal = new Linq.QueryExpression (start); } -void case_898() -#line 6023 "cs-parser.jay" +void case_899() +#line 6033 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); @@ -8780,8 +8796,8 @@ void case_898() yyVal = new Linq.QueryExpression (start); } -void case_899() -#line 6033 "cs-parser.jay" +void case_900() +#line 6043 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); @@ -8794,8 +8810,8 @@ void case_899() yyVal = new Linq.QueryExpression (start); } -void case_901() -#line 6052 "cs-parser.jay" +void case_902() +#line 6062 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); @@ -8808,8 +8824,8 @@ void case_901() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_903() -#line 6068 "cs-parser.jay" +void case_904() +#line 6078 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); @@ -8826,8 +8842,8 @@ void case_903() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_904() -#line 6087 "cs-parser.jay" +void case_905() +#line 6097 "cs-parser.jay" { Linq.AQueryClause head = (Linq.AQueryClause)yyVals[-1+yyTop]; @@ -8843,8 +8859,8 @@ void case_904() yyVal = head; } -void case_905() -#line 6102 "cs-parser.jay" +void case_906() +#line 6112 "cs-parser.jay" { Linq.AQueryClause head = (Linq.AQueryClause)yyVals[0+yyTop]; @@ -8857,22 +8873,22 @@ void case_905() yyVal = head; } -void case_907() -#line 6115 "cs-parser.jay" +void case_908() +#line 6125 "cs-parser.jay" { report.Error (742, GetLocation (yyVals[0+yyTop]), "Unexpected symbol `{0}'. A query body must end with select or group clause", GetSymbolName (yyToken)); yyVal = yyVals[-1+yyTop]; } -void case_908() -#line 6120 "cs-parser.jay" +void case_909() +#line 6130 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } -void case_910() -#line 6132 "cs-parser.jay" +void case_911() +#line 6142 "cs-parser.jay" { yyVal = new Linq.Select ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); @@ -8880,8 +8896,8 @@ void case_910() current_block = current_block.Parent; } -void case_911() -#line 6139 "cs-parser.jay" +void case_912() +#line 6149 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack (); @@ -8890,8 +8906,8 @@ void case_911() linq_clause_blocks.Push ((Linq.QueryBlock)current_block); } -void case_912() -#line 6147 "cs-parser.jay" +void case_913() +#line 6157 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8899,8 +8915,8 @@ void case_912() current_block = new Linq.QueryBlock (current_block, lexer.Location); } -void case_913() -#line 6154 "cs-parser.jay" +void case_914() +#line 6164 "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])); @@ -8909,15 +8925,15 @@ void case_913() current_block = current_block.Parent; } -void case_915() -#line 6166 "cs-parser.jay" +void case_916() +#line 6176 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-1+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } -void case_922() -#line 6186 "cs-parser.jay" +void case_923() +#line 6196 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); @@ -8930,8 +8946,8 @@ void case_922() ((Linq.QueryBlock)current_block).AddRangeVariable (sn); } -void case_924() -#line 6205 "cs-parser.jay" +void case_925() +#line 6215 "cs-parser.jay" { yyVal = new Linq.Where ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); @@ -8939,8 +8955,8 @@ void case_924() current_block = current_block.Parent; } -void case_925() -#line 6215 "cs-parser.jay" +void case_926() +#line 6225 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack (); @@ -8949,8 +8965,8 @@ void case_925() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_926() -#line 6223 "cs-parser.jay" +void case_927() +#line 6233 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8959,8 +8975,8 @@ void case_926() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_927() -#line 6231 "cs-parser.jay" +void case_928() +#line 6241 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -8969,8 +8985,8 @@ void case_927() current_block = new Linq.QueryBlock (current_block, lexer.Location); } -void case_928() -#line 6239 "cs-parser.jay" +void case_929() +#line 6249 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -9009,8 +9025,8 @@ void case_928() ((Linq.QueryBlock)current_block).AddRangeVariable (into); } -void case_929() -#line 6277 "cs-parser.jay" +void case_930() +#line 6287 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack (); @@ -9019,8 +9035,8 @@ void case_929() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_930() -#line 6285 "cs-parser.jay" +void case_931() +#line 6295 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -9029,8 +9045,8 @@ void case_930() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_931() -#line 6293 "cs-parser.jay" +void case_932() +#line 6303 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -9039,8 +9055,8 @@ void case_931() current_block = new Linq.QueryBlock (current_block, lexer.Location); } -void case_932() -#line 6301 "cs-parser.jay" +void case_933() +#line 6311 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -9083,15 +9099,15 @@ void case_932() ((Linq.QueryBlock)current_block).AddRangeVariable (into); } -void case_934() -#line 6347 "cs-parser.jay" +void case_935() +#line 6357 "cs-parser.jay" { opt_intoStack.Push (GetLocation (yyVals[-1+yyTop])); yyVal = yyVals[0+yyTop]; } -void case_936() -#line 6359 "cs-parser.jay" +void case_937() +#line 6369 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -9099,8 +9115,8 @@ void case_936() yyVal = yyVals[0+yyTop]; } -void case_938() -#line 6370 "cs-parser.jay" +void case_939() +#line 6380 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -9108,15 +9124,15 @@ void case_938() current_block = new Linq.QueryBlock (current_block, lexer.Location); } -void case_939() -#line 6377 "cs-parser.jay" +void case_940() +#line 6387 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-3+yyTop]).Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-3+yyTop]; } -void case_941() -#line 6386 "cs-parser.jay" +void case_942() +#line 6396 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -9124,43 +9140,43 @@ void case_941() current_block = new Linq.QueryBlock ((Linq.QueryBlock) current_block, lexer.Location); } -void case_942() -#line 6393 "cs-parser.jay" +void case_943() +#line 6403 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-3+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-3+yyTop]; } -void case_944() -#line 6405 "cs-parser.jay" +void case_945() +#line 6415 "cs-parser.jay" { yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_945() -#line 6410 "cs-parser.jay" +void case_946() +#line 6420 "cs-parser.jay" { yyVal = new Linq.OrderByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_947() -#line 6422 "cs-parser.jay" +void case_948() +#line 6432 "cs-parser.jay" { yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_948() -#line 6427 "cs-parser.jay" +void case_949() +#line 6437 "cs-parser.jay" { yyVal = new Linq.ThenByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_950() -#line 6437 "cs-parser.jay" +void case_951() +#line 6447 "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*/ @@ -9177,8 +9193,8 @@ void case_950() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_951() -#line 6453 "cs-parser.jay" +void case_952() +#line 6463 "cs-parser.jay" { var current_block = linq_clause_blocks.Pop (); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; @@ -9188,8 +9204,8 @@ void case_951() }; } -void case_954() -#line 6480 "cs-parser.jay" +void case_955() +#line 6490 "cs-parser.jay" { current_container = current_type = new Class (current_container, new MemberName (""), Modifiers.PUBLIC, null); @@ -9218,8 +9234,8 @@ void case_954() start_block (lexer.Location); } -void case_955() -#line 6508 "cs-parser.jay" +void case_956() +#line 6518 "cs-parser.jay" { --lexer.parsing_block; Method method = (Method) oob_stack.Pop (); @@ -9230,16 +9246,16 @@ void case_955() current_local_parameters = null; } -void case_965() -#line 6551 "cs-parser.jay" +void case_966() +#line 6561 "cs-parser.jay" { module.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)yyVals[-1+yyTop]; module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; yyVal = null; } -void case_966() -#line 6557 "cs-parser.jay" +void case_967() +#line 6567 "cs-parser.jay" { module.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)yyVals[-3+yyTop]; module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; @@ -9247,15 +9263,15 @@ void case_966() yyVal = new MemberName (lt.Value); } -void case_969() -#line 6572 "cs-parser.jay" +void case_970() +#line 6582 "cs-parser.jay" { module.DocumentationBuilder.ParsedParameters = (List)yyVals[-1+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-6+yyTop], MemberCache.IndexerNameAlias, Location.Null); } -void case_970() -#line 6577 "cs-parser.jay" +void case_971() +#line 6587 "cs-parser.jay" { var p = (List)yyVals[0+yyTop] ?? new List (1); p.Add (new DocumentationParameter ((FullNamedExpression) yyVals[-1+yyTop])); @@ -9264,8 +9280,8 @@ void case_970() yyVal = null; } -void case_971() -#line 6585 "cs-parser.jay" +void case_972() +#line 6595 "cs-parser.jay" { var p = (List)yyVals[0+yyTop] ?? new List (1); p.Add (new DocumentationParameter ((FullNamedExpression) yyVals[-1+yyTop])); @@ -9274,8 +9290,8 @@ void case_971() yyVal = null; } -void case_972() -#line 6593 "cs-parser.jay" +void case_973() +#line 6603 "cs-parser.jay" { var p = (List)yyVals[0+yyTop] ?? new List (1); module.DocumentationBuilder.ParsedParameters = p; @@ -9283,24 +9299,24 @@ void case_972() yyVal = null; } -void case_980() -#line 6631 "cs-parser.jay" +void case_981() +#line 6641 "cs-parser.jay" { var parameters = new List (); parameters.Add ((DocumentationParameter) yyVals[0+yyTop]); yyVal = parameters; } -void case_981() -#line 6637 "cs-parser.jay" +void case_982() +#line 6647 "cs-parser.jay" { var parameters = yyVals[-2+yyTop] as List; parameters.Add ((DocumentationParameter) yyVals[0+yyTop]); yyVal = parameters; } -void case_982() -#line 6646 "cs-parser.jay" +void case_983() +#line 6656 "cs-parser.jay" { if (yyVals[-1+yyTop] != null) yyVal = new DocumentationParameter ((Parameter.Modifier) yyVals[-1+yyTop], (FullNamedExpression) yyVals[0+yyTop]); @@ -9312,360 +9328,360 @@ void case_982() static readonly short [] yyLhs = { -1, 0, 4, 0, 0, 1, 1, 1, 1, 2, 2, 11, 11, 12, 12, 13, 13, 14, 15, 15, 15, - 19, 20, 17, 18, 18, 18, 22, 22, 23, 23, - 7, 7, 6, 6, 21, 21, 8, 8, 24, 24, - 24, 25, 25, 25, 25, 25, 9, 9, 10, 10, - 33, 31, 36, 32, 32, 34, 34, 34, 34, 35, - 35, 40, 37, 38, 39, 39, 41, 41, 41, 41, - 41, 42, 42, 46, 43, 45, 48, 48, 48, 49, - 49, 50, 50, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 65, 67, 69, 70, 71, - 27, 27, 74, 52, 75, 75, 76, 76, 77, 79, - 73, 73, 78, 78, 84, 53, 88, 53, 53, 83, - 91, 83, 85, 85, 92, 92, 93, 94, 93, 89, - 89, 95, 95, 96, 97, 87, 87, 90, 90, 90, - 100, 54, 103, 104, 98, 105, 106, 107, 98, 98, - 98, 99, 99, 102, 102, 110, 110, 110, 110, 110, - 110, 110, 110, 110, 110, 111, 111, 114, 114, 114, - 114, 117, 114, 115, 115, 118, 118, 119, 119, 119, - 112, 112, 112, 120, 120, 120, 113, 122, 124, 125, - 55, 127, 128, 129, 57, 123, 123, 123, 123, 123, - 133, 130, 134, 131, 132, 132, 132, 135, 136, 137, - 139, 28, 28, 138, 138, 140, 140, 141, 141, 141, - 141, 141, 141, 141, 141, 141, 144, 58, 143, 143, - 145, 145, 148, 142, 142, 147, 147, 147, 147, 147, + 19, 20, 17, 17, 18, 18, 18, 22, 22, 23, + 23, 7, 7, 6, 6, 21, 21, 8, 8, 24, + 24, 24, 25, 25, 25, 25, 25, 9, 9, 10, + 10, 33, 31, 36, 32, 32, 34, 34, 34, 34, + 35, 35, 40, 37, 38, 39, 39, 41, 41, 41, + 41, 41, 42, 42, 46, 43, 45, 48, 48, 48, + 49, 49, 50, 50, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 65, 67, 69, 70, + 71, 27, 27, 74, 52, 75, 75, 76, 76, 77, + 79, 73, 73, 78, 78, 84, 53, 88, 53, 53, + 83, 91, 83, 85, 85, 92, 92, 93, 94, 93, + 89, 89, 95, 95, 96, 97, 87, 87, 90, 90, + 90, 100, 54, 103, 104, 98, 105, 106, 107, 98, + 98, 98, 99, 99, 102, 102, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 111, 111, 114, 114, + 114, 114, 117, 114, 115, 115, 118, 118, 119, 119, + 119, 112, 112, 112, 120, 120, 120, 113, 122, 124, + 125, 55, 127, 128, 129, 57, 123, 123, 123, 123, + 123, 133, 130, 134, 131, 132, 132, 132, 135, 136, + 137, 139, 28, 28, 138, 138, 140, 140, 141, 141, + 141, 141, 141, 141, 141, 141, 141, 144, 58, 143, + 143, 145, 145, 148, 142, 142, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 150, 149, 151, - 149, 149, 149, 59, 154, 156, 152, 153, 153, 155, - 155, 160, 158, 161, 158, 158, 158, 162, 60, 164, - 56, 167, 168, 56, 163, 170, 163, 165, 165, 171, - 171, 172, 173, 172, 174, 169, 166, 166, 166, 166, - 166, 178, 175, 179, 176, 177, 177, 61, 181, 183, - 184, 29, 180, 180, 180, 182, 182, 182, 185, 185, - 186, 187, 186, 186, 186, 188, 189, 190, 30, 191, - 191, 16, 16, 192, 192, 195, 194, 194, 194, 196, - 196, 198, 64, 121, 101, 101, 126, 126, 199, 199, - 199, 197, 197, 200, 200, 201, 201, 203, 203, 82, - 72, 72, 86, 86, 116, 116, 146, 146, 204, 204, - 204, 204, 204, 208, 208, 209, 207, 207, 207, 207, - 207, 207, 207, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 211, 211, 211, 211, 211, 211, 211, 211, + 147, 147, 147, 147, 147, 147, 147, 147, 150, 149, + 151, 149, 149, 149, 59, 154, 156, 152, 153, 153, + 155, 155, 160, 158, 161, 158, 158, 158, 162, 60, + 164, 56, 167, 168, 56, 163, 170, 163, 165, 165, + 171, 171, 172, 173, 172, 174, 169, 166, 166, 166, + 166, 166, 178, 175, 179, 176, 177, 177, 61, 181, + 183, 184, 29, 180, 180, 180, 182, 182, 182, 185, + 185, 186, 187, 186, 186, 186, 188, 189, 190, 30, + 191, 191, 16, 16, 192, 192, 195, 194, 194, 194, + 196, 196, 198, 64, 121, 101, 101, 126, 126, 199, + 199, 199, 197, 197, 200, 200, 201, 201, 203, 203, + 82, 72, 72, 86, 86, 116, 116, 146, 146, 204, + 204, 204, 204, 204, 208, 208, 209, 207, 207, 207, + 207, 207, 207, 207, 210, 210, 210, 210, 210, 210, + 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 212, 212, 212, 213, 213, 213, 233, 233, - 234, 234, 235, 235, 215, 215, 232, 232, 232, 232, - 232, 232, 232, 232, 217, 217, 237, 237, 238, 238, - 239, 239, 241, 241, 241, 242, 242, 242, 242, 242, - 243, 243, 159, 159, 236, 236, 236, 236, 236, 248, - 248, 247, 247, 249, 249, 249, 249, 250, 218, 218, - 218, 246, 246, 246, 251, 251, 252, 252, 219, 220, - 220, 221, 222, 223, 223, 214, 214, 214, 214, 214, - 257, 253, 224, 258, 258, 259, 259, 260, 260, 261, - 261, 261, 261, 254, 254, 205, 205, 256, 256, 262, - 262, 255, 255, 81, 81, 263, 263, 264, 225, 265, - 265, 265, 266, 266, 266, 266, 266, 267, 193, 226, - 227, 228, 229, 269, 230, 270, 230, 268, 268, 272, - 271, 216, 273, 273, 273, 273, 273, 274, 274, 274, - 274, 274, 274, 274, 275, 275, 275, 275, 276, 276, - 276, 276, 276, 277, 277, 277, 278, 278, 278, 278, - 278, 279, 279, 279, 280, 280, 281, 281, 282, 282, - 283, 283, 284, 284, 285, 285, 286, 286, 286, 288, + 211, 211, 211, 212, 212, 212, 213, 213, 213, 233, + 233, 234, 234, 235, 235, 215, 215, 232, 232, 232, + 232, 232, 232, 232, 232, 217, 217, 237, 237, 238, + 238, 239, 239, 241, 241, 241, 242, 242, 242, 242, + 242, 243, 243, 159, 159, 236, 236, 236, 236, 236, + 248, 248, 247, 247, 249, 249, 249, 249, 250, 218, + 218, 218, 246, 246, 246, 251, 251, 252, 252, 219, + 220, 220, 221, 222, 223, 223, 214, 214, 214, 214, + 214, 257, 253, 224, 258, 258, 259, 259, 260, 260, + 261, 261, 261, 261, 254, 254, 205, 205, 256, 256, + 262, 262, 255, 255, 81, 81, 263, 263, 264, 225, + 265, 265, 265, 266, 266, 266, 266, 266, 267, 193, + 226, 227, 228, 229, 269, 230, 270, 230, 268, 268, + 272, 271, 216, 273, 273, 273, 273, 273, 274, 274, + 274, 274, 274, 274, 274, 275, 275, 275, 275, 276, + 276, 276, 276, 276, 277, 277, 277, 278, 278, 278, + 278, 278, 279, 279, 279, 280, 280, 281, 281, 282, + 282, 283, 283, 284, 284, 285, 285, 286, 286, 286, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, - 289, 289, 290, 290, 290, 291, 291, 292, 292, 294, - 293, 287, 287, 296, 295, 297, 295, 298, 299, 295, - 300, 301, 295, 44, 44, 244, 244, 244, 244, 231, - 231, 231, 80, 303, 304, 305, 306, 307, 26, 63, - 63, 62, 62, 108, 108, 308, 308, 308, 308, 308, + 288, 289, 289, 290, 290, 290, 291, 291, 292, 292, + 294, 293, 287, 287, 296, 295, 297, 295, 298, 299, + 295, 300, 301, 295, 44, 44, 244, 244, 244, 244, + 231, 231, 231, 80, 303, 304, 305, 306, 307, 26, + 63, 63, 62, 62, 108, 108, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, - 66, 66, 66, 68, 68, 309, 309, 310, 310, 311, - 311, 312, 312, 312, 312, 202, 202, 313, 313, 315, - 109, 316, 316, 317, 157, 157, 314, 314, 318, 318, - 319, 319, 319, 319, 319, 323, 323, 324, 324, 324, - 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, - 321, 321, 321, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 339, 339, 339, 339, - 326, 340, 322, 341, 341, 342, 342, 342, 342, 342, - 342, 206, 206, 343, 47, 47, 345, 320, 349, 320, - 347, 347, 344, 344, 344, 344, 346, 346, 353, 353, - 352, 352, 354, 354, 348, 348, 350, 350, 355, 355, - 356, 351, 351, 351, 327, 327, 327, 338, 338, 357, - 358, 358, 328, 328, 359, 359, 359, 362, 360, 360, - 361, 361, 363, 363, 363, 366, 364, 365, 365, 367, - 367, 367, 329, 329, 329, 329, 368, 368, 369, 369, - 369, 373, 370, 376, 372, 372, 379, 375, 375, 378, - 378, 374, 374, 382, 381, 381, 377, 377, 380, 380, - 384, 383, 383, 371, 371, 385, 371, 371, 371, 330, - 330, 330, 330, 330, 330, 386, 387, 387, 388, 388, - 388, 389, 389, 389, 390, 390, 391, 391, 391, 392, - 392, 331, 331, 331, 331, 393, 393, 395, 395, 394, - 396, 394, 394, 332, 333, 397, 336, 334, 334, 399, - 400, 337, 402, 403, 335, 335, 335, 401, 401, 398, - 398, 302, 302, 302, 302, 404, 404, 406, 406, 408, - 407, 409, 407, 405, 405, 405, 405, 405, 413, 411, - 414, 415, 411, 410, 410, 416, 416, 416, 416, 416, - 421, 417, 422, 418, 423, 424, 425, 419, 427, 428, - 429, 419, 426, 426, 431, 420, 430, 434, 430, 433, - 436, 433, 432, 432, 432, 435, 435, 435, 412, 437, - 412, 3, 3, 438, 3, 3, 439, 439, 245, 245, - 240, 240, 5, 440, 440, 440, 440, 444, 440, 440, - 440, 440, 441, 441, 442, 445, 442, 443, 443, 446, - 446, 447, + 308, 66, 66, 66, 68, 68, 309, 309, 310, 310, + 311, 311, 312, 312, 312, 312, 202, 202, 313, 313, + 315, 109, 316, 316, 317, 157, 157, 314, 314, 318, + 318, 319, 319, 319, 319, 319, 323, 323, 324, 324, + 324, 321, 321, 321, 321, 321, 321, 321, 321, 321, + 321, 321, 321, 321, 325, 325, 325, 325, 325, 325, + 325, 325, 325, 325, 325, 325, 325, 339, 339, 339, + 339, 326, 340, 322, 341, 341, 342, 342, 342, 342, + 342, 342, 206, 206, 343, 47, 47, 345, 320, 349, + 320, 347, 347, 344, 344, 344, 344, 346, 346, 353, + 353, 352, 352, 354, 354, 348, 348, 350, 350, 355, + 355, 356, 351, 351, 351, 327, 327, 327, 338, 338, + 357, 358, 358, 328, 328, 359, 359, 359, 362, 360, + 360, 361, 361, 363, 363, 363, 366, 364, 365, 365, + 367, 367, 367, 329, 329, 329, 329, 368, 368, 369, + 369, 369, 373, 370, 376, 372, 372, 379, 375, 375, + 378, 378, 374, 374, 382, 381, 381, 377, 377, 380, + 380, 384, 383, 383, 371, 371, 385, 371, 371, 371, + 330, 330, 330, 330, 330, 330, 386, 387, 387, 388, + 388, 388, 389, 389, 389, 390, 390, 391, 391, 391, + 392, 392, 331, 331, 331, 331, 393, 393, 395, 395, + 394, 396, 394, 394, 332, 333, 397, 336, 334, 334, + 399, 400, 337, 402, 403, 335, 335, 335, 401, 401, + 398, 398, 302, 302, 302, 302, 404, 404, 406, 406, + 408, 407, 409, 407, 405, 405, 405, 405, 405, 413, + 411, 414, 415, 411, 410, 410, 416, 416, 416, 416, + 416, 421, 417, 422, 418, 423, 424, 425, 419, 427, + 428, 429, 419, 426, 426, 431, 420, 430, 434, 430, + 433, 436, 433, 432, 432, 432, 435, 435, 435, 412, + 437, 412, 3, 3, 438, 3, 3, 439, 439, 245, + 245, 240, 240, 5, 440, 440, 440, 440, 444, 440, + 440, 440, 440, 441, 441, 442, 445, 442, 443, 443, + 446, 446, 447, }; static readonly short [] yyLen = { 2, 2, 0, 3, 1, 2, 4, 3, 1, 0, 1, 1, 2, 4, 2, 1, 2, 1, 3, 5, 2, - 0, 0, 11, 1, 3, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 0, 1, 1, 2, 1, 1, - 2, 1, 1, 1, 1, 1, 0, 1, 1, 2, - 0, 3, 0, 6, 3, 1, 1, 1, 1, 1, - 3, 0, 3, 1, 0, 3, 0, 1, 1, 3, - 3, 1, 1, 0, 4, 4, 0, 1, 1, 0, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, - 16, 5, 0, 9, 0, 1, 1, 2, 3, 0, - 3, 1, 1, 1, 0, 8, 0, 9, 6, 0, - 0, 3, 0, 1, 1, 2, 2, 0, 5, 0, - 1, 1, 2, 3, 0, 4, 2, 1, 1, 1, - 0, 3, 0, 0, 10, 0, 0, 0, 12, 8, - 5, 1, 1, 0, 1, 1, 3, 3, 3, 5, - 3, 5, 1, 1, 1, 1, 3, 4, 6, 2, - 4, 0, 7, 0, 1, 1, 2, 1, 1, 1, - 4, 6, 4, 1, 2, 2, 1, 0, 0, 0, - 10, 0, 0, 0, 13, 1, 2, 1, 2, 1, - 0, 5, 0, 5, 1, 1, 1, 0, 0, 0, - 0, 15, 5, 0, 1, 1, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 5, 1, 1, - 1, 1, 0, 7, 1, 1, 1, 1, 1, 1, + 0, 0, 11, 3, 1, 3, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 1, 2, 1, + 1, 2, 1, 1, 1, 1, 1, 0, 1, 1, + 2, 0, 3, 0, 6, 3, 1, 1, 1, 1, + 1, 3, 0, 3, 1, 0, 3, 0, 1, 1, + 3, 3, 1, 1, 0, 4, 4, 0, 1, 1, + 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 16, 5, 0, 9, 0, 1, 1, 2, 3, + 0, 3, 1, 1, 1, 0, 8, 0, 9, 6, + 0, 0, 3, 0, 1, 1, 2, 2, 0, 5, + 0, 1, 1, 2, 3, 0, 4, 2, 1, 1, + 1, 0, 3, 0, 0, 10, 0, 0, 0, 12, + 8, 5, 1, 1, 0, 1, 1, 3, 3, 3, + 5, 3, 5, 1, 1, 1, 1, 3, 4, 6, + 2, 4, 0, 7, 0, 1, 1, 2, 1, 1, + 1, 4, 6, 4, 1, 2, 2, 1, 0, 0, + 0, 10, 0, 0, 0, 13, 1, 2, 1, 2, + 1, 0, 5, 0, 5, 1, 1, 1, 0, 0, + 0, 0, 15, 5, 0, 1, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 5, 1, + 1, 1, 1, 0, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 7, 0, - 7, 2, 2, 2, 0, 0, 9, 1, 1, 0, - 1, 0, 6, 0, 6, 2, 1, 0, 8, 0, - 9, 0, 0, 10, 0, 0, 3, 0, 1, 1, - 2, 2, 0, 5, 0, 2, 2, 2, 1, 1, - 1, 0, 5, 0, 5, 1, 1, 2, 0, 0, - 0, 12, 0, 2, 2, 0, 1, 2, 1, 3, - 2, 0, 5, 3, 1, 0, 0, 0, 13, 0, - 1, 1, 3, 1, 4, 2, 0, 3, 2, 1, - 3, 0, 3, 1, 1, 3, 1, 2, 3, 4, - 4, 0, 3, 1, 3, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, - 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 7, + 0, 7, 2, 2, 2, 0, 0, 9, 1, 1, + 0, 1, 0, 6, 0, 6, 2, 1, 0, 8, + 0, 9, 0, 0, 10, 0, 0, 3, 0, 1, + 1, 2, 2, 0, 5, 0, 2, 2, 2, 1, + 1, 1, 0, 5, 0, 5, 1, 1, 2, 0, + 0, 0, 12, 0, 2, 2, 0, 1, 2, 1, + 3, 2, 0, 5, 3, 1, 0, 0, 0, 13, + 0, 1, 1, 3, 1, 4, 2, 0, 3, 2, + 1, 3, 0, 3, 1, 1, 3, 1, 2, 3, + 4, 4, 0, 3, 1, 3, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, + 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 3, 4, 4, 4, 3, - 3, 4, 3, 4, 4, 4, 0, 1, 3, 4, - 0, 1, 1, 3, 2, 3, 1, 2, 3, 2, - 1, 1, 0, 1, 1, 3, 3, 3, 2, 1, - 1, 1, 1, 2, 2, 4, 3, 1, 4, 4, - 3, 1, 3, 2, 1, 3, 1, 1, 1, 4, - 3, 2, 2, 6, 3, 7, 4, 3, 7, 3, - 0, 2, 4, 1, 2, 0, 1, 1, 3, 3, - 1, 1, 1, 0, 1, 1, 2, 2, 3, 1, - 2, 0, 1, 2, 4, 1, 3, 0, 5, 1, - 1, 1, 2, 3, 3, 4, 4, 1, 2, 4, - 4, 4, 4, 0, 4, 0, 5, 0, 1, 0, - 4, 4, 1, 2, 2, 4, 2, 1, 2, 2, - 2, 2, 2, 2, 1, 3, 3, 3, 1, 3, - 3, 3, 3, 1, 3, 3, 1, 3, 3, 3, - 3, 1, 3, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 3, 1, 3, 1, 5, 4, 3, + 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 3, 4, 4, 4, + 3, 3, 4, 3, 4, 4, 4, 0, 1, 3, + 4, 0, 1, 1, 3, 2, 3, 1, 2, 3, + 2, 1, 1, 0, 1, 1, 3, 3, 3, 2, + 1, 1, 1, 1, 2, 2, 4, 3, 1, 4, + 4, 3, 1, 3, 2, 1, 3, 1, 1, 1, + 4, 3, 2, 2, 6, 3, 7, 4, 3, 7, + 3, 0, 2, 4, 1, 2, 0, 1, 1, 3, + 3, 1, 1, 1, 0, 1, 1, 2, 2, 3, + 1, 2, 0, 1, 2, 4, 1, 3, 0, 5, + 1, 1, 1, 2, 3, 3, 4, 4, 1, 2, + 4, 4, 4, 4, 0, 4, 0, 5, 0, 1, + 0, 4, 4, 1, 2, 2, 4, 2, 1, 2, + 2, 2, 2, 2, 2, 1, 3, 3, 3, 1, + 3, 3, 3, 3, 1, 3, 3, 1, 3, 3, + 3, 3, 1, 3, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 5, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 1, 3, 3, 2, 1, 0, 1, 1, 1, 0, - 2, 1, 1, 0, 4, 0, 5, 0, 0, 7, - 0, 0, 8, 1, 1, 1, 1, 1, 1, 6, - 4, 4, 1, 1, 0, 0, 0, 0, 15, 0, - 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, + 3, 1, 3, 3, 2, 1, 0, 1, 1, 1, + 0, 2, 1, 1, 0, 4, 0, 5, 0, 0, + 7, 0, 0, 8, 1, 1, 1, 1, 1, 1, + 6, 4, 4, 1, 1, 0, 0, 0, 0, 15, + 0, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 2, 3, 0, 1, 1, 2, 4, 3, 1, - 3, 1, 3, 1, 1, 0, 1, 1, 1, 0, - 4, 1, 1, 0, 4, 1, 0, 1, 1, 2, - 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, + 1, 0, 2, 3, 0, 1, 1, 2, 4, 3, + 1, 3, 1, 3, 1, 1, 0, 1, 1, 1, + 0, 4, 1, 1, 0, 4, 1, 0, 1, 1, + 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0, 4, 1, 2, 2, 2, 2, 2, 2, - 1, 1, 2, 1, 1, 1, 0, 6, 0, 7, - 1, 1, 0, 2, 2, 1, 0, 1, 0, 1, - 1, 2, 2, 4, 0, 2, 0, 1, 1, 2, - 4, 1, 5, 2, 2, 2, 2, 2, 2, 1, - 1, 1, 1, 1, 5, 7, 4, 0, 8, 4, - 0, 1, 1, 2, 1, 0, 3, 1, 2, 3, - 3, 1, 1, 1, 1, 1, 5, 4, 7, 3, - 6, 0, 4, 0, 4, 2, 0, 4, 2, 3, - 1, 0, 1, 0, 5, 1, 0, 1, 0, 1, - 1, 1, 3, 4, 5, 0, 9, 5, 4, 1, - 1, 1, 1, 1, 1, 2, 2, 2, 3, 4, - 3, 3, 3, 2, 3, 2, 4, 4, 3, 0, - 1, 3, 4, 5, 3, 1, 2, 0, 1, 2, - 0, 7, 3, 2, 2, 0, 3, 5, 4, 0, - 0, 10, 0, 0, 9, 5, 4, 2, 1, 0, - 2, 2, 2, 2, 2, 4, 5, 4, 5, 0, - 5, 0, 6, 3, 2, 2, 2, 1, 0, 3, - 0, 0, 6, 1, 2, 1, 1, 1, 1, 1, - 0, 5, 0, 3, 0, 0, 0, 12, 0, 0, - 0, 13, 0, 2, 0, 3, 1, 0, 4, 1, - 0, 4, 1, 2, 2, 1, 2, 2, 0, 0, - 4, 2, 3, 0, 4, 2, 2, 3, 0, 1, - 1, 1, 2, 2, 2, 4, 3, 0, 7, 4, - 4, 3, 1, 3, 0, 0, 4, 0, 1, 1, - 3, 2, + 1, 1, 0, 4, 1, 2, 2, 2, 2, 2, + 2, 1, 1, 2, 1, 1, 1, 0, 6, 0, + 7, 1, 1, 0, 2, 2, 1, 0, 1, 0, + 1, 1, 2, 2, 4, 0, 2, 0, 1, 1, + 2, 4, 1, 5, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 5, 7, 4, 0, 8, + 4, 0, 1, 1, 2, 1, 0, 3, 1, 2, + 3, 3, 1, 1, 1, 1, 1, 5, 4, 7, + 3, 6, 0, 4, 0, 4, 2, 0, 4, 2, + 3, 1, 0, 1, 0, 5, 1, 0, 1, 0, + 1, 1, 1, 3, 4, 5, 0, 9, 5, 4, + 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, + 4, 3, 3, 3, 2, 3, 2, 4, 4, 3, + 0, 1, 3, 4, 5, 3, 1, 2, 0, 1, + 2, 0, 7, 3, 2, 2, 0, 3, 5, 4, + 0, 0, 10, 0, 0, 9, 5, 4, 2, 1, + 0, 2, 2, 2, 2, 2, 4, 5, 4, 5, + 0, 5, 0, 6, 3, 2, 2, 2, 1, 0, + 3, 0, 0, 6, 1, 2, 1, 1, 1, 1, + 1, 0, 5, 0, 3, 0, 0, 0, 12, 0, + 0, 0, 13, 0, 2, 0, 3, 1, 0, 4, + 1, 0, 4, 1, 2, 2, 1, 2, 2, 0, + 0, 4, 2, 3, 0, 4, 2, 2, 3, 0, + 1, 1, 1, 2, 2, 2, 4, 3, 0, 7, + 4, 4, 3, 1, 3, 0, 0, 4, 0, 1, + 1, 3, 2, }; static readonly short [] yyDefRed = { 0, 8, 0, 0, 0, 0, 0, 0, 0, 2, 4, - 0, 0, 11, 14, 0, 952, 0, 0, 956, 0, - 0, 15, 17, 379, 385, 392, 380, 382, 0, 381, - 0, 388, 390, 377, 0, 384, 386, 378, 389, 391, - 387, 342, 973, 0, 383, 963, 0, 10, 1, 0, - 0, 0, 12, 0, 782, 0, 0, 0, 0, 0, - 0, 0, 0, 420, 0, 0, 0, 0, 0, 0, - 0, 418, 0, 0, 0, 479, 0, 419, 0, 518, - 0, 876, 0, 0, 0, 629, 0, 0, 0, 0, - 0, 0, 0, 680, 0, 731, 0, 0, 0, 0, - 0, 0, 0, 0, 417, 0, 618, 0, 781, 0, - 714, 0, 0, 0, 0, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 415, 416, 625, 548, 0, 0, + 0, 0, 11, 14, 0, 953, 0, 0, 957, 0, + 0, 15, 17, 380, 386, 393, 381, 383, 0, 382, + 0, 389, 391, 378, 0, 385, 387, 379, 390, 392, + 388, 343, 974, 0, 384, 964, 0, 10, 1, 0, + 0, 0, 12, 0, 783, 0, 0, 0, 0, 0, + 0, 0, 0, 421, 0, 0, 0, 0, 0, 0, + 0, 419, 0, 0, 0, 480, 0, 420, 0, 519, + 0, 877, 0, 0, 0, 630, 0, 0, 0, 0, + 0, 0, 0, 681, 0, 732, 0, 0, 0, 0, + 0, 0, 0, 0, 418, 0, 619, 0, 782, 0, + 715, 0, 0, 0, 0, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 416, 417, 626, 549, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 626, 624, 627, 628, 698, 700, 0, 696, 699, 715, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 716, 0, 0, 0, 783, 784, 803, 804, 805, 806, - 840, 841, 842, 843, 844, 845, 0, 0, 0, 20, - 0, 0, 332, 0, 334, 960, 16, 953, 0, 0, - 241, 240, 237, 242, 243, 236, 255, 254, 247, 248, - 244, 246, 245, 249, 238, 239, 250, 251, 257, 256, - 252, 253, 0, 0, 976, 0, 965, 0, 964, 3, - 51, 0, 0, 0, 40, 37, 39, 42, 43, 44, - 45, 46, 49, 13, 0, 0, 0, 846, 421, 422, - 874, 0, 0, 0, 0, 0, 0, 0, 848, 847, - 0, 540, 534, 539, 730, 780, 701, 728, 727, 729, - 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, - 712, 713, 0, 0, 0, 812, 0, 0, 0, 746, - 745, 0, 0, 0, 0, 0, 0, 0, 0, 854, - 0, 0, 0, 0, 393, 0, 0, 0, 856, 861, - 0, 0, 0, 875, 0, 0, 0, 744, 740, 0, - 0, 0, 0, 0, 0, 0, 361, 0, 0, 0, - 0, 0, 0, 0, 0, 621, 0, 547, 0, 0, - 545, 549, 550, 544, 554, 553, 551, 552, 614, 529, - 0, 414, 413, 0, 0, 0, 0, 0, 732, 0, - 331, 0, 738, 739, 0, 482, 483, 0, 0, 0, - 736, 737, 0, 0, 0, 0, 0, 0, 0, 0, + 627, 625, 628, 629, 699, 701, 0, 697, 700, 716, + 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 717, 0, 0, 0, 784, 785, 804, 805, 806, 807, + 841, 842, 843, 844, 845, 846, 0, 0, 0, 20, + 0, 0, 333, 0, 335, 961, 16, 954, 0, 0, + 242, 241, 238, 243, 244, 237, 256, 255, 248, 249, + 245, 247, 246, 250, 239, 240, 251, 252, 258, 257, + 253, 254, 0, 0, 977, 0, 966, 0, 965, 3, + 52, 0, 0, 0, 41, 38, 40, 43, 44, 45, + 46, 47, 50, 13, 0, 0, 0, 847, 422, 423, + 875, 0, 0, 0, 0, 0, 0, 0, 849, 848, + 0, 541, 535, 540, 731, 781, 702, 729, 728, 730, + 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 0, 0, 0, 813, 0, 0, 0, 747, + 746, 0, 0, 0, 0, 0, 0, 0, 0, 855, + 0, 0, 0, 0, 394, 0, 0, 0, 857, 862, + 0, 0, 0, 876, 0, 0, 0, 745, 741, 0, + 0, 0, 0, 0, 0, 0, 362, 0, 0, 0, + 0, 0, 0, 0, 0, 622, 0, 548, 0, 0, + 546, 550, 551, 545, 555, 554, 552, 553, 615, 530, + 0, 415, 414, 0, 0, 0, 0, 0, 733, 0, + 332, 0, 739, 740, 0, 483, 484, 0, 0, 0, + 737, 738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 955, 697, 747, 735, 0, - 778, 779, 908, 923, 0, 0, 909, 911, 0, 935, - 894, 892, 916, 0, 0, 914, 917, 918, 919, 920, - 895, 893, 0, 0, 0, 336, 0, 18, 0, 0, - 0, 972, 0, 343, 0, 0, 0, 974, 0, 0, - 38, 651, 657, 649, 0, 646, 656, 650, 648, 647, - 654, 652, 653, 659, 655, 658, 660, 0, 0, 644, - 41, 50, 481, 0, 477, 478, 0, 0, 475, 0, - 749, 0, 0, 0, 810, 0, 777, 775, 776, 0, - 0, 0, 633, 0, 851, 849, 634, 0, 0, 503, - 0, 0, 0, 494, 0, 498, 508, 510, 0, 490, - 0, 0, 0, 0, 0, 485, 0, 488, 0, 492, - 363, 853, 852, 0, 0, 855, 865, 0, 0, 0, - 866, 0, 0, 877, 0, 0, 743, 0, 373, 369, - 370, 0, 0, 368, 371, 372, 0, 0, 0, 555, - 0, 0, 536, 0, 616, 695, 0, 0, 0, 689, - 691, 692, 693, 425, 426, 0, 339, 340, 0, 179, - 178, 180, 0, 0, 0, 0, 365, 0, 601, 0, - 0, 859, 0, 0, 0, 430, 0, 433, 0, 431, - 0, 471, 0, 0, 0, 0, 0, 460, 463, 0, - 0, 455, 462, 461, 590, 591, 592, 593, 594, 595, - 596, 597, 598, 600, 599, 556, 558, 557, 562, 563, + 0, 0, 0, 0, 0, 956, 698, 748, 736, 0, + 779, 780, 909, 924, 0, 0, 910, 912, 0, 936, + 895, 893, 917, 0, 0, 915, 918, 919, 920, 921, + 896, 894, 0, 0, 0, 337, 0, 18, 0, 0, + 0, 973, 0, 344, 0, 0, 0, 975, 0, 0, + 39, 652, 658, 650, 0, 647, 657, 651, 649, 648, + 655, 653, 654, 660, 656, 659, 661, 0, 0, 645, + 42, 51, 482, 0, 478, 479, 0, 0, 476, 0, + 750, 0, 0, 0, 811, 0, 778, 776, 777, 0, + 0, 0, 634, 0, 852, 850, 635, 0, 0, 504, + 0, 0, 0, 495, 0, 499, 509, 511, 0, 491, + 0, 0, 0, 0, 0, 486, 0, 489, 0, 493, + 364, 854, 853, 0, 0, 856, 866, 0, 0, 0, + 867, 0, 0, 878, 0, 0, 744, 0, 374, 370, + 371, 0, 0, 369, 372, 373, 0, 0, 0, 556, + 0, 0, 537, 0, 617, 696, 0, 0, 0, 690, + 692, 693, 694, 426, 427, 0, 340, 341, 0, 180, + 179, 181, 0, 0, 0, 0, 366, 0, 602, 0, + 0, 860, 0, 0, 0, 431, 0, 434, 0, 432, + 0, 472, 0, 0, 0, 0, 0, 461, 464, 0, + 0, 456, 463, 462, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 601, 600, 557, 559, 558, 563, 564, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 586, 0, 0, 507, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 907, 906, - 0, 915, 0, 905, 0, 0, 333, 970, 971, 357, - 0, 0, 0, 354, 0, 0, 176, 0, 0, 980, - 966, 968, 59, 57, 58, 0, 0, 52, 0, 0, - 60, 62, 26, 24, 0, 0, 0, 641, 0, 645, - 429, 0, 480, 0, 531, 0, 542, 165, 187, 0, - 0, 0, 155, 0, 0, 0, 166, 535, 0, 880, - 0, 832, 813, 0, 823, 0, 834, 0, 850, 787, - 0, 879, 0, 0, 493, 0, 509, 511, 0, 0, - 447, 0, 0, 443, 0, 0, 472, 0, 513, 487, - 0, 0, 140, 514, 138, 139, 516, 0, 530, 790, - 0, 870, 0, 863, 0, 867, 522, 0, 0, 0, - 358, 0, 520, 0, 0, 532, 887, 0, 883, 808, - 0, 898, 0, 896, 0, 0, 631, 632, 0, 0, - 0, 694, 682, 683, 681, 690, 609, 615, 608, 0, - 0, 338, 604, 0, 0, 0, 546, 858, 857, 733, - 434, 428, 432, 427, 533, 470, 469, 468, 465, 464, - 0, 459, 423, 424, 435, 436, 0, 589, 0, 756, - 0, 0, 613, 612, 924, 900, 0, 925, 0, 910, - 912, 921, 0, 936, 0, 904, 950, 19, 335, 679, - 678, 0, 677, 0, 353, 982, 177, 977, 0, 0, - 53, 0, 0, 0, 0, 0, 0, 360, 0, 635, - 0, 0, 79, 78, 0, 476, 0, 0, 0, 0, - 0, 170, 541, 0, 0, 0, 0, 0, 824, 816, - 814, 0, 835, 0, 0, 878, 500, 499, 450, 0, - 0, 961, 962, 439, 445, 0, 448, 0, 474, 0, - 0, 0, 0, 0, 788, 873, 0, 864, 0, 528, - 523, 0, 0, 519, 0, 886, 0, 807, 899, 897, - 0, 537, 0, 617, 611, 341, 603, 602, 619, 467, - 0, 458, 457, 456, 588, 140, 0, 772, 754, 0, - 0, 0, 761, 0, 902, 0, 929, 0, 0, 944, - 945, 938, 0, 356, 355, 981, 0, 0, 61, 55, - 0, 63, 25, 22, 0, 0, 309, 0, 213, 0, - 102, 0, 76, 766, 113, 114, 0, 0, 0, 769, - 185, 186, 0, 0, 0, 0, 158, 167, 159, 161, - 811, 0, 0, 0, 0, 0, 833, 0, 0, 449, - 451, 452, 446, 440, 444, 0, 505, 0, 473, 484, - 438, 517, 515, 0, 869, 0, 0, 0, 524, 0, - 889, 0, 0, 630, 622, 0, 466, 0, 0, 752, - 751, 748, 762, 901, 0, 0, 0, 0, 922, 0, - 951, 969, 0, 0, 0, 68, 69, 72, 73, 0, - 326, 315, 314, 0, 636, 209, 97, 0, 750, 770, - 171, 0, 183, 0, 0, 0, 809, 891, 0, 0, - 0, 0, 815, 0, 836, 786, 489, 486, 795, 0, - 802, 0, 0, 793, 0, 798, 871, 527, 526, 888, - 884, 0, 620, 0, 0, 903, 926, 0, 913, 0, - 0, 940, 0, 74, 66, 0, 0, 0, 310, 0, - 0, 0, 0, 0, 172, 0, 162, 160, 881, 825, - 819, 817, 0, 0, 789, 794, 0, 799, 0, 0, - 623, 0, 764, 0, 930, 947, 948, 941, 54, 0, - 70, 71, 0, 0, 0, 0, 0, 0, 0, 771, - 169, 0, 182, 0, 0, 837, 801, 800, 0, 684, - 686, 872, 885, 773, 0, 0, 0, 75, 0, 0, - 327, 0, 0, 325, 311, 0, 319, 376, 0, 374, - 0, 637, 0, 666, 210, 98, 173, 882, 821, 818, - 0, 0, 830, 0, 927, 0, 942, 0, 0, 0, - 308, 0, 0, 663, 0, 0, 0, 667, 0, 0, - 0, 0, 0, 931, 28, 23, 328, 324, 0, 0, - 320, 375, 669, 0, 0, 0, 99, 820, 685, 0, - 0, 0, 0, 312, 674, 0, 675, 672, 0, 670, - 95, 0, 93, 0, 0, 82, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 94, 141, 0, 0, 226, - 218, 219, 220, 221, 222, 223, 224, 225, 0, 0, - 216, 0, 0, 928, 0, 329, 323, 0, 0, 0, - 638, 83, 0, 269, 264, 268, 0, 211, 217, 0, - 934, 932, 673, 671, 0, 0, 0, 0, 0, 0, - 0, 278, 0, 0, 227, 0, 0, 235, 0, 153, - 142, 152, 0, 100, 0, 0, 263, 0, 0, 262, - 0, 146, 0, 0, 347, 0, 345, 0, 0, 188, - 0, 0, 0, 0, 0, 639, 212, 0, 103, 0, - 344, 0, 0, 0, 0, 117, 0, 0, 0, 0, - 0, 0, 151, 143, 0, 0, 192, 0, 348, 0, - 230, 229, 228, 0, 101, 0, 282, 0, 260, 119, - 0, 258, 0, 0, 0, 121, 0, 349, 0, 0, - 189, 0, 0, 0, 346, 233, 112, 110, 0, 0, - 286, 0, 0, 0, 0, 0, 147, 0, 266, 0, - 0, 0, 0, 125, 0, 0, 0, 0, 350, 351, - 0, 0, 0, 0, 0, 107, 301, 0, 283, 0, - 0, 295, 0, 0, 0, 290, 0, 137, 0, 0, - 0, 0, 132, 0, 0, 279, 0, 122, 0, 116, - 126, 144, 150, 200, 0, 190, 0, 0, 0, 0, - 111, 0, 104, 108, 0, 0, 0, 297, 0, 298, - 287, 0, 0, 281, 291, 261, 0, 0, 118, 133, - 259, 0, 277, 0, 267, 271, 128, 0, 0, 0, - 197, 199, 193, 234, 109, 302, 304, 284, 0, 0, - 296, 293, 136, 134, 148, 276, 0, 0, 0, 145, - 201, 203, 191, 0, 0, 0, 295, 0, 272, 274, - 129, 0, 0, 194, 306, 307, 303, 305, 294, 149, - 0, 0, 207, 206, 205, 202, 204, 0, 0, 0, - 195, 273, 275, + 0, 0, 0, 0, 0, 587, 0, 0, 508, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 908, 907, + 0, 916, 0, 906, 0, 0, 334, 971, 972, 358, + 0, 0, 0, 355, 0, 0, 177, 0, 0, 981, + 967, 969, 60, 58, 59, 0, 0, 53, 0, 0, + 61, 63, 27, 25, 0, 0, 0, 642, 0, 646, + 430, 0, 481, 0, 532, 0, 543, 166, 188, 0, + 0, 0, 156, 0, 0, 0, 167, 536, 0, 881, + 0, 833, 814, 0, 824, 0, 835, 0, 851, 788, + 0, 880, 0, 0, 494, 0, 510, 512, 0, 0, + 448, 0, 0, 444, 0, 0, 473, 0, 514, 488, + 0, 0, 141, 515, 139, 140, 517, 0, 531, 791, + 0, 871, 0, 864, 0, 868, 523, 0, 0, 0, + 359, 0, 521, 0, 0, 533, 888, 0, 884, 809, + 0, 899, 0, 897, 0, 0, 632, 633, 0, 0, + 0, 695, 683, 684, 682, 691, 610, 616, 609, 0, + 0, 339, 605, 0, 0, 0, 547, 859, 858, 734, + 435, 429, 433, 428, 534, 471, 470, 469, 466, 465, + 0, 460, 424, 425, 436, 437, 0, 590, 0, 757, + 0, 0, 614, 613, 925, 901, 0, 926, 0, 911, + 913, 922, 0, 937, 0, 905, 951, 19, 336, 680, + 679, 0, 678, 0, 354, 983, 178, 978, 0, 0, + 54, 0, 0, 0, 0, 0, 0, 361, 0, 636, + 0, 0, 80, 79, 0, 477, 0, 0, 0, 0, + 0, 171, 542, 0, 0, 0, 0, 0, 825, 817, + 815, 0, 836, 0, 0, 879, 501, 500, 451, 0, + 0, 962, 963, 440, 446, 0, 449, 0, 475, 0, + 0, 0, 0, 0, 789, 874, 0, 865, 0, 529, + 524, 0, 0, 520, 0, 887, 0, 808, 900, 898, + 0, 538, 0, 618, 612, 342, 604, 603, 620, 468, + 0, 459, 458, 457, 589, 141, 0, 773, 755, 0, + 0, 0, 762, 0, 903, 0, 930, 0, 0, 945, + 946, 939, 0, 357, 356, 982, 0, 0, 62, 56, + 0, 64, 26, 22, 0, 0, 310, 0, 214, 0, + 103, 0, 77, 767, 114, 115, 0, 0, 0, 770, + 186, 187, 0, 0, 0, 0, 159, 168, 160, 162, + 812, 0, 0, 0, 0, 0, 834, 0, 0, 450, + 452, 453, 447, 441, 445, 0, 506, 0, 474, 485, + 439, 518, 516, 0, 870, 0, 0, 0, 525, 0, + 890, 0, 0, 631, 623, 0, 467, 0, 0, 753, + 752, 749, 763, 902, 0, 0, 0, 0, 923, 0, + 952, 970, 0, 0, 0, 69, 70, 73, 74, 0, + 327, 316, 315, 0, 637, 210, 98, 0, 751, 771, + 172, 0, 184, 0, 0, 0, 810, 892, 0, 0, + 0, 0, 816, 0, 837, 787, 490, 487, 796, 0, + 803, 0, 0, 794, 0, 799, 872, 528, 527, 889, + 885, 0, 621, 0, 0, 904, 927, 0, 914, 0, + 0, 941, 0, 75, 67, 0, 0, 0, 311, 0, + 0, 0, 0, 0, 173, 0, 163, 161, 882, 826, + 820, 818, 0, 0, 790, 795, 0, 800, 0, 0, + 624, 0, 765, 0, 931, 948, 949, 942, 55, 0, + 71, 72, 0, 0, 0, 0, 0, 0, 0, 772, + 170, 0, 183, 0, 0, 838, 802, 801, 0, 685, + 687, 873, 886, 774, 0, 0, 0, 76, 0, 0, + 328, 0, 0, 326, 312, 0, 320, 377, 0, 375, + 0, 638, 0, 667, 211, 99, 174, 883, 822, 819, + 0, 0, 831, 0, 928, 0, 943, 0, 0, 0, + 309, 0, 0, 664, 0, 0, 0, 668, 0, 0, + 0, 0, 0, 932, 29, 23, 329, 325, 0, 0, + 321, 376, 670, 0, 0, 0, 100, 821, 686, 0, + 0, 0, 0, 313, 675, 0, 676, 673, 0, 671, + 96, 0, 94, 0, 0, 83, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 95, 142, 0, 0, 227, + 219, 220, 221, 222, 223, 224, 225, 226, 0, 0, + 217, 0, 0, 929, 0, 330, 324, 0, 0, 0, + 639, 84, 0, 270, 265, 269, 0, 212, 218, 0, + 935, 933, 674, 672, 0, 0, 0, 0, 0, 0, + 0, 279, 0, 0, 228, 0, 0, 236, 0, 154, + 143, 153, 0, 101, 0, 0, 264, 0, 0, 263, + 0, 147, 0, 0, 348, 0, 346, 0, 0, 189, + 0, 0, 0, 0, 0, 640, 213, 0, 104, 0, + 345, 0, 0, 0, 0, 118, 0, 0, 0, 0, + 0, 0, 152, 144, 0, 0, 193, 0, 349, 0, + 231, 230, 229, 0, 102, 0, 283, 0, 261, 120, + 0, 259, 0, 0, 0, 122, 0, 350, 0, 0, + 190, 0, 0, 0, 347, 234, 113, 111, 0, 0, + 287, 0, 0, 0, 0, 0, 148, 0, 267, 0, + 0, 0, 0, 126, 0, 0, 0, 0, 351, 352, + 0, 0, 0, 0, 0, 108, 302, 0, 284, 0, + 0, 296, 0, 0, 0, 291, 0, 138, 0, 0, + 0, 0, 133, 0, 0, 280, 0, 123, 0, 117, + 127, 145, 151, 201, 0, 191, 0, 0, 194, 0, + 112, 0, 105, 109, 0, 0, 0, 298, 0, 299, + 288, 0, 0, 282, 292, 262, 0, 0, 119, 134, + 260, 0, 278, 0, 268, 272, 129, 0, 0, 0, + 198, 200, 0, 235, 110, 303, 305, 285, 0, 0, + 297, 294, 137, 135, 149, 277, 0, 0, 0, 146, + 202, 204, 192, 0, 0, 0, 296, 0, 273, 275, + 130, 0, 0, 195, 307, 308, 304, 306, 295, 150, + 0, 0, 208, 207, 206, 203, 205, 0, 0, 0, + 196, 274, 276, }; protected static readonly short [] yyDgoto = { 7, 8, 49, 9, 50, 10, 11, 51, 232, 700, 662, @@ -9680,7 +9696,7 @@ void case_982() 1400, 1403, 1404, 1499, 1432, 1433, 1429, 1257, 1311, 1283, 1328, 702, 1379, 1478, 1348, 1435, 1508, 469, 267, 703, 704, 705, 706, 707, 665, 575, 1152, 666, 667, 871, - 1330, 1356, 1446, 1407, 1480, 1331, 1382, 1504, 1528, 1447, + 1330, 1356, 1446, 1407, 1480, 1331, 1382, 1483, 1528, 1447, 1448, 1526, 1512, 1513, 970, 1111, 1209, 1269, 1313, 1270, 1271, 1305, 1363, 1334, 1306, 327, 223, 1411, 1308, 1396, 1393, 1258, 1285, 1324, 1475, 1437, 1162, 1476, 600, 1521, @@ -9725,7 +9741,7 @@ void case_982() 706, 0, 8561, 9, 9, 0, 8718, 0, 482, 0, 279, 0, 9, 419, 9, 0, 1465, 1465, 501, 9, 9, -216,11828, 0,11148, 0,11828,11828,11828,11828, -11828,11828,11828,11828, 0, 133, 0, 7831, 0, 131, +11828,11828,11828,11828, 0, 133, 0, 8126, 0, 131, 0, 437, 505, 318, 429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1044, 775, @@ -9734,26 +9750,26 @@ void case_982() 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 168, 614, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 317, 332, 215, 0, - 451, 191, 0, 587, 0, 0, 0, 0, 7831, 7831, + 451, 191, 0, 587, 0, 0, 0, 0, 8126, 8126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 665, 599, 0, 629, 0, 69, 0, 0, 0, 215,13031, 713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 794, 641,11284, 0, 0, 0, 0,11148, 9, 9, 785, 331, 318, 168, 0, 0, - 7831, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 8126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -176, -267,12045, 0, 7831,11148, 716, 0, - 0, 734,11148,11148, 9503, -251, -118, 772, 8126, 0, -11828, 133, 889, 800, 0, 818, 7831,11148, 0, 0, + 0, 0, -176, -267,12045, 0, 8126,11148, 716, 0, + 0, 734,11148,11148, 9503, -251, -118, 772, 8421, 0, +11828, 133, 889, 800, 0, 818, 8126,11148, 0, 0, 830, 591, 9, 0,11148, 482,10604, 0, 0, 419, 11148, 419, -279, 539, 854, 168, 0, 614, 429, 919, 168,11148,11148,11148, 399, 0, 840, 0, 7029, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4270, 0, 0,12518, -279, 843, 857,11148, 0, 809, + 4429, 0, 0,12518, -279, 843, 857,11148, 0, 809, 0, -294, 0, 0, 356, 0, 0, 810, 8875,10468, 0, 0,11148,11148,11148,11148,11148,11148,11148,11148, -11148,11148,11148,11828,11828,11828, 7831, 7831,11828,11828, +11148,11148,11148,11828,11828,11828, 8126, 8126,11828,11828, 11828,11828,11828,11828,11828,11828,11828,11828,11828,11828, 11828,11828,11828,11828,11148, 0, 0, 0, 0, 614, 0, 0, 0, 0, 1465, 1465, 0, 0, 168, 0, @@ -9768,11 +9784,11 @@ void case_982() 438, 0, 897, 0, 892, 0, 0, 0, 596, 0, 8245, 615,11148, 772,10468, 0, 7500, 0, 419, 0, 0, 0, 0, 896, 92, 0, 0, 279, 482, -159, - 0, 4111, 900, 0, 135, 168, 0, 136, 0, 0, + 0, 4270, 900, 0, 135, 168, 0, 136, 0, 0, 0,11148, 975, 0, 0, 0,11148, 979, 901, 0, 904, 906, 0,12518, 0, 0, -186, 44, 7029, 0, 0, 0, 0, 0, 0, 482, 0, 0, -268, 0, - 0, 0, 419, -279, 168, 8421, 0, 907, 0, 908, + 0, 0, 419, -279, 168, 8578, 0, 907, 0, 908, 11828, 0, 1029, 920, 7029, 0, -300, 0, 240, 0, 809, 0, 81,11148,11148, 924, 1041, 0, 0, 123, -80, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -9781,37 +9797,37 @@ void case_982() 260, 523, 568, 580, 593, 0, -161, -149, 0, 9032, 1005, 168, 1006, 168, 9032, 9032, 921,11148, 0, 0, 875, 0, 168, 0, 422, 809, 0, 0, 0, 0, - 481, 215, 31, 0, 8421, 551, 0, 931, 930, 0, + 481, 215, 31, 0, 8578, 551, 0, 931, 930, 0, 0, 0, 0, 0, 0, -279, 933, 0, 934, 936, - 0, 0, 0, 0, 938, 8578, 894, 0, 267, 0, + 0, 0, 0, 0, 938, 8735, 894, 0, 267, 0, 0, 321, 0,11284, 0, 932, 0, 0, 0, 454, -47, 942, 0, 941, 943, 944, 0, 0,11148, 0, 168, 0, 0, 704, 0, 945, 0, 427, 0, 0, 6872, 0, 6872, 8404, 0, 9503, 0, 0,10740, 151, 0, 114, -34, 0, 887, 899, 0, 91, 0, 0, 948, 949, 0, 0, 0, 0, 0, 950, 0, 0, - 958, 0, 4429, 0, 482, 0, 0, 419, 617, 905, + 958, 0, 4594, 0, 482, 0, 0, 419, 617, 905, 0, 175, 0, 955, 956, 0, 0, 6872, 0, 0, - 6872, 0,11148, 0,11148, 7831, 0, 0, 482, 959, + 6872, 0,11148, 0,11148, 8126, 0, 0, 482, 959, 482, 0, 0, 0, 0, 0, 0, 0, 0, 9032, - 7831, 0, 0, 168,12518, 987, 0, 0, 0, 0, + 8126, 0, 0, 168,12518, 987, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10332, 0, 0, 0, 0, 0, 7657, 0, 9032, 0, 7814, 964, 0, 0, 0, 0, 1038, 0, 1039, 0, 0, 0, 566, 0, 966, 0, 0, 0, 0, 0, 0, 926, 0, -86, 0, 0, 0, 0, 551, 551, 0, 821, 976, 974, 937, 981, 894, 0, 977, 0, - 1093, 1095, 0, 0,11148, 0,10876, 980, 454, 8421, - 7831, 0, 0, -233, 1100, 1102, 137, 984, 0, 0, + 1093, 1095, 0, 0,11148, 0,10876, 980, 454, 8578, + 8126, 0, 0, -233, 1100, 1102, 137, 984, 0, 0, 0,11148, 0,11148, 1080, 0, 0, 0, 0, 41, 11012, 0, 0, 0, 0, 7950, 0, 1105, 0, 614, 11148, 999, 8404, 1001, 0, 0, 168, 0, 196, 0, 0, 809, 905, 0, 168, 0, -62, 0, 0, 0, 995, 0, 1027, 0, 0, 0, 0, 0, 0, 0, - 729, 0, 0, 0, 0, 0, 8126, 0, 0, 168, + 729, 0, 0, 0, 0, 0, 8421, 0, 0, 168, 13, 964, 0, 9032, 0, 9032, 0, 1020, 9032, 0, 0, 0, 584, 0, 0, 0, 1004, 821, 0, 0, -11420, 0, 0, 0, 1007, 4594, 0, 894, 0, 894, +11420, 0, 0, 0, 1007, 7517, 0, 894, 0, 894, 0, 894, 0, 0, 0, 0, 168, 1000, 980, 0, 0, 0, -166, -164, 1003, 1008, 0, 0, 0, 0, 0, 1010, 8404, 964, -149,11148, 0, 1009, 6872, 0, @@ -9829,13 +9845,13 @@ void case_982() 1049, 1049,10876, 1050, 0,11148, 0, 0, 0, 0, 0, 0, 6872, -139, 0, 0, 7029, 0, 784, 6872, 0, 1056, 0, 9032, 0, 0, 0, 0, 0,11148, - 0, 0, 215, 1055, 215, 7831, 1077, 1077, 1077, 0, + 0, 0, 215, 1055, 215, 8126, 1077, 1077, 1077, 0, 0,11148, 0, 6872, 9189, 0, 0, 0, 7029, 0, 0, 0, 0, 0, 1082, 9032,11148, 0, 215, 1060, 0, 1017, 789, 0, 0, 1057, 0, 0, 36, 0, 1018, 0, 1077, 0, 0, 0, 0, 0, 0, 0, 1061, 945, 0, 7029, 0, 1089, 0, 1063, 1077, 1184, - 0, 1073, 215, 0, 7831, -105, 1075, 0, 1090, 1092, + 0, 1073, 215, 0, 8126, -105, 1075, 0, 1090, 1092, 6872, 1076, 9032, 0, 0, 0, 0, 0, 1079, 1063, 0, 0, 0,12124, 120, 215, 0, 0, 0, 1106, 9032, 1085,11148, 0, 0, 1094, 0, 0, 1097, 0, @@ -9844,10 +9860,10 @@ void case_982() 0, 0, 0, 0, 0, 0, 0, 0, 1099, 215, 0, 120, 168, 0, 1106, 0, 0, 1091,12124,12290, 0, 0, 20, 0, 0, 0,12322, 0, 0, 1101, - 0, 0, 0, 0, 7831, 7831, 265, 8126, 278, 419, + 0, 0, 0, 0, 8126, 8126, 265, 8421, 278, 419, 1127, 0, -279, 946, 0, 1163, 0, 0, 1063, 0, - 0, 0, 1063, 0, 1052, 1054, 0, 7831, -151, 0, - 7831, 0, 1059, 1103, 0, -279, 0, -45,10251, 0, + 0, 0, 1063, 0, 1052, 1054, 0, 8126, -151, 0, + 8126, 0, 1059, 1103, 0, -279, 0, -45,10251, 0, 1104, 1062, 73, 506, 3845, 0, 0, 1063, 0, -279, 0, 1111, 1065, 1110, 1108, 0, 1114, 1054, 1115, 144, 1107, 1117, 0, 0, 1116, 1128, 0, 809, 0, 795, @@ -9859,30 +9875,30 @@ void case_982() 144,10876, 1112, 1152, 1141, 0, 0,13061, 0, 215, 215, 0, 1126, 1153, 1142, 0, 1173, 0,11148, 1130, 1170, 1143, 0, 1175, 144, 0, -96, 0, 1168, 0, - 0, 0, 0, 0,13061, 0, 130, 130, 1145, 1178, + 0, 0, 0, 0,13061, 0, 130, 130, 0, 1178, 0, -52, 0, 0, 256, 1157,13061, 0,13061, 0, 0, 8404, 1171, 0, 0, 0, 1181, 1129, 0, 0, 0, 1182, 0, 294, 0, 0, 0, 1077, 847, 1185, - 0, 0, 0, 0, 0, 0, 0, 0, 1241, 1295, + 0, 0, 1145, 0, 0, 0, 0, 0, 1241, 1295, 0, 0, 0, 0, 0, 0, 1189, 1193, 8404, 0, 0, 0, 0, 130, 526, 526, 0, 1077, 0, 0, 0, 55, 55, 0, 0, 0, 0, 0, 0, 0, 10468,10468, 0, 0, 0, 0, 0, 1197, 1194, 1195, 0, 0, 0, }; - protected static readonly short [] yyRindex = { 1410, - 0, 0, 7186, 1410, 0, 0, 0, 1568, 0, 0, + protected static readonly short [] yyRindex = { 1788, + 0, 0, 7186, 1788, 0, 0, 0, 1568, 0, 0, 1513, 1341, 0, 0, 0, 0, 0, 1513, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1569, 0, 0, 1569, 0, 0, 1568, - 3215, 1788, 0, 0, 0, 0, 0, 0, 0, 0, + 1879, 3172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1203, 0, 0, 0, 0, 0, 0, 0, 0, - 8735, 0, 1196, 0, 0, 0, 1196, 0, 0, 0, + 8892, 0, 1196, 0, 0, 0, 1196, 0, 0, 0, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4587, 0, 0, 0, 0, - 0, 0, 286, 4680, 1796, 0, 0, 0, 0, 0, + 0, 0, 286, 4680, 4022, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4836, 4904, 5144, 5348, 5688, 5892, 6028, 6164, 6300, 6436, 1187, 2889, @@ -9915,7 +9931,7 @@ void case_982() 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3913, 0, 0, 0, 0, 0, 0, 0, 3424, 3467, 0, 0, 0, 0, 2275, 1569, - 1569, 0, -10, 0, 7517, 1569, 1595, 0, 0, 245, + 1569, 0, -10, 0, 7674, 1569, 1595, 0, 0, 245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 453,11977, 0, 0, 0, 0, 3633, 0, 0, 0, 0, 0, 0, @@ -9937,17 +9953,17 @@ void case_982() 5960, 6096, 6232, 6368, 6492, 0, 0, 675, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3913, 0, 0, 0, 0, 2275, 0, 0, 0, 0, - 1183, 9694, 0, 0, 0, 8892, 0, 0, 755, 0, + 1183, 9694, 0, 0, 0, 9049, 0, 0, 755, 0, 0, 0, 0, 0, 0, 683, 698, 0, 0, 1230, - 0, 0, 0, 0, 1236, 0, 0, 0, 0, 0, - 0,11556, 0, 0, 0, 758, 0, 0, 0, 9049, + 0, 0, 0, 0, 1410, 0, 0, 0, 0, 0, + 0,11556, 0, 0, 0, 758, 0, 0, 0, 9206, 12442, 0, 0, 759, 766, 796, 0, 0, 0, 0, 0, 0, 0, 0, 0, 722, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1238, 0, 0, 0, 3699, + 0, 0, 0, 0, 0, 1235, 0, 0, 0, 3699, 0, 0, 177, 0, 98, 3792, 0, 0, 0, 0, - 0, 1232, 0, 0, 0, 0, 0, 1239, 0, 0, + 0, 1232, 0, 0, 0, 0, 0, 1238, 0, 0, 0, 0, 0, 0, 0, 0, 0, -51, 676, 0, - 0, 0, 0, 0, 1237, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -9955,42 +9971,42 @@ void case_982() 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 567, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -181, 0, 472, 0, 0, 0, 0, 0, - 0, 0, 0, -10, 0, 0, 0, 0, 9049, 7674, - 0, 1240, 0, 700, 0, 0, 0, 0, 1244, 0, - 1201, 1206, 0, 0, 0, 0, 0, 1245, 9206, 0, + 0, 0, 0, -10, 0, 0, 0, 0, 9206, 7831, + 0, 1237, 0, 700, 0, 0, 0, 0, 1242, 0, + 1192, 1201, 0, 0, 0, 0, 0, 1239, 9363, 0, 0, 0, 0,12474, 0, 0, 0, 798, 0, 0, 0, 0, 0, 0, 2149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3951, - 0, 4428, 1246, 0, 0, 0, 1243, 0, 0, 0, + 0, 4428, 1243, 0, 0, 0, 1245, 0, 0, 0, 0, 333, 0, 0, 0, 0, 798, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 807, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1247, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1244, 0, 0, 0, 0, 0, 814, 820, 0, 0, 0, 0, - 0, 0, 0, 1248, 608, 1250, 0, 0, 0, 0, + 0, 0, 0, 1249, 608, 1247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4110, 0, 0, - 0, 0, 0, 1249, 0, 0, 333, 0, 0, 846, - 0, 1248, 0, 0, 0, 9346, 0, 643, 654, 0, + 0, 0, 0, 1246, 0, 0, 333, 0, 0, 846, + 0, 1249, 0, 0, 0, 9346, 0, 643, 654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1230, 9540, 0, 0, 0, 0, 0,12605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 630, 0, 737, 0, 0, 0, 0, 1255, 0, - 736, 1252, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1261, 0, 7343, 0, 0, 0, 0, 0, + 0, 630, 0, 737, 0, 0, 0, 0, 1252, 0, + 736, 1250, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1259, 0, 7343, 0, 0, 0, 0, 0, 0, 9346, 0, 0, 0, 0, 0, 0, 0, -154, 484, 0, 0, 0, 0, 0,12681,12366, 0, 218, 218, 218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,12724, 0, -285, 0, 1263, 1263, 1263, 0, - 0, 0, 0, 0, 1259, 0, 0, 0, -182, 0, + 0, 0,12724, 0, -285, 0, 1261, 1261, 1261, 0, + 0, 0, 0, 0, 1257, 0, 0, 0, -182, 0, 0, 0, 0, 0, 0, 0, 0, 0,12767, 0, - 0, 0, 9997, 0, 0, 1264, 0, 0, 369, 0, + 0, 0, 9997, 0, 0, 1262, 0, 0, 369, 0, 0, 0, 533, 0, 0, 0, 0, 0, 0, 0, - 0, 1262, 0, 1267, 0, 0, 0, 3172, 1260, 537, + 0, 1260, 0, 1263, 0, 0, 0, 3215, 1258, 537, 0, 0, -269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3089, 0, 0, 0, 0, 9799,10083, 0, 0, 0, 642, @@ -10003,20 +10019,20 @@ void case_982() 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 457, 0,10219, 0, 0, 0, 4810, 0, 3089, 0, 0, 0, 3089, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 271, 0, 1272, 0, 0, + 0, 0, 0, 0, 0, 271, 0, 1268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3089, 0, 543, 0, 494, 0, 0, 0, 0, 0, 0, 0,12366, - 819, 0, 0, 0, 0, 0, 0, 1235, 0, 516, + 819, 0, 0, 0, 0, 0, 0, 1266, 0, 516, 0, 0, 0, 0, 0, 0, 0, 824, 0, 0, - 0, 0, 0, 0, 0, 0, 1265, 0,12366,12366, - 0,12398, 0, 0, 0, 0, 0, 0, 1268,12991, + 0, 0, 0, 0, 0, 0, 1264, 0,12366,12366, + 0,12398, 0, 0, 0, 0, 0, 0, 1265,12991, 0, 1269,12366,11692, 1270,12366, 0, 0, 0, 0, 0, 0, 1271, 0, 0, 0,12961, 0, 0, 0, 12366, 0, 0, 0, 1273, 0, 0, 378, 0,12885, 12923, 0, 0, 0, 1278, 0, 0, 0, 0, 0, 0, 1279, 0, 0,12366, 0, 664, 0, 825, 0, 0, 0, 0, 0, 861, 0,12809,12847, 0, 0, - 0, 0, 0, 0, 0, 0, 1325, 0, 1393, 0, + 0, 0, 0, 0, 0, 0, 1321, 0, 1381, 0, 0, 0, 829, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -10027,49 +10043,49 @@ void case_982() 0, 0, 0, }; protected static readonly short [] yyGindex = { 0, - 0, 1607, 0, 0, 0, 2, -16, -180, -48, -43, - 0, 1647, 1655, 101, 0, 4, 0, 0, 0, 0, + 0, 1606, 0, 0, 0, 2, -16, -180, -48, -43, + 0, 1645, 1654, 101, 0, 4, 0, 0, 0, 0, 0,-1020, -693, -215, -482, 0, 0, 0, 0, 0, - -224, 0, 0, 0, 703, 0, 811, 0, 0, 0, - 0, 560, 563, -17, -226, 0, -46, 0, 393, 0, - 430, -573, -569, -553, -471, -469, -462, -444, -435, 0, + -224, 0, 0, 0, 702, 0, 811, 0, 0, 0, + 0, 555, 560, -17, -226, 0, -46, 0, 393, 0, + 424, -573, -569, -553, -471, -469, -462, -444, -435, 0, -1042,-1171, 0, 1, 0, 129, 0,-1095, 0, 0, 0, -44, 220, 0, 0, 0, 258,-1073, 0, -273, - -293, 992, 0, 0, 0, -899, 212, 0, 0, -501, - 0, 0, 281, 0, 0, 249, 0, 0, 287, 0, - -579, -976, 0, 0, 0, 0, 0, 382, -13, 0, - 0, 815, 816, 822, 988, -528, 0, 0, -321, 823, + -293, 989, 0, 0, 0, -899, 210, 0, 0, -501, + 0, 0, 277, 0, 0, 249, 0, 0, 287, 0, + -579, -976, 0, 0, 0, 0, 0, 380, -13, 0, + 0, 812, 815, 816, 988, -528, 0, 0, -321, 823, 377, 0,-1327, 0, 0, 0, 0, 0, 0, 0, 0, 182, 0, 0, 0, 0, 0, 0, 0, 0, - 432, 0, 0, 0, 0, -335, 362, 0, 0, 0, + 426, 0, 0, 0, 0, -335, 362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 441, 0, -514, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 201, 0, - 0, 288, 0, 0, 283, 285, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 195, 0, + 0, 283, 0, 0, 284, 293, 219, 0, 0, 0, 0, 0, 0, 0, 0, 511, 0, 0, 0, 0, - -39, 0, 552, -173, 0, 0, 364, 0, 421, 0, - 882, 0, 1204, -286, -265, -56, 947, 0, 524, 0, + -39, 0, 552, -173, 0, 0, 344, 0, 412, 0, + 880, 0, 1204, -286, -265, -56, 947, 0, 521, 0, -30, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -256, 0, 367, 0, -333, 0, -773, 0, 0, - 0, 832, 0, -296, -126, 1012, 0, 917, 0, 1155, - 1368, 1053, 0, 0, 731, 1678, 0, 0, 0, 0, - 1028, 0, 0, 0, 0, 0, -506, 1416, 0, 0, - 0, 0, 0, 1190, 855, 845, 748, 852, 1356, 1358, - 1355, 1357, 1359, 0, 1360, 0, -611, 0, 0, 968, - 1207, -714, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -298, 0, 0, 0, 0, -458, 0, 585, - 0, 487, 0, 573, 0, 0, 0, 646, -534, -5, - -313, -3, 0, 1618, 0, 68, 0, 70, 74, 99, + 0, 832, 0, -296, -126, 1012, 0, 912, 0, 1139, + 1368, 1051, 0, 0, 731, 1676, 0, 0, 0, 0, + 1024, 0, 0, 0, 0, 0, -506, 1414, 0, 0, + 0, 0, 0, 1190, 855, 845, 748, 852, 1352, 1354, + 1355, 1353, 1356, 0, 1357, 0, -611, 0, 0, 963, + 1208, -714, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -298, 0, 0, 0, 0, -458, 0, 581, + 0, 487, 0, 569, 0, 0, 0, 640, -534, -5, + -313, -3, 0, 1611, 0, 68, 0, 70, 74, 99, 125, 142, 149, 156, 157, 163, 171, 0, -674, 0, - -7, 0, 0, 782, 0, 707, 0, 0, 0, 0, - 685, -322, 762, -863, 0, 803, -461, 0, 0, 0, - 0, 0, 0, 708, 0, 0, 701, 0, 0, 0, + -7, 0, 0, 778, 0, 709, 0, 0, 0, 0, + 680, -322, 762, -863, 0, 803, -461, 0, 0, 0, + 0, 0, 0, 703, 0, 0, 707, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 634, 0, 0, 0, 0, 0, 0, 0, - 0, -27, 0, 1274, 0, 0, 0, 876, 0, 0, + 0, -27, 0, 1274, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, -168, 0, 0, 0, 0, 0, - 1374, 1150, 0, 0, 0, 1376, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 517, 0, 0, 0, 0, + 1369, 1150, 0, 0, 0, 1374, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 525, 0, 0, 0, 0, 0, 0, 0, 0, 636, 0, 0, 0, 0, 0, 0, 64, 957, 0, 0, 0, 962, }; @@ -10079,124 +10095,124 @@ void case_982() 476, 292, 538, 192, 786, 562, 115, 319, 257, 712, 406, 514, 576, 830, 831, 549, 601, 1028, 502, 1150, 325, 330, 326, 331, 251, 337, 885, 794, 886, 311, - 800, 258, 1185, 1186, 904, 303, 364, 959, 372, 310, - 335, 14, 544, 356, 629, 312, 924, 314, 115, 782, - 1280, 673, 115, 363, 943, 371, 190, 340, 1033, 485, - 20, 683, 316, 1079, 160, 797, 161, 1287, 1, 1061, - 162, 1063, 259, 916, 818, 1080, 918, 674, 318, 717, - 487, 946, 1174, 1217, 1345, 791, 820, 985, 488, 528, + 800, 258, 1185, 1186, 904, 303, 364, 960, 372, 310, + 335, 14, 544, 356, 630, 312, 924, 314, 115, 782, + 1280, 673, 115, 363, 944, 371, 190, 340, 1033, 485, + 20, 683, 317, 1079, 160, 798, 161, 1287, 1, 1061, + 162, 1063, 259, 916, 818, 1080, 918, 674, 319, 717, + 487, 947, 1174, 1217, 1345, 791, 820, 985, 488, 528, 229, 350, 403, 351, 1080, 163, 1157, 1002, 507, 1481, 1482, 197, 508, 587, 404, 408, 755, 801, 1011, 675, - 288, 1144, 47, 588, 351, 231, 846, 510, 289, 109, - 233, 164, 476, 111, 639, 434, 290, 792, 47, 436, - 1223, 155, 197, 156, 440, 441, 349, 943, 165, 1473, - 1174, 489, 943, 486, 943, 166, 115, 943, 943, 660, - 943, 943, 167, 168, 196, 816, 1514, 1216, 925, 169, - 629, 436, 629, 450, 946, 797, 586, 170, 434, 946, - 2, 946, 943, 1021, 946, 946, 761, 946, 946, 1234, + 288, 1144, 48, 588, 351, 231, 846, 510, 289, 109, + 233, 164, 476, 111, 639, 434, 290, 792, 48, 436, + 1223, 155, 197, 156, 440, 441, 349, 944, 165, 1473, + 1174, 489, 944, 486, 944, 166, 115, 944, 944, 660, + 944, 944, 167, 168, 196, 816, 1514, 1216, 925, 169, + 630, 436, 630, 450, 947, 798, 586, 170, 434, 947, + 2, 947, 944, 1021, 947, 947, 761, 947, 947, 1234, 477, 291, 336, 1387, 350, 1033, 290, 935, 872, 472, - 1353, 481, 260, 819, 735, 720, 482, 451, 577, 946, + 1353, 481, 260, 819, 735, 720, 482, 451, 577, 947, 739, 895, 887, 15, 160, 290, 161, 351, 448, 475, - 162, 821, 576, 676, 480, 1158, 352, 629, 191, 797, - 577, 352, 492, 684, 6, 562, 1455, 943, 511, 1081, + 162, 821, 576, 676, 480, 1158, 353, 630, 191, 798, + 577, 352, 492, 684, 6, 562, 1455, 944, 511, 1081, 512, 1062, 249, 1064, 257, 163, 3, 4, 5, 6, - 366, 291, 524, 537, 257, 657, 1346, 541, 1081, 1224, - 493, 562, 546, 1479, 946, 497, 499, 490, 1474, 543, - 291, 164, 231, 47, 548, 1489, 442, 1490, 1336, 545, - 525, 1204, 1337, 817, 115, 47, 899, 533, 165, 535, + 367, 291, 524, 537, 257, 657, 1346, 541, 1081, 1224, + 493, 562, 546, 1479, 947, 497, 499, 490, 1474, 543, + 291, 164, 231, 48, 548, 1489, 442, 1490, 1336, 545, + 525, 1204, 1337, 817, 115, 48, 899, 533, 165, 535, 691, 250, 534, 497, 513, 166, 568, 16, 722, 536, - 1523, 1093, 167, 168, 959, 551, 552, 1365, 993, 169, - 359, 231, 477, 477, 1076, 1354, 115, 170, 1388, 577, + 1523, 1093, 167, 168, 960, 551, 552, 1365, 993, 169, + 360, 231, 477, 477, 1076, 1354, 115, 170, 1388, 577, 584, 721, 1034, 561, 1036, 563, 806, 1039, 1451, 896, 583, 983, 619, 620, 847, 387, 899, 750, 115, 1103, - 761, 475, 598, 959, 54, 605, 606, 607, 608, 609, - 610, 611, 612, 613, 614, 615, 359, 366, 641, 643, - 642, 644, 647, 1375, 366, 1241, 366, 1131, 366, 249, + 761, 475, 598, 960, 54, 605, 606, 607, 608, 609, + 610, 611, 612, 613, 614, 615, 360, 367, 641, 643, + 642, 644, 647, 1375, 367, 1241, 367, 1131, 367, 249, 1030, 388, 1500, 1417, 233, 1444, 94, 637, 1031, 434, 767, 770, 991, 447, 661, 1310, 357, 1359, 1319, 698, - 436, 1012, 1405, 1406, 844, 1408, 1019, 47, 1000, 1205, - 877, 783, 1520, 802, 901, 804, 1427, 805, 746, 1434, - 997, 94, 366, 1096, 723, 1098, 1099, 261, 250, 2, + 436, 1012, 1405, 1406, 844, 1408, 1019, 48, 1000, 1205, + 877, 783, 1520, 802, 901, 804, 1427, 805, 747, 1434, + 997, 94, 367, 1096, 723, 1098, 1099, 261, 250, 2, 1524, 285, 286, 287, 1450, 293, 294, 472, 655, 701, 307, 308, 20, 710, 358, 718, 845, 315, 1156, 317, 807, 321, 677, 564, 694, 1163, 333, 334, 1472, 577, - 900, 389, 390, 751, 901, 959, 746, 476, 477, 502, - 708, 959, 784, 576, 686, 349, 472, 931, 687, 1188, + 900, 389, 390, 751, 901, 960, 747, 476, 477, 502, + 708, 960, 784, 576, 686, 349, 472, 931, 687, 1188, 370, 892, 839, 711, 699, 760, 42, 48, 231, 769, - 1360, 1068, 352, 349, 813, 737, 231, 598, 231, 745, + 1360, 1068, 353, 349, 813, 737, 231, 598, 231, 745, 115, 6, 436, 658, 659, 359, 768, 771, 992, 671, - 565, 1088, 231, 1089, 752, 754, 642, 453, 1486, 687, - 1317, 642, 1165, 350, 772, 642, 342, 746, 793, 774, - 290, 891, 441, 1320, 577, 759, 1228, 290, 860, 688, - 642, 350, 893, 688, 442, 454, 351, 981, 199, 1496, - 349, 814, 787, 561, 1196, 563, 661, 1497, 290, 741, - 352, 734, 861, 437, 351, 741, 438, 642, 115, 1318, - 1487, 194, 413, 976, 453, 352, 808, 808, 352, 561, - 687, 563, 1321, 231, 661, 291, 642, 413, 1104, 862, - 933, 642, 912, 441, 115, 827, 642, 829, 350, 735, - 642, 1230, 454, 352, 688, 442, 837, 352, 897, 352, - 352, 352, 352, 1017, 741, 642, 734, 352, 1498, 1275, + 565, 1088, 231, 1089, 752, 754, 643, 454, 1486, 688, + 1317, 643, 1165, 350, 772, 643, 343, 747, 793, 774, + 290, 891, 442, 1320, 577, 759, 1228, 290, 860, 688, + 643, 350, 893, 689, 443, 455, 351, 981, 199, 1496, + 349, 814, 787, 561, 1196, 563, 662, 1497, 290, 742, + 352, 735, 861, 437, 351, 742, 438, 643, 115, 1318, + 1487, 194, 413, 976, 454, 353, 808, 808, 352, 561, + 688, 563, 1321, 231, 662, 291, 643, 413, 1104, 862, + 933, 643, 912, 442, 115, 827, 643, 829, 350, 735, + 643, 1230, 455, 353, 689, 443, 837, 353, 897, 353, + 353, 353, 353, 1017, 742, 643, 735, 353, 1498, 1275, 315, 351, 824, 370, 786, 411, 863, 824, 824, 649, - 833, 200, 245, 864, 1007, 352, 246, 342, 194, 194, - 642, 342, 642, 337, 115, 94, 115, 477, 330, 249, - 521, 115, 1261, 351, 330, 414, 1262, 397, 398, 194, - 415, 642, 416, 515, 879, 417, 418, 803, 419, 420, + 833, 200, 245, 864, 1007, 352, 246, 343, 194, 194, + 643, 343, 643, 338, 116, 94, 116, 477, 331, 249, + 521, 116, 1261, 351, 331, 414, 1262, 397, 398, 194, + 415, 643, 416, 515, 879, 417, 418, 803, 419, 420, 414, 1069, 1263, 391, 392, 415, 475, 416, 412, 532, - 417, 418, 883, 419, 420, 342, 247, 859, 249, 337, - 365, 497, 642, 712, 244, 257, 1261, 1072, 250, 1069, - 1262, 337, 541, 330, 337, 337, 745, 662, 907, 366, - 367, 737, 414, 745, 739, 913, 1263, 415, 337, 416, - 884, 350, 417, 418, 640, 419, 420, 937, 641, 368, - 115, 921, 115, 248, 1049, 662, 1341, 250, 657, 939, - 369, 908, 1243, 1260, 351, 421, 926, 927, 640, 1355, - 194, 194, 641, 745, 1264, 919, 1265, 920, 352, 570, + 417, 418, 883, 419, 420, 343, 247, 859, 249, 338, + 365, 497, 643, 712, 244, 257, 1261, 1072, 250, 1069, + 1262, 338, 541, 331, 338, 338, 745, 663, 907, 366, + 367, 737, 414, 746, 739, 913, 1263, 415, 338, 416, + 884, 350, 417, 418, 641, 419, 420, 938, 642, 368, + 115, 921, 115, 248, 1049, 663, 1341, 250, 657, 940, + 369, 908, 1243, 1260, 351, 421, 926, 927, 641, 1355, + 194, 194, 642, 746, 1264, 919, 1265, 920, 352, 570, 431, 869, 1243, 1266, 477, 922, 571, 787, 1373, 262, - 477, 352, 824, 589, 840, 640, 337, 115, 572, 641, - 115, 1267, 337, 590, 1041, 361, 841, 1260, 337, 1243, - 1268, 337, 337, 598, 437, 661, 1114, 838, 1264, 598, - 1265, 824, 650, 745, 318, 337, 1124, 1266, 1115, 225, - 937, 226, 194, 562, 318, 937, 668, 937, 724, 976, - 937, 937, 939, 937, 937, 1267, 984, 939, 350, 939, - 701, 435, 939, 939, 1268, 939, 939, 337, 194, 413, - 745, 350, 1153, 839, 668, 562, 527, 973, 94, 493, - 194, 351, 709, 668, 360, 677, 570, 965, 194, 528, - 1015, 361, 1018, 571, 351, 352, 998, 280, 1020, 280, - 690, 332, 94, 1001, 280, 572, 529, 362, 1187, 1049, - 562, 1361, 352, 1009, 337, 745, 352, 337, 337, 352, - 318, 352, 94, 1029, 753, 361, 352, 933, 1438, 665, - 937, 1215, 194, 693, 321, 194, 399, 694, 665, 342, - 321, 437, 939, 342, 477, 337, 342, 322, 342, 950, - 951, 1053, 414, 342, 318, 364, 824, 415, 824, 416, - 1058, 824, 417, 418, 757, 419, 420, 664, 194, 194, - 393, 394, 757, 1048, 1307, 225, 664, 228, 472, 1160, - 1161, 1307, 44, 451, 395, 396, 400, 342, 1284, 1277, + 477, 353, 824, 589, 840, 641, 338, 115, 572, 642, + 115, 1267, 338, 590, 1041, 361, 841, 1260, 338, 1243, + 1268, 338, 338, 598, 437, 661, 1114, 838, 1264, 598, + 1265, 824, 650, 745, 318, 338, 1124, 1266, 1115, 225, + 938, 226, 194, 562, 318, 938, 669, 938, 724, 976, + 938, 938, 940, 938, 938, 1267, 984, 940, 350, 940, + 701, 435, 940, 940, 1268, 940, 940, 338, 194, 413, + 746, 350, 1153, 839, 669, 562, 527, 973, 94, 493, + 194, 351, 709, 669, 360, 677, 570, 965, 194, 528, + 1015, 361, 1018, 571, 351, 352, 998, 281, 1020, 281, + 690, 332, 94, 1001, 281, 572, 529, 362, 1187, 1049, + 562, 1361, 353, 1009, 338, 745, 353, 338, 338, 353, + 318, 353, 94, 1029, 753, 361, 353, 934, 1438, 666, + 938, 1215, 194, 693, 322, 194, 399, 694, 666, 343, + 322, 437, 940, 343, 477, 338, 343, 323, 343, 950, + 951, 1053, 414, 343, 318, 365, 824, 415, 824, 416, + 1058, 824, 417, 418, 758, 419, 420, 665, 194, 194, + 393, 394, 758, 1048, 1307, 225, 665, 228, 472, 1160, + 1161, 1307, 44, 451, 395, 396, 400, 343, 1284, 1277, 1491, 677, 1169, 113, 401, 727, 194, 194, 1055, 728, - 1056, 501, 1057, 361, 337, 745, 337, 501, 497, 753, - 933, 753, 296, 753, 736, 933, 194, 933, 508, 909, - 933, 933, 402, 933, 933, 337, 337, 1511, 405, 168, - 194, 168, 318, 168, 439, 113, 1529, 1530, 115, 113, - 774, 521, 787, 443, 774, 337, 774, 824, 774, 824, - 824, 763, 1100, 337, 758, 763, 337, 763, 758, 763, - 270, 270, 758, 329, 329, 225, 364, 364, 364, 270, - 364, 364, 753, 364, 330, 364, 446, 330, 753, 473, - 753, 1107, 337, 337, 329, 337, 337, 56, 474, 477, - 502, 335, 493, 415, 701, 415, 502, 64, 64, 65, - 933, 64, 295, 65, 296, 880, 1132, 745, 787, 881, - 471, 231, 822, 762, 415, 415, 822, 364, 1048, 364, - 1143, 495, 364, 826, 233, 493, 1172, 826, 493, 434, - 1027, 1173, 817, 113, 415, 194, 181, 757, 181, 496, - 181, 757, 415, 1136, 1137, 415, 824, 1105, 976, 1106, - 233, 561, 1168, 563, 979, 434, 979, 194, 156, 436, - 156, 765, 115, 765, 493, 163, 115, 163, 517, 115, + 1056, 502, 1057, 361, 338, 745, 338, 502, 497, 754, + 934, 754, 296, 754, 736, 934, 194, 934, 508, 909, + 934, 934, 402, 934, 934, 338, 338, 1511, 405, 169, + 194, 169, 318, 169, 439, 113, 1529, 1530, 115, 113, + 775, 521, 787, 443, 775, 338, 775, 824, 775, 824, + 824, 764, 1100, 338, 759, 764, 338, 764, 759, 764, + 271, 271, 759, 329, 329, 225, 365, 365, 365, 271, + 365, 365, 754, 365, 331, 365, 446, 331, 754, 473, + 754, 1107, 338, 338, 329, 338, 338, 57, 474, 477, + 503, 335, 493, 416, 701, 416, 503, 65, 65, 66, + 934, 65, 295, 66, 296, 880, 1132, 745, 787, 881, + 471, 231, 823, 762, 416, 416, 823, 365, 1048, 365, + 1143, 495, 365, 827, 233, 493, 1172, 827, 493, 434, + 1027, 1173, 817, 113, 416, 194, 182, 758, 182, 496, + 182, 758, 416, 1136, 1137, 416, 824, 1105, 976, 1106, + 233, 561, 1168, 563, 980, 434, 980, 194, 157, 436, + 157, 766, 115, 766, 493, 164, 115, 164, 517, 115, 625, 626, 627, 628, 522, 329, 329, 542, 824, 1100, - 1160, 1161, 1352, 561, 1172, 563, 1201, 231, 337, 1173, - 384, 385, 386, 115, 337, 164, 1352, 164, 115, 890, - 337, 890, 362, 605, 337, 605, 1242, 1259, 67, 1238, - 67, 1173, 555, 187, 1383, 187, 1384, 337, 561, 157, - 563, 157, 120, 523, 120, 824, 1242, 285, 127, 285, - 127, 1173, 292, 115, 292, 526, 452, 329, 351, 443, - 1501, 1502, 547, 824, 581, 493, 194, 525, 525, 337, - 115, 1259, 351, 1242, 642, 642, 1291, 591, 1173, 453, + 1160, 1161, 1352, 561, 1172, 563, 1201, 231, 338, 1173, + 384, 385, 386, 115, 338, 165, 1352, 165, 115, 891, + 338, 891, 362, 606, 338, 606, 1242, 1259, 68, 1238, + 68, 1173, 555, 188, 1383, 188, 1384, 338, 561, 158, + 563, 158, 121, 523, 121, 824, 1242, 286, 128, 286, + 128, 1173, 293, 115, 293, 526, 452, 329, 351, 443, + 1501, 1502, 547, 824, 581, 493, 194, 526, 526, 338, + 115, 1259, 351, 1242, 643, 643, 1291, 591, 1173, 453, 653, 113, 582, 329, 1238, 623, 624, 194, 355, 1148, 1149, 672, 454, 621, 622, 329, 692, 456, 629, 630, 1315, 1316, 457, 329, 458, 459, 460, 461, 656, 695, @@ -10208,571 +10224,571 @@ void case_982() 855, 42, 867, 873, 874, 196, 875, 876, 882, 902, 1362, 898, 817, 903, 905, 910, 914, 194, 915, 929, 923, 945, 947, 329, 329, 701, 701, 940, 701, 952, - 34, 1418, 194, 954, 961, 960, 194, 964, 969, 701, - 971, 966, 701, 977, 963, 989, 359, 990, 1445, 999, + 35, 1418, 194, 954, 961, 960, 194, 964, 969, 701, + 971, 966, 701, 977, 963, 989, 360, 990, 1445, 999, 1006, 329, 329, 1326, 993, 511, 1024, 701, 1013, 1025, - 1038, 1457, 1459, 1042, 1094, 1059, 1065, 1051, 1095, 359, + 1038, 1457, 1459, 1042, 1094, 1059, 1065, 1051, 1095, 360, 1075, 1066, 745, 1077, 1312, 1067, 1087, 1091, 1097, 1109, - 1117, 701, 359, 1113, 493, 1118, 1119, 359, 1445, 1445, - 232, 1116, 359, 194, 359, 359, 359, 359, 1121, 33, - 1122, 1467, 359, 1125, 1135, 1181, 359, 1139, 1138, 1151, - 359, 194, 194, 1146, 373, 1164, 1171, 1198, 359, 1195, - 1203, 359, 1211, 359, 1200, 1206, 1214, 113, 1215, 1218, - 1220, 1225, 585, 1229, 745, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 1445, 1226, 359, 1227, 1233, + 1117, 701, 360, 1113, 493, 1118, 1119, 360, 1445, 1445, + 233, 1116, 360, 194, 360, 360, 360, 360, 1121, 24, + 1122, 1467, 360, 1125, 1135, 1181, 360, 1139, 1138, 1151, + 360, 194, 194, 1146, 373, 1164, 1171, 1198, 360, 1195, + 1203, 360, 1211, 360, 1200, 1206, 1214, 113, 1215, 1218, + 1220, 1225, 586, 1229, 745, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 1445, 1226, 360, 1227, 1233, 1276, 1273, 1293, 1322, 1278, 1281, 1288, 1335, 1314, 1339, 1279, 1340, 1357, 1350, 477, 477, 1349, 1367, 329, 1358, 1369, 745, 1360, 1370, 1372, 1374, 1380, 1376, 194, 1378, 338, 1516, 1516, 1386, 1381, 1397, 1409, 1394, 1525, 1525, 329, 1391, 1398, 598, 598, 113, 1401, 1399, 1428, 194, - 1410, 1483, 31, 359, 1413, 1423, 1430, 194, 1442, 1440, - 1443, 550, 329, 1449, 1488, 585, 1439, 1453, 1464, 1452, - 585, 113, 585, 585, 585, 585, 585, 585, 585, 585, - 585, 585, 585, 1463, 1466, 1469, 1471, 1468, 1477, 1484, - 1493, 1492, 1503, 1495, 585, 1487, 585, 1486, 585, 1509, - 585, 585, 585, 1510, 1531, 1532, 1533, 9, 975, 538, - 606, 860, 496, 616, 617, 618, 585, 861, 550, 550, + 1410, 1504, 32, 360, 1413, 1423, 1430, 194, 1442, 1440, + 1443, 550, 329, 1449, 1488, 586, 1439, 1453, 1464, 1452, + 586, 113, 586, 586, 586, 586, 586, 586, 586, 586, + 586, 586, 586, 1463, 1466, 1469, 1471, 1468, 1477, 1484, + 1493, 1492, 1503, 1495, 586, 1487, 586, 1486, 586, 1509, + 586, 586, 586, 1510, 1531, 1532, 1533, 9, 976, 539, + 607, 861, 497, 616, 617, 618, 586, 862, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, - 550, 550, 550, 550, 967, 497, 453, 34, 607, 29, - 676, 34, 21, 454, 506, 495, 29, 337, 521, 30, - 313, 329, 34, 30, 868, 585, 791, 34, 208, 759, - 767, 34, 768, 96, 34, 827, 760, 828, 792, 664, - 829, 317, 329, 831, 687, 664, 34, 34, 344, 642, - 123, 34, 34, 105, 288, 130, 124, 34, 106, 34, - 34, 34, 34, 289, 131, 642, 230, 34, 53, 21, - 1043, 34, 959, 34, 1290, 1141, 33, 113, 1142, 113, - 33, 1485, 1454, 34, 1282, 34, 34, 857, 34, 1494, - 1470, 33, 34, 1441, 1436, 1329, 33, 870, 986, 987, - 33, 982, 1342, 33, 1527, 988, 1364, 194, 1286, 329, - 550, 1289, 34, 1460, 1458, 33, 33, 1519, 34, 34, - 33, 33, 1465, 1221, 113, 1518, 33, 113, 33, 33, - 33, 33, 329, 1385, 1333, 955, 33, 1005, 1222, 24, - 33, 25, 33, 934, 26, 763, 593, 329, 1078, 27, - 890, 329, 33, 28, 33, 33, 866, 33, 298, 810, - 553, 33, 30, 888, 631, 633, 194, 632, 634, 32, - 780, 635, 928, 636, 33, 1294, 1212, 1208, 34, 31, - 797, 33, 1159, 31, 407, 194, 1071, 1120, 33, 1133, - 36, 1060, 37, 1090, 31, 1128, 38, 32, 1192, 31, - 1126, 1292, 1022, 31, 39, 40, 31, 651, 41, 652, - 836, 322, 1197, 756, 0, 0, 957, 0, 31, 31, - 956, 0, 0, 31, 31, 0, 329, 329, 0, 31, - 0, 31, 31, 31, 31, 0, 0, 290, 0, 31, - 194, 194, 0, 31, 0, 31, 0, 0, 194, 0, - 0, 0, 0, 0, 0, 31, 194, 194, 31, 194, - 31, 0, 0, 0, 31, 1332, 0, 0, 0, 0, - 506, 0, 0, 0, 0, 506, 506, 1332, 0, 194, - 0, 0, 194, 0, 31, 0, 0, 0, 0, 0, - 1332, 31, 323, 329, 0, 0, 0, 0, 506, 0, + 550, 550, 550, 550, 968, 498, 454, 35, 608, 30, + 677, 35, 496, 455, 507, 30, 31, 522, 314, 209, + 31, 329, 35, 792, 768, 586, 869, 35, 97, 769, + 760, 35, 828, 761, 35, 829, 793, 665, 830, 318, + 688, 832, 329, 665, 345, 643, 35, 35, 338, 124, + 106, 35, 35, 643, 289, 131, 125, 35, 107, 35, + 35, 35, 35, 290, 132, 230, 53, 35, 21, 1043, + 1141, 35, 959, 35, 1290, 1142, 24, 113, 1282, 113, + 24, 1485, 1454, 35, 857, 35, 35, 1494, 35, 1441, + 1470, 24, 35, 1329, 1436, 986, 24, 870, 987, 988, + 24, 982, 1342, 24, 1527, 1289, 1364, 194, 1286, 329, + 550, 1519, 35, 1385, 1460, 24, 24, 1465, 35, 35, + 24, 24, 1458, 1221, 113, 1333, 24, 113, 24, 24, + 24, 24, 329, 955, 1518, 1222, 24, 1005, 934, 24, + 24, 25, 24, 810, 26, 763, 593, 329, 1078, 27, + 890, 329, 24, 28, 866, 24, 298, 24, 553, 888, + 631, 24, 30, 632, 634, 633, 194, 928, 635, 32, + 636, 780, 1212, 1208, 33, 1294, 1159, 407, 34, 32, + 797, 24, 1071, 32, 1133, 194, 21, 24, 24, 1120, + 36, 1060, 37, 1090, 32, 1126, 38, 34, 1192, 32, + 1022, 1128, 651, 32, 39, 40, 32, 652, 41, 1292, + 836, 322, 1197, 756, 0, 0, 957, 0, 32, 32, + 956, 0, 0, 32, 32, 0, 329, 329, 0, 32, + 0, 32, 32, 32, 32, 0, 0, 290, 0, 32, + 194, 194, 0, 32, 0, 32, 0, 0, 194, 0, + 0, 0, 0, 0, 0, 32, 194, 194, 32, 194, + 32, 0, 0, 0, 32, 1332, 0, 0, 0, 0, + 507, 0, 0, 0, 0, 507, 507, 1332, 0, 194, + 0, 0, 194, 0, 32, 0, 0, 0, 5, 0, + 1332, 32, 323, 329, 0, 0, 0, 0, 507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1332, - 0, 506, 506, 0, 0, 0, 506, 0, 0, 506, - 0, 506, 329, 506, 506, 506, 506, 0, 0, 0, - 0, 506, 0, 0, 0, 506, 0, 0, 0, 506, - 0, 0, 0, 0, 0, 0, 0, 506, 0, 0, - 506, 0, 506, 506, 0, 113, 0, 0, 506, 0, - 506, 506, 506, 506, 506, 506, 506, 506, 506, 506, - 506, 0, 0, 0, 0, 0, 506, 506, 0, 0, - 0, 506, 506, 0, 506, 506, 506, 506, 506, 506, - 506, 862, 506, 506, 0, 506, 506, 506, 506, 506, - 506, 506, 506, 506, 506, 0, 506, 506, 506, 506, - 506, 506, 506, 506, 506, 506, 506, 506, 506, 506, - 506, 506, 506, 506, 506, 506, 506, 506, 0, 0, - 506, 0, 506, 0, 506, 0, 0, 506, 0, 0, - 0, 0, 0, 506, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 32, 0, 0, 0, 32, 0, - 0, 393, 0, 0, 0, 0, 0, 393, 0, 32, - 0, 0, 0, 0, 32, 0, 0, 0, 32, 113, - 0, 32, 0, 113, 0, 0, 113, 0, 0, 0, - 0, 0, 0, 32, 32, 550, 0, 0, 32, 32, - 0, 0, 329, 393, 32, 0, 32, 32, 32, 32, - 113, 0, 0, 0, 32, 113, 0, 0, 32, 0, - 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 32, 0, 0, 32, 0, 32, 0, 0, 0, 32, + 0, 507, 507, 0, 0, 0, 507, 0, 0, 507, + 0, 507, 329, 507, 507, 507, 507, 0, 0, 0, + 0, 507, 0, 0, 0, 507, 0, 0, 0, 507, + 0, 0, 0, 0, 0, 0, 0, 507, 0, 0, + 507, 0, 507, 507, 0, 113, 0, 0, 507, 0, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 0, 0, 0, 0, 0, 507, 507, 0, 0, + 0, 507, 507, 0, 507, 507, 507, 507, 507, 507, + 507, 863, 507, 507, 0, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 0, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 0, 0, + 507, 0, 507, 0, 507, 0, 0, 507, 0, 0, + 0, 0, 0, 507, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 34, 0, 0, 0, 34, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 0, 0, 0, 0, 34, 0, 0, 0, 34, 113, + 0, 34, 0, 113, 0, 0, 113, 0, 0, 0, + 0, 0, 0, 34, 34, 550, 0, 0, 34, 34, + 0, 0, 329, 0, 34, 0, 34, 34, 34, 34, + 113, 0, 0, 0, 34, 113, 0, 0, 34, 0, + 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 34, 0, 34, 34, 0, 34, 0, 0, 0, 34, + 0, 0, 0, 0, 0, 5, 0, 0, 0, 48, + 113, 0, 0, 0, 0, 0, 0, 0, 786, 34, + 48, 329, 0, 0, 0, 48, 34, 113, 0, 48, + 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, + 329, 0, 0, 0, 48, 48, 0, 0, 0, 48, + 48, 0, 0, 0, 0, 48, 0, 48, 48, 48, + 48, 0, 0, 0, 0, 48, 0, 0, 0, 48, + 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 48, 0, 0, 48, 0, 48, 0, 0, 0, + 48, 0, 0, 0, 0, 329, 329, 0, 0, 0, + 0, 0, 0, 329, 0, 0, 0, 863, 863, 0, + 48, 329, 329, 0, 329, 863, 863, 863, 863, 863, + 0, 863, 863, 0, 863, 863, 863, 863, 863, 863, + 863, 863, 0, 0, 329, 0, 863, 329, 863, 863, + 863, 863, 863, 863, 338, 0, 863, 0, 0, 0, + 863, 863, 0, 863, 863, 863, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 863, 0, 863, 0, 863, + 863, 0, 0, 863, 0, 863, 863, 863, 863, 863, + 863, 863, 863, 863, 863, 863, 863, 0, 863, 0, + 0, 863, 863, 0, 0, 863, 863, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 113, 0, 0, 0, 0, 0, 0, 0, 785, 32, - 0, 329, 0, 0, 0, 32, 32, 113, 330, 0, - 0, 0, 0, 393, 330, 0, 393, 393, 393, 393, - 329, 393, 0, 393, 393, 0, 393, 393, 393, 393, - 393, 0, 393, 393, 393, 393, 0, 393, 393, 393, - 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, - 393, 393, 393, 393, 393, 393, 393, 393, 393, 0, - 0, 0, 0, 330, 0, 393, 0, 0, 393, 0, - 0, 0, 0, 0, 393, 329, 329, 0, 0, 0, - 0, 0, 0, 329, 0, 0, 0, 862, 862, 0, - 0, 329, 329, 0, 329, 862, 862, 862, 862, 862, - 0, 862, 862, 0, 862, 862, 862, 862, 862, 862, - 862, 862, 0, 0, 329, 0, 862, 329, 862, 862, - 862, 862, 862, 862, 337, 0, 862, 0, 0, 0, - 862, 862, 0, 862, 862, 862, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 862, 0, 862, 0, 862, - 862, 0, 0, 862, 0, 862, 862, 862, 862, 862, - 862, 862, 862, 862, 862, 862, 862, 0, 862, 0, - 0, 862, 862, 0, 0, 862, 862, 0, 0, 0, + 863, 863, 863, 863, 863, 0, 0, 0, 863, 863, + 0, 0, 863, 0, 0, 0, 0, 863, 863, 863, + 863, 863, 0, 0, 0, 863, 0, 863, 0, 0, + 0, 0, 0, 863, 863, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 862, 862, 862, 862, 862, 0, 0, 0, 862, 862, - 0, 0, 862, 0, 0, 0, 0, 862, 862, 862, - 862, 862, 0, 0, 0, 862, 0, 862, 0, 0, - 0, 0, 0, 862, 862, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 863, 863, + 863, 863, 0, 863, 786, 786, 0, 0, 0, 0, + 863, 0, 786, 786, 786, 786, 786, 0, 786, 786, + 743, 786, 786, 786, 786, 786, 786, 786, 0, 0, + 0, 0, 0, 786, 0, 786, 786, 786, 786, 786, + 786, 0, 0, 786, 0, 0, 0, 786, 786, 0, + 786, 786, 786, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 786, 0, 786, 0, 786, 786, 0, 0, + 786, 0, 786, 786, 786, 786, 786, 786, 786, 786, + 786, 786, 786, 786, 0, 786, 0, 0, 786, 786, + 0, 0, 786, 786, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 786, 786, 786, + 786, 786, 0, 0, 0, 786, 786, 0, 0, 786, + 0, 0, 0, 0, 786, 786, 786, 786, 786, 0, + 338, 0, 786, 0, 786, 338, 338, 0, 0, 0, + 786, 786, 0, 0, 0, 0, 0, 0, 0, 0, + 331, 0, 0, 0, 0, 0, 0, 0, 338, 0, + 0, 0, 0, 0, 0, 786, 786, 786, 786, 0, + 786, 338, 338, 0, 0, 0, 338, 786, 0, 338, + 0, 338, 0, 338, 338, 338, 338, 0, 0, 0, + 0, 338, 0, 0, 0, 338, 0, 0, 0, 338, + 0, 0, 0, 0, 0, 0, 0, 338, 0, 0, + 338, 0, 338, 338, 0, 0, 0, 0, 338, 0, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 0, 0, 0, 0, 338, 338, 0, 0, + 0, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 0, 338, 338, 0, 0, 338, 338, 338, 338, + 338, 0, 0, 338, 338, 0, 0, 0, 338, 338, + 338, 338, 338, 338, 338, 338, 743, 0, 0, 0, + 368, 743, 743, 0, 0, 0, 0, 338, 0, 0, + 338, 0, 338, 0, 338, 0, 0, 338, 0, 0, + 0, 0, 0, 338, 743, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 743, 743, 0, + 0, 0, 743, 0, 0, 743, 0, 743, 0, 743, + 743, 743, 743, 0, 0, 0, 0, 743, 0, 0, + 0, 743, 0, 0, 0, 743, 0, 0, 0, 0, + 0, 0, 0, 743, 0, 0, 743, 0, 743, 743, + 0, 0, 0, 0, 743, 0, 743, 743, 743, 743, + 743, 743, 743, 743, 743, 743, 743, 0, 0, 0, + 0, 0, 743, 743, 338, 0, 0, 743, 743, 743, + 743, 743, 743, 0, 743, 743, 743, 0, 743, 743, + 0, 0, 743, 743, 743, 743, 331, 0, 0, 743, + 743, 331, 331, 0, 743, 743, 743, 743, 743, 743, + 743, 743, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 743, 331, 0, 743, 0, 743, 0, + 743, 0, 0, 743, 0, 0, 0, 331, 331, 743, + 0, 0, 331, 0, 0, 331, 0, 331, 0, 331, + 331, 331, 331, 0, 0, 0, 0, 331, 0, 0, + 0, 331, 0, 0, 0, 331, 0, 0, 0, 0, + 0, 0, 0, 331, 0, 0, 331, 0, 331, 331, + 0, 0, 0, 0, 331, 0, 331, 331, 331, 331, + 331, 331, 331, 331, 331, 331, 331, 0, 0, 0, + 0, 0, 331, 331, 0, 0, 0, 331, 331, 331, + 331, 331, 331, 0, 331, 331, 331, 0, 331, 331, + 363, 0, 331, 331, 331, 331, 368, 0, 0, 331, + 331, 368, 368, 0, 331, 331, 331, 331, 331, 331, + 331, 331, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 331, 368, 0, 331, 0, 331, 0, + 331, 0, 0, 331, 0, 0, 0, 368, 368, 331, + 0, 0, 368, 0, 0, 368, 0, 368, 0, 368, + 368, 368, 368, 0, 0, 0, 0, 368, 0, 0, + 0, 368, 0, 0, 0, 368, 0, 0, 0, 0, + 0, 0, 0, 368, 0, 0, 368, 0, 368, 368, + 0, 0, 0, 0, 368, 0, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 0, 0, 0, + 338, 0, 368, 368, 0, 0, 338, 368, 368, 0, + 368, 368, 368, 0, 368, 368, 368, 0, 368, 368, + 0, 0, 368, 368, 368, 368, 0, 0, 0, 368, + 368, 0, 0, 0, 368, 368, 368, 368, 368, 368, + 368, 368, 338, 0, 0, 0, 0, 0, 28, 0, + 0, 0, 0, 368, 0, 0, 368, 0, 368, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 368, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 862, 862, - 862, 862, 0, 862, 785, 785, 0, 0, 0, 0, - 862, 0, 785, 785, 785, 785, 785, 0, 785, 785, - 742, 785, 785, 785, 785, 785, 785, 785, 0, 0, - 0, 0, 0, 785, 0, 785, 785, 785, 785, 785, - 785, 0, 0, 785, 0, 0, 0, 785, 785, 0, - 785, 785, 785, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 785, 0, 785, 0, 785, 785, 0, 0, - 785, 0, 785, 785, 785, 785, 785, 785, 785, 785, - 785, 785, 785, 785, 0, 785, 0, 0, 785, 785, - 0, 0, 785, 785, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 785, 785, 785, - 785, 785, 0, 0, 0, 785, 785, 0, 0, 785, - 0, 0, 0, 0, 785, 785, 785, 785, 785, 0, - 337, 0, 785, 0, 785, 337, 337, 0, 0, 0, - 785, 785, 0, 0, 0, 0, 0, 0, 0, 0, - 330, 0, 0, 0, 0, 0, 0, 0, 337, 0, - 0, 0, 0, 0, 0, 785, 785, 785, 785, 0, - 785, 337, 337, 0, 0, 0, 337, 785, 0, 337, - 0, 337, 0, 337, 337, 337, 337, 0, 0, 0, - 0, 337, 0, 0, 0, 337, 0, 0, 0, 337, - 0, 0, 0, 0, 0, 0, 0, 337, 0, 0, - 337, 0, 337, 337, 0, 0, 0, 0, 337, 0, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 0, 0, 0, 0, 337, 337, 0, 0, - 0, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 0, 337, 337, 0, 0, 337, 337, 337, 337, - 337, 0, 0, 337, 337, 0, 0, 0, 337, 337, - 337, 337, 337, 337, 337, 337, 742, 0, 0, 0, - 367, 742, 742, 0, 0, 0, 0, 337, 0, 0, - 337, 0, 337, 0, 337, 0, 0, 337, 0, 0, - 0, 0, 0, 337, 742, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 742, 742, 0, - 0, 0, 742, 0, 0, 742, 0, 742, 0, 742, - 742, 742, 742, 0, 0, 0, 0, 742, 0, 0, - 0, 742, 0, 0, 0, 742, 0, 0, 0, 0, - 0, 0, 0, 742, 0, 0, 742, 0, 742, 742, - 0, 0, 0, 0, 742, 0, 742, 742, 742, 742, - 742, 742, 742, 742, 742, 742, 742, 0, 0, 0, - 0, 0, 742, 742, 337, 0, 0, 742, 742, 742, - 742, 742, 742, 0, 742, 742, 742, 0, 742, 742, - 0, 0, 742, 742, 742, 742, 330, 0, 0, 742, - 742, 330, 330, 0, 742, 742, 742, 742, 742, 742, - 742, 742, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 742, 330, 0, 742, 0, 742, 0, - 742, 0, 0, 742, 0, 0, 0, 330, 330, 742, - 0, 0, 330, 0, 0, 330, 0, 330, 0, 330, - 330, 330, 330, 0, 0, 0, 0, 330, 0, 0, - 0, 330, 0, 0, 0, 330, 0, 0, 0, 0, - 0, 0, 0, 330, 0, 0, 330, 0, 330, 330, - 0, 0, 0, 0, 330, 0, 330, 330, 330, 330, - 330, 330, 330, 330, 330, 330, 330, 0, 0, 0, - 0, 0, 330, 330, 0, 0, 0, 330, 330, 330, - 330, 330, 330, 0, 330, 330, 330, 0, 330, 330, - 362, 0, 330, 330, 330, 330, 367, 0, 0, 330, - 330, 367, 367, 0, 330, 330, 330, 330, 330, 330, - 330, 330, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 330, 367, 0, 330, 0, 330, 0, - 330, 0, 0, 330, 0, 0, 0, 367, 367, 330, - 0, 0, 367, 0, 0, 367, 0, 367, 0, 367, - 367, 367, 367, 0, 0, 0, 0, 367, 0, 0, - 0, 367, 0, 0, 0, 367, 0, 0, 0, 0, - 0, 0, 0, 367, 0, 0, 367, 0, 367, 367, - 0, 0, 0, 0, 367, 0, 367, 367, 367, 367, - 367, 367, 367, 367, 367, 367, 367, 0, 0, 0, - 337, 0, 367, 367, 0, 0, 337, 367, 367, 0, - 367, 367, 367, 0, 367, 367, 367, 0, 367, 367, - 0, 0, 367, 367, 367, 367, 0, 0, 0, 367, - 367, 0, 0, 0, 367, 367, 367, 367, 367, 367, - 367, 367, 337, 0, 0, 0, 0, 0, 27, 0, - 0, 0, 0, 367, 0, 0, 367, 0, 367, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 367, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 337, 0, 0, 0, 0, 337, 0, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 0, 0, 587, 0, 0, 337, 0, 0, - 0, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 0, 337, 337, 0, 0, 337, 337, 337, 337, - 337, 27, 0, 337, 337, 0, 0, 0, 337, 337, - 337, 337, 337, 337, 337, 337, 362, 0, 0, 0, - 0, 0, 362, 0, 0, 0, 0, 337, 0, 0, - 337, 0, 337, 0, 337, 0, 0, 337, 0, 0, - 0, 0, 0, 337, 5, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 587, 362, 0, - 0, 0, 587, 0, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 587, 957, 587, 0, - 587, 0, 587, 587, 587, 0, 0, 0, 0, 362, - 0, 0, 0, 0, 362, 0, 362, 362, 362, 362, - 362, 362, 362, 362, 362, 362, 362, 0, 0, 0, - 0, 0, 0, 362, 0, 0, 0, 362, 362, 0, - 362, 362, 362, 0, 362, 362, 362, 0, 362, 362, - 0, 0, 362, 362, 362, 362, 0, 587, 0, 362, - 362, 0, 0, 0, 362, 362, 362, 362, 362, 362, - 362, 362, 0, 0, 0, 0, 0, 47, 0, 0, - 0, 0, 0, 362, 27, 27, 362, 0, 362, 27, - 0, 0, 0, 27, 0, 27, 0, 0, 27, 362, - 27, 27, 0, 27, 0, 27, 0, 27, 0, 27, - 27, 27, 27, 0, 0, 27, 27, 0, 0, 0, - 7, 27, 0, 27, 27, 27, 0, 0, 27, 27, - 27, 0, 27, 0, 0, 27, 0, 27, 27, 27, - 27, 0, 0, 0, 27, 27, 27, 0, 0, 27, - 27, 27, 0, 0, 0, 0, 0, 0, 27, 27, - 0, 27, 27, 958, 27, 27, 27, 0, 27, 0, - 27, 0, 27, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 27, 0, 0, 0, 0, 27, 0, - 27, 0, 27, 0, 0, 27, 27, 27, 0, 0, - 0, 0, 0, 0, 0, 27, 48, 27, 27, 0, - 0, 5, 27, 27, 0, 47, 0, 0, 27, 0, - 27, 27, 27, 27, 0, 0, 47, 0, 27, 0, - 0, 47, 27, 0, 27, 47, 0, 0, 47, 0, - 0, 0, 0, 0, 27, 0, 27, 27, 0, 27, - 47, 47, 0, 27, 957, 47, 47, 0, 47, 0, - 0, 47, 0, 47, 47, 47, 47, 0, 0, 47, - 0, 47, 0, 27, 47, 47, 0, 47, 47, 27, - 27, 47, 0, 0, 0, 0, 0, 47, 0, 0, - 47, 0, 47, 47, 47, 0, 47, 0, 47, 47, - 0, 0, 0, 0, 47, 0, 47, 47, 47, 47, - 0, 0, 0, 0, 47, 0, 47, 0, 47, 0, - 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 47, 0, 0, 47, 47, 47, 0, 0, 47, 47, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, - 0, 0, 0, 0, 47, 0, 0, 0, 47, 47, - 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 47, 47, 0, 0, 7, 47, 47, - 0, 48, 0, 0, 47, 0, 47, 47, 47, 47, - 0, 0, 48, 0, 47, 0, 0, 48, 47, 0, - 47, 48, 0, 0, 48, 0, 0, 0, 0, 0, - 47, 0, 0, 47, 0, 47, 48, 48, 0, 47, - 958, 48, 48, 0, 47, 0, 0, 48, 0, 48, - 48, 48, 48, 0, 0, 47, 0, 48, 0, 47, - 47, 48, 0, 48, 47, 0, 0, 47, 0, 0, - 0, 0, 0, 48, 0, 0, 48, 0, 48, 47, - 47, 0, 48, 48, 47, 47, 0, 48, 0, 0, - 47, 0, 47, 47, 47, 47, 0, 0, 48, 0, - 47, 0, 48, 48, 47, 0, 47, 48, 0, 0, - 48, 0, 0, 0, 0, 0, 47, 0, 0, 47, - 0, 47, 48, 48, 0, 47, 0, 48, 48, 0, - 0, 0, 0, 48, 0, 48, 48, 48, 48, 0, - 0, 0, 0, 48, 0, 47, 0, 48, 0, 48, + 0, 0, 0, 338, 0, 0, 0, 0, 338, 0, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 0, 0, 588, 0, 0, 338, 0, 0, + 0, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 0, 338, 338, 0, 0, 338, 338, 338, 338, + 338, 33, 0, 338, 338, 0, 0, 0, 338, 338, + 338, 338, 338, 338, 338, 338, 363, 0, 0, 0, + 0, 0, 363, 0, 0, 0, 0, 338, 0, 0, + 338, 0, 338, 0, 338, 0, 0, 338, 0, 0, + 0, 0, 0, 338, 28, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 588, 363, 0, + 0, 0, 588, 0, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 588, 958, 588, 0, + 588, 0, 588, 588, 588, 0, 0, 0, 0, 363, + 0, 0, 0, 0, 363, 0, 363, 363, 363, 363, + 363, 363, 363, 363, 363, 363, 363, 0, 0, 0, + 0, 0, 0, 363, 0, 0, 0, 363, 363, 0, + 363, 363, 363, 0, 363, 363, 363, 0, 363, 363, + 0, 0, 363, 363, 363, 363, 0, 588, 0, 363, + 363, 0, 0, 0, 363, 363, 363, 363, 363, 363, + 363, 363, 0, 0, 0, 0, 0, 48, 0, 0, + 0, 0, 0, 363, 28, 28, 363, 0, 363, 28, + 0, 0, 0, 28, 0, 28, 0, 0, 28, 363, + 28, 28, 0, 28, 0, 28, 0, 28, 0, 28, + 28, 28, 28, 0, 0, 28, 28, 0, 0, 0, + 7, 28, 0, 28, 28, 28, 0, 0, 28, 28, + 28, 0, 28, 0, 0, 28, 0, 28, 28, 28, + 28, 0, 0, 0, 28, 28, 28, 0, 0, 28, + 28, 28, 0, 0, 0, 0, 0, 0, 28, 28, + 0, 28, 28, 959, 28, 28, 28, 0, 33, 0, + 28, 0, 33, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 33, 0, 0, 0, 0, 33, 0, + 28, 0, 33, 0, 0, 33, 28, 28, 0, 0, + 0, 0, 0, 0, 0, 28, 49, 33, 33, 0, + 0, 28, 33, 33, 0, 28, 0, 0, 33, 0, + 33, 33, 33, 33, 0, 0, 28, 0, 33, 0, + 0, 28, 33, 0, 33, 28, 0, 0, 28, 0, + 0, 0, 0, 0, 33, 0, 28, 33, 0, 33, + 28, 28, 0, 33, 958, 28, 28, 0, 48, 0, + 0, 28, 0, 28, 28, 28, 28, 0, 0, 48, + 0, 28, 0, 33, 48, 28, 0, 28, 48, 33, + 33, 48, 0, 0, 0, 0, 0, 28, 0, 0, + 28, 0, 28, 48, 48, 0, 28, 0, 48, 48, + 0, 0, 0, 0, 48, 0, 48, 48, 48, 48, + 0, 0, 0, 0, 48, 0, 28, 0, 48, 0, + 48, 0, 28, 28, 0, 0, 0, 0, 0, 0, + 48, 0, 0, 48, 48, 48, 0, 0, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, - 0, 55, 48, 0, 48, 0, 0, 0, 48, 56, + 0, 0, 0, 0, 48, 0, 0, 0, 48, 48, + 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 48, 48, 0, 0, 7, 48, 48, + 0, 49, 0, 0, 48, 0, 48, 48, 48, 48, + 0, 0, 49, 0, 48, 0, 0, 49, 48, 0, + 48, 49, 0, 0, 49, 0, 0, 0, 0, 0, + 48, 0, 0, 48, 0, 48, 49, 49, 0, 48, + 959, 49, 49, 0, 48, 0, 0, 49, 0, 49, + 49, 49, 49, 0, 0, 48, 0, 49, 0, 48, + 48, 49, 0, 49, 48, 0, 0, 48, 0, 0, + 0, 0, 0, 49, 0, 0, 49, 0, 49, 48, + 48, 0, 49, 49, 48, 48, 0, 49, 0, 0, + 48, 0, 48, 48, 48, 48, 0, 0, 49, 0, + 48, 0, 49, 49, 48, 0, 48, 49, 0, 0, + 49, 0, 0, 0, 0, 0, 48, 0, 0, 48, + 0, 48, 49, 49, 0, 48, 0, 49, 49, 0, + 0, 0, 0, 49, 0, 49, 49, 49, 49, 0, + 0, 0, 0, 49, 0, 48, 0, 49, 0, 49, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, + 0, 55, 49, 0, 49, 0, 0, 0, 49, 56, 24, 57, 25, 0, 0, 26, 58, 0, 59, 60, - 27, 61, 62, 63, 28, 0, 0, 0, 48, 0, + 27, 61, 62, 63, 28, 0, 0, 0, 49, 0, 64, 0, 65, 30, 66, 67, 68, 69, 0, 0, 32, 0, 0, 0, 70, 33, 0, 71, 72, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 0, 36, 0, 37, 74, 0, 0, 38, 0, 75, 76, 77, 78, 79, 80, 39, 40, 81, 82, 41, - 83, 0, 84, 0, 0, 85, 86, 0, 337, 87, - 88, 0, 0, 0, 337, 0, 0, 0, 0, 0, + 83, 0, 84, 0, 0, 85, 86, 0, 338, 87, + 88, 0, 0, 0, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 90, 91, 92, 93, 0, 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, 0, 96, 97, 98, 99, 100, 0, 0, 0, 101, - 337, 102, 0, 0, 0, 0, 0, 103, 104, 0, + 338, 102, 0, 0, 0, 0, 0, 103, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 337, 0, 0, 0, 0, 0, - 337, 0, 105, 106, 107, 108, 0, 0, 0, 0, - 0, 337, 0, 0, 196, 0, 337, 0, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 0, 0, 0, 0, 0, 337, 337, 0, 0, 0, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 0, - 337, 337, 0, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 0, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 0, 508, 0, 0, - 337, 0, 337, 508, 0, 337, 0, 0, 0, 0, - 0, 337, 0, 0, 0, 0, 337, 0, 0, 337, - 0, 337, 337, 0, 0, 0, 337, 337, 0, 0, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 508, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + 0, 0, 0, 0, 338, 0, 0, 0, 0, 0, + 338, 0, 105, 106, 107, 108, 0, 0, 0, 0, + 0, 338, 0, 0, 196, 0, 338, 0, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 0, 0, 0, 0, 0, 338, 338, 0, 0, 0, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 0, + 338, 338, 0, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 338, 0, 338, 338, 338, 338, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 338, 338, 338, 338, 0, 509, 0, 0, + 338, 0, 338, 509, 0, 338, 0, 0, 0, 0, + 0, 338, 0, 0, 0, 0, 338, 0, 0, 338, + 0, 338, 338, 0, 0, 0, 338, 338, 0, 0, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 509, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 337, 337, 0, 0, 0, 0, 0, 0, 337, 0, - 0, 337, 0, 0, 0, 0, 0, 337, 0, 201, - 508, 0, 0, 0, 0, 508, 0, 508, 508, 508, - 508, 508, 508, 508, 508, 508, 508, 508, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 508, 508, - 508, 508, 508, 508, 508, 508, 508, 508, 949, 508, - 508, 202, 508, 508, 508, 508, 508, 508, 508, 508, - 508, 508, 0, 508, 508, 508, 508, 508, 508, 508, - 508, 508, 508, 508, 508, 508, 508, 508, 508, 508, - 508, 508, 508, 508, 508, 0, 504, 0, 0, 0, - 0, 508, 504, 0, 0, 0, 0, 0, 0, 0, - 508, 203, 204, 205, 206, 0, 207, 208, 209, 210, + 338, 338, 0, 0, 0, 0, 0, 0, 338, 0, + 0, 338, 0, 0, 0, 0, 0, 338, 0, 201, + 509, 0, 0, 0, 0, 509, 0, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 950, 509, + 509, 202, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 0, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 0, 505, 0, 0, 0, + 0, 509, 505, 0, 0, 0, 0, 0, 0, 0, + 509, 203, 204, 205, 206, 0, 207, 208, 209, 210, 211, 212, 213, 214, 0, 0, 215, 216, 217, 218, - 219, 220, 221, 222, 0, 0, 0, 0, 504, 0, - 0, 949, 0, 0, 0, 0, 949, 0, 949, 949, - 949, 949, 949, 949, 949, 949, 949, 949, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 949, 0, 949, 0, 949, 0, 949, 949, 949, 504, - 0, 0, 0, 0, 504, 0, 504, 504, 504, 504, - 504, 504, 504, 504, 504, 504, 504, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 504, 504, 0, - 504, 504, 504, 504, 504, 504, 504, 0, 504, 504, - 0, 504, 504, 504, 504, 504, 504, 504, 504, 504, - 504, 949, 504, 504, 504, 504, 504, 504, 504, 504, - 504, 504, 504, 504, 504, 504, 504, 504, 504, 504, - 504, 504, 504, 504, 0, 512, 757, 0, 0, 0, - 504, 512, 0, 504, 0, 24, 0, 25, 0, 504, - 26, 0, 0, 0, 0, 27, 0, 0, 0, 28, - 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, - 0, 0, 0, 0, 0, 32, 0, 512, 0, 0, - 33, 0, 0, 0, 34, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 36, 0, 37, 0, - 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, - 39, 40, 0, 0, 41, 0, 0, 758, 512, 0, - 0, 0, 0, 512, 0, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 0, 0, 0, 0, - 0, 0, 0, 290, 0, 0, 0, 512, 0, 512, - 512, 512, 512, 512, 512, 512, 0, 512, 512, 0, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 0, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 512, 512, 0, 337, 567, 0, 0, 323, 512, - 337, 0, 512, 0, 24, 0, 25, 0, 512, 26, + 219, 220, 221, 222, 0, 0, 0, 0, 505, 0, + 0, 950, 0, 0, 0, 0, 950, 0, 950, 950, + 950, 950, 950, 950, 950, 950, 950, 950, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 394, 0, 0, + 950, 0, 950, 394, 950, 0, 950, 950, 950, 505, + 0, 0, 0, 0, 505, 0, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 505, 505, 394, + 505, 505, 505, 505, 505, 505, 505, 0, 505, 505, + 0, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 950, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 0, 513, 0, 0, 0, 0, + 505, 513, 0, 505, 0, 0, 0, 0, 0, 505, + 0, 0, 0, 0, 331, 0, 0, 0, 0, 394, + 331, 0, 394, 394, 394, 394, 0, 394, 0, 394, + 394, 0, 394, 394, 394, 394, 394, 513, 394, 394, + 394, 394, 0, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 0, 0, 0, 0, 331, + 0, 394, 0, 0, 394, 0, 0, 0, 513, 0, + 394, 0, 0, 513, 0, 513, 513, 513, 513, 513, + 513, 513, 513, 513, 513, 513, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 513, 0, 513, + 513, 513, 513, 513, 513, 513, 0, 513, 513, 0, + 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, + 0, 513, 513, 513, 513, 513, 513, 513, 513, 513, + 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, + 513, 513, 513, 0, 338, 757, 0, 0, 0, 513, + 338, 0, 513, 0, 24, 0, 25, 0, 513, 26, 0, 0, 0, 0, 27, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, - 0, 0, 0, 0, 32, 0, 337, 0, 0, 33, + 0, 0, 0, 0, 32, 0, 338, 0, 0, 33, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 37, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 39, - 40, 0, 0, 41, 0, 0, 322, 337, 0, 0, - 0, 0, 337, 0, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 337, 0, 337, 337, - 337, 337, 337, 337, 337, 0, 337, 337, 0, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 0, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 0, 437, 906, 0, 0, 355, 337, 437, - 0, 337, 0, 24, 0, 25, 0, 337, 26, 0, + 40, 0, 0, 41, 0, 0, 758, 338, 0, 0, + 0, 0, 338, 0, 338, 338, 338, 338, 338, 338, + 338, 338, 338, 338, 338, 0, 0, 0, 0, 0, + 0, 0, 290, 0, 0, 0, 338, 0, 338, 338, + 338, 338, 338, 338, 338, 0, 338, 338, 0, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 0, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 0, 438, 567, 0, 0, 323, 338, 438, + 0, 338, 0, 24, 0, 25, 0, 338, 26, 0, 0, 0, 0, 27, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, - 0, 0, 0, 32, 0, 437, 0, 0, 33, 0, + 0, 0, 0, 32, 0, 438, 0, 0, 33, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 37, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 39, 40, - 0, 0, 41, 0, 0, 322, 437, 0, 0, 0, - 0, 437, 0, 437, 437, 437, 437, 437, 437, 437, - 437, 437, 437, 437, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 437, 0, 437, 437, 437, - 437, 437, 437, 437, 0, 437, 437, 0, 437, 437, - 437, 437, 437, 437, 437, 437, 437, 437, 0, 437, - 437, 437, 437, 437, 437, 437, 437, 437, 437, 437, - 437, 437, 437, 437, 437, 437, 437, 437, 437, 437, - 437, 0, 337, 0, 0, 0, 355, 437, 337, 1052, - 437, 0, 745, 0, 0, 0, 437, 0, 24, 0, + 0, 0, 41, 0, 0, 322, 438, 0, 0, 0, + 0, 438, 0, 438, 438, 438, 438, 438, 438, 438, + 438, 438, 438, 438, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 438, 0, 438, 438, 438, + 438, 438, 438, 438, 0, 438, 438, 0, 438, 438, + 438, 438, 438, 438, 438, 438, 438, 438, 0, 438, + 438, 438, 438, 438, 438, 438, 438, 438, 438, 438, + 438, 438, 438, 438, 438, 438, 438, 438, 438, 438, + 438, 0, 338, 0, 0, 0, 355, 438, 338, 906, + 438, 0, 746, 0, 0, 0, 438, 0, 24, 0, 25, 0, 0, 26, 0, 0, 0, 0, 27, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, - 0, 30, 0, 0, 337, 0, 0, 0, 32, 0, + 0, 30, 0, 0, 338, 0, 0, 0, 32, 0, 0, 0, 0, 33, 0, 0, 0, 34, 0, 0, - 745, 0, 0, 0, 0, 0, 0, 0, 0, 36, + 746, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 37, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 39, 40, 0, 0, 41, 0, 0, - 322, 0, 0, 0, 0, 543, 0, 0, 0, 0, - 0, 543, 0, 337, 0, 0, 0, 0, 0, 337, - 0, 0, 0, 0, 337, 337, 337, 337, 337, 337, - 337, 745, 337, 0, 337, 337, 0, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 543, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 0, 0, 0, 0, 337, 0, 337, 0, 0, 337, - 0, 355, 0, 0, 0, 337, 0, 0, 543, 0, - 0, 0, 0, 543, 0, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 543, 0, 543, - 0, 543, 0, 543, 543, 543, 0, 543, 543, 0, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 358, 0, 0, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 555, 543, 358, 0, 0, 0, 555, 0, 0, - 0, 0, 0, 0, 0, 0, 358, 0, 543, 0, - 0, 358, 0, 0, 231, 0, 358, 0, 358, 358, - 358, 358, 0, 0, 0, 0, 358, 0, 0, 0, - 358, 0, 0, 555, 358, 0, 0, 0, 0, 0, - 0, 0, 358, 0, 0, 358, 0, 358, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 559, - 0, 0, 0, 0, 0, 559, 0, 0, 0, 0, - 0, 358, 0, 0, 555, 0, 0, 0, 0, 555, - 0, 555, 555, 555, 555, 555, 555, 555, 555, 555, - 555, 555, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 559, 0, 555, 0, 555, 0, 555, 0, 555, - 555, 555, 0, 555, 555, 0, 0, 555, 555, 555, - 555, 555, 555, 555, 555, 555, 0, 358, 0, 555, - 555, 555, 555, 555, 555, 555, 555, 0, 0, 0, - 0, 0, 559, 0, 0, 0, 0, 559, 555, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 0, 0, 0, 560, 555, 0, 0, 0, 0, 560, - 0, 559, 0, 559, 0, 559, 0, 559, 559, 559, - 0, 559, 559, 0, 0, 559, 559, 559, 559, 0, - 0, 0, 559, 559, 0, 0, 0, 559, 559, 559, - 559, 559, 559, 559, 559, 560, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 559, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 561, 559, 0, 0, 0, 0, 561, 0, 0, + 322, 0, 0, 0, 0, 544, 0, 0, 0, 0, + 0, 544, 0, 338, 0, 0, 0, 0, 0, 338, + 0, 0, 0, 0, 338, 338, 338, 338, 338, 338, + 338, 746, 338, 0, 338, 338, 0, 338, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 544, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 0, 0, 0, 0, 338, 0, 338, 0, 0, 338, + 0, 355, 0, 0, 0, 338, 0, 0, 544, 0, + 0, 0, 0, 544, 0, 544, 544, 544, 544, 544, + 544, 544, 544, 544, 544, 544, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 544, 0, 544, + 0, 544, 0, 544, 544, 544, 0, 544, 544, 0, + 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, + 359, 0, 0, 544, 544, 544, 544, 544, 544, 544, + 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, + 544, 556, 544, 359, 0, 0, 0, 556, 0, 0, + 0, 0, 0, 0, 0, 0, 359, 0, 544, 0, + 0, 359, 0, 0, 232, 0, 359, 0, 359, 359, + 359, 359, 0, 0, 0, 0, 359, 0, 0, 0, + 359, 0, 0, 556, 359, 0, 0, 0, 0, 0, + 0, 0, 359, 0, 0, 359, 0, 359, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 560, + 0, 0, 0, 0, 0, 560, 0, 0, 0, 0, + 0, 359, 0, 0, 556, 0, 0, 0, 0, 556, + 0, 556, 556, 556, 556, 556, 556, 556, 556, 556, + 556, 556, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 560, 0, 556, 0, 556, 0, 556, 0, 556, + 556, 556, 0, 556, 556, 0, 0, 556, 556, 556, + 556, 556, 556, 556, 556, 556, 0, 359, 0, 556, + 556, 556, 556, 556, 556, 556, 556, 0, 0, 0, + 0, 0, 560, 0, 0, 0, 0, 560, 556, 560, + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, + 0, 0, 0, 561, 556, 0, 0, 0, 0, 561, + 0, 560, 0, 560, 0, 560, 0, 560, 560, 560, + 0, 560, 560, 0, 0, 560, 560, 560, 560, 0, + 0, 0, 560, 560, 0, 0, 0, 560, 560, 560, + 560, 560, 560, 560, 560, 561, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 560, 0, 0, 0, - 0, 560, 0, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 561, 0, 560, 0, 560, 0, 560, - 0, 560, 560, 560, 0, 560, 560, 0, 0, 560, - 560, 560, 560, 0, 0, 0, 560, 560, 0, 564, - 0, 560, 560, 560, 560, 560, 560, 560, 560, 0, - 0, 0, 0, 0, 561, 0, 0, 0, 0, 561, - 560, 561, 561, 561, 561, 561, 561, 561, 561, 561, - 561, 561, 0, 0, 0, 0, 560, 0, 0, 0, - 0, 0, 0, 561, 0, 561, 0, 561, 0, 561, - 561, 561, 0, 561, 561, 0, 0, 561, 561, 561, - 561, 0, 0, 0, 561, 561, 0, 565, 0, 561, - 561, 561, 561, 561, 561, 561, 561, 0, 0, 0, - 0, 0, 564, 0, 0, 0, 0, 564, 561, 564, - 564, 564, 564, 564, 564, 564, 564, 564, 564, 564, - 0, 0, 0, 0, 561, 0, 0, 0, 0, 0, - 0, 564, 0, 564, 0, 564, 0, 564, 564, 564, - 0, 0, 0, 0, 0, 564, 564, 564, 564, 0, - 0, 0, 564, 564, 0, 566, 0, 564, 564, 564, - 564, 564, 564, 564, 564, 0, 0, 0, 0, 0, - 565, 0, 0, 0, 0, 565, 564, 565, 565, 565, - 565, 565, 565, 565, 565, 565, 565, 565, 0, 0, - 0, 0, 564, 0, 0, 0, 0, 0, 0, 565, - 0, 565, 0, 565, 0, 565, 565, 565, 0, 0, - 0, 0, 0, 565, 565, 565, 565, 0, 0, 0, - 565, 565, 0, 567, 0, 565, 565, 565, 565, 565, - 565, 565, 565, 0, 0, 0, 0, 0, 566, 0, - 0, 0, 0, 566, 565, 566, 566, 566, 566, 566, - 566, 566, 566, 566, 566, 566, 0, 0, 0, 0, - 565, 0, 0, 0, 0, 0, 0, 566, 0, 566, - 0, 566, 0, 566, 566, 566, 0, 0, 0, 0, - 0, 566, 566, 566, 566, 0, 0, 0, 566, 566, - 0, 568, 0, 566, 566, 566, 566, 566, 566, 566, - 566, 0, 0, 0, 0, 0, 567, 0, 0, 0, - 0, 567, 566, 567, 567, 567, 567, 567, 567, 567, - 567, 567, 567, 567, 0, 0, 0, 0, 566, 0, - 0, 0, 0, 0, 0, 567, 0, 567, 0, 567, - 0, 567, 567, 567, 0, 0, 0, 0, 0, 567, - 567, 567, 567, 0, 0, 0, 567, 567, 0, 569, - 0, 0, 0, 567, 567, 567, 567, 567, 567, 0, - 0, 0, 0, 0, 568, 0, 0, 0, 0, 568, - 567, 568, 568, 568, 568, 568, 568, 568, 568, 568, - 568, 568, 0, 0, 0, 0, 567, 0, 0, 0, - 0, 0, 0, 568, 0, 568, 0, 568, 0, 568, - 568, 568, 0, 0, 0, 0, 0, 568, 568, 568, - 568, 0, 0, 0, 568, 568, 0, 570, 0, 0, - 0, 568, 568, 568, 568, 568, 568, 0, 0, 0, - 0, 0, 569, 0, 0, 0, 0, 569, 568, 569, - 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, - 0, 0, 0, 0, 568, 0, 0, 0, 0, 0, - 0, 569, 0, 569, 0, 569, 0, 569, 569, 569, - 0, 0, 0, 0, 0, 569, 569, 569, 569, 0, - 0, 0, 569, 569, 0, 571, 0, 0, 0, 569, - 569, 569, 569, 569, 569, 0, 0, 0, 0, 0, - 570, 0, 0, 0, 0, 570, 569, 570, 570, 570, - 570, 570, 570, 570, 570, 570, 570, 570, 0, 0, - 0, 0, 569, 0, 0, 0, 0, 0, 0, 570, - 0, 570, 0, 570, 0, 570, 570, 570, 0, 0, - 0, 0, 0, 570, 570, 570, 570, 0, 0, 0, - 570, 570, 0, 572, 0, 0, 0, 570, 570, 570, - 570, 570, 570, 0, 0, 0, 0, 0, 571, 0, - 0, 0, 0, 571, 570, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 0, 0, 0, 0, - 570, 0, 0, 0, 0, 0, 0, 571, 0, 571, - 0, 571, 0, 571, 571, 571, 0, 0, 0, 0, - 0, 571, 571, 571, 571, 0, 0, 0, 571, 571, - 0, 573, 0, 0, 0, 571, 571, 571, 571, 571, - 571, 0, 0, 0, 0, 0, 572, 0, 0, 0, - 0, 572, 571, 572, 572, 572, 572, 572, 572, 572, - 572, 572, 572, 572, 0, 0, 0, 0, 571, 0, - 0, 0, 0, 0, 0, 572, 0, 572, 0, 572, - 0, 572, 572, 572, 0, 0, 0, 0, 0, 0, - 0, 572, 572, 0, 0, 0, 572, 572, 0, 574, - 0, 0, 0, 0, 0, 572, 572, 572, 572, 0, - 0, 0, 0, 0, 573, 0, 0, 0, 0, 573, - 572, 573, 573, 573, 573, 573, 573, 573, 573, 573, - 573, 573, 0, 0, 0, 0, 572, 0, 0, 0, - 0, 0, 0, 573, 0, 573, 0, 573, 0, 573, - 573, 573, 0, 0, 0, 0, 0, 0, 0, 573, - 573, 0, 0, 0, 573, 573, 0, 575, 0, 0, - 0, 0, 0, 573, 573, 573, 573, 0, 0, 0, - 0, 0, 574, 0, 0, 0, 0, 574, 573, 574, - 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - 0, 0, 0, 0, 573, 0, 0, 0, 0, 0, - 0, 574, 0, 574, 0, 574, 0, 574, 574, 574, - 0, 0, 0, 0, 0, 0, 0, 574, 574, 0, - 0, 0, 574, 574, 0, 576, 0, 0, 0, 0, - 0, 574, 574, 574, 574, 0, 0, 0, 0, 0, - 575, 0, 0, 0, 0, 575, 574, 575, 575, 575, - 575, 575, 575, 575, 575, 575, 575, 575, 0, 0, - 0, 0, 574, 0, 0, 0, 0, 0, 0, 575, - 0, 575, 0, 575, 0, 575, 575, 575, 0, 0, - 0, 0, 0, 0, 0, 575, 575, 0, 0, 0, - 575, 575, 0, 577, 0, 0, 0, 0, 0, 0, - 0, 575, 575, 0, 0, 0, 0, 0, 576, 0, - 0, 0, 0, 576, 575, 576, 576, 576, 576, 576, - 576, 576, 576, 576, 576, 576, 0, 0, 0, 0, - 575, 0, 0, 0, 0, 0, 0, 576, 0, 576, - 0, 576, 0, 576, 576, 576, 0, 0, 0, 0, - 0, 0, 0, 576, 576, 0, 0, 0, 576, 576, - 0, 578, 0, 0, 0, 0, 0, 0, 0, 576, - 576, 0, 0, 0, 0, 0, 577, 0, 0, 0, - 0, 577, 576, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 0, 0, 0, 0, 576, 0, - 0, 0, 0, 0, 0, 577, 0, 577, 0, 577, - 0, 577, 577, 577, 0, 0, 0, 0, 0, 0, - 0, 0, 577, 0, 0, 0, 577, 577, 0, 579, - 0, 0, 0, 0, 0, 0, 0, 577, 577, 0, - 0, 0, 0, 0, 578, 0, 0, 0, 0, 578, - 577, 578, 578, 578, 578, 578, 578, 578, 578, 578, - 578, 578, 0, 0, 0, 0, 577, 0, 0, 0, - 0, 0, 0, 578, 0, 578, 0, 578, 0, 578, - 578, 578, 0, 0, 0, 0, 0, 0, 0, 0, - 578, 0, 0, 0, 578, 578, 0, 580, 0, 0, - 0, 0, 0, 0, 0, 578, 578, 0, 0, 0, - 0, 0, 579, 0, 0, 0, 0, 579, 578, 579, - 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, - 0, 0, 0, 0, 578, 0, 0, 0, 0, 0, - 0, 579, 0, 579, 0, 579, 0, 579, 579, 579, - 0, 0, 0, 0, 0, 0, 0, 0, 579, 0, - 0, 0, 0, 579, 0, 581, 0, 0, 0, 0, - 0, 0, 0, 579, 579, 0, 0, 0, 0, 0, - 580, 0, 0, 0, 0, 580, 579, 580, 580, 580, - 580, 580, 580, 580, 580, 580, 580, 580, 0, 0, - 0, 0, 579, 0, 0, 0, 0, 0, 0, 580, - 0, 580, 0, 580, 0, 580, 580, 580, 0, 0, - 0, 0, 0, 0, 0, 0, 580, 0, 0, 0, - 0, 580, 0, 582, 0, 0, 0, 0, 0, 0, - 0, 580, 580, 0, 0, 0, 0, 0, 581, 0, - 0, 0, 0, 581, 580, 581, 581, 581, 581, 581, - 581, 581, 581, 581, 581, 581, 0, 0, 0, 0, - 580, 0, 0, 0, 0, 0, 0, 581, 0, 581, - 0, 581, 0, 581, 581, 581, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 581, - 0, 583, 0, 0, 0, 0, 0, 0, 0, 581, - 581, 0, 0, 0, 0, 0, 582, 0, 0, 0, - 0, 582, 581, 582, 582, 582, 582, 582, 582, 582, - 582, 582, 582, 582, 0, 0, 0, 0, 581, 0, - 0, 0, 0, 0, 0, 582, 0, 582, 0, 582, - 0, 582, 582, 582, 0, 0, 0, 584, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 582, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 582, 582, 0, - 0, 0, 0, 0, 583, 0, 0, 0, 0, 583, - 582, 583, 583, 583, 583, 583, 583, 583, 583, 583, - 583, 583, 0, 0, 0, 0, 582, 0, 0, 0, - 0, 0, 0, 583, 0, 583, 0, 583, 0, 583, - 583, 583, 0, 0, 0, 0, 337, 0, 0, 0, - 745, 0, 0, 0, 0, 583, 0, 0, 0, 0, - 584, 0, 0, 0, 0, 584, 583, 584, 584, 584, - 584, 584, 584, 584, 584, 584, 584, 584, 583, 0, - 0, 0, 337, 0, 0, 0, 0, 0, 0, 584, - 0, 584, 0, 584, 583, 584, 584, 584, 745, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 584, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 584, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 584, 0, 0, 0, 0, 0, - 0, 337, 0, 0, 0, 0, 0, 337, 0, 0, - 584, 0, 337, 337, 0, 337, 0, 337, 0, 745, - 337, 0, 337, 337, 0, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 0, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 0, 0, - 55, 0, 337, 0, 337, 0, 0, 337, 56, 24, - 57, 25, 0, 337, 26, 58, 0, 59, 60, 27, + 0, 562, 560, 0, 0, 0, 0, 562, 0, 0, + 0, 0, 0, 0, 0, 0, 561, 0, 0, 0, + 0, 561, 0, 561, 561, 561, 561, 561, 561, 561, + 561, 561, 561, 561, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 562, 0, 561, 0, 561, 0, 561, + 0, 561, 561, 561, 0, 561, 561, 0, 0, 561, + 561, 561, 561, 0, 0, 0, 561, 561, 0, 565, + 0, 561, 561, 561, 561, 561, 561, 561, 561, 0, + 0, 0, 0, 0, 562, 0, 0, 0, 0, 562, + 561, 562, 562, 562, 562, 562, 562, 562, 562, 562, + 562, 562, 0, 0, 0, 0, 561, 0, 0, 0, + 0, 0, 0, 562, 0, 562, 0, 562, 0, 562, + 562, 562, 0, 562, 562, 0, 0, 562, 562, 562, + 562, 0, 0, 0, 562, 562, 0, 566, 0, 562, + 562, 562, 562, 562, 562, 562, 562, 0, 0, 0, + 0, 0, 565, 0, 0, 0, 0, 565, 562, 565, + 565, 565, 565, 565, 565, 565, 565, 565, 565, 565, + 0, 0, 0, 0, 562, 0, 0, 0, 0, 0, + 0, 565, 0, 565, 0, 565, 0, 565, 565, 565, + 0, 0, 0, 0, 0, 565, 565, 565, 565, 0, + 0, 0, 565, 565, 0, 567, 0, 565, 565, 565, + 565, 565, 565, 565, 565, 0, 0, 0, 0, 0, + 566, 0, 0, 0, 0, 566, 565, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, 0, 0, + 0, 0, 565, 0, 0, 0, 0, 0, 0, 566, + 0, 566, 0, 566, 0, 566, 566, 566, 0, 0, + 0, 0, 0, 566, 566, 566, 566, 0, 0, 0, + 566, 566, 0, 568, 0, 566, 566, 566, 566, 566, + 566, 566, 566, 0, 0, 0, 0, 0, 567, 0, + 0, 0, 0, 567, 566, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 0, 0, 0, 0, + 566, 0, 0, 0, 0, 0, 0, 567, 0, 567, + 0, 567, 0, 567, 567, 567, 0, 0, 0, 0, + 0, 567, 567, 567, 567, 0, 0, 0, 567, 567, + 0, 569, 0, 567, 567, 567, 567, 567, 567, 567, + 567, 0, 0, 0, 0, 0, 568, 0, 0, 0, + 0, 568, 567, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 0, 0, 0, 0, 567, 0, + 0, 0, 0, 0, 0, 568, 0, 568, 0, 568, + 0, 568, 568, 568, 0, 0, 0, 0, 0, 568, + 568, 568, 568, 0, 0, 0, 568, 568, 0, 570, + 0, 0, 0, 568, 568, 568, 568, 568, 568, 0, + 0, 0, 0, 0, 569, 0, 0, 0, 0, 569, + 568, 569, 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 0, 0, 0, 0, 568, 0, 0, 0, + 0, 0, 0, 569, 0, 569, 0, 569, 0, 569, + 569, 569, 0, 0, 0, 0, 0, 569, 569, 569, + 569, 0, 0, 0, 569, 569, 0, 571, 0, 0, + 0, 569, 569, 569, 569, 569, 569, 0, 0, 0, + 0, 0, 570, 0, 0, 0, 0, 570, 569, 570, + 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, + 0, 0, 0, 0, 569, 0, 0, 0, 0, 0, + 0, 570, 0, 570, 0, 570, 0, 570, 570, 570, + 0, 0, 0, 0, 0, 570, 570, 570, 570, 0, + 0, 0, 570, 570, 0, 572, 0, 0, 0, 570, + 570, 570, 570, 570, 570, 0, 0, 0, 0, 0, + 571, 0, 0, 0, 0, 571, 570, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, 0, 0, + 0, 0, 570, 0, 0, 0, 0, 0, 0, 571, + 0, 571, 0, 571, 0, 571, 571, 571, 0, 0, + 0, 0, 0, 571, 571, 571, 571, 0, 0, 0, + 571, 571, 0, 573, 0, 0, 0, 571, 571, 571, + 571, 571, 571, 0, 0, 0, 0, 0, 572, 0, + 0, 0, 0, 572, 571, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 0, 0, 0, 0, + 571, 0, 0, 0, 0, 0, 0, 572, 0, 572, + 0, 572, 0, 572, 572, 572, 0, 0, 0, 0, + 0, 572, 572, 572, 572, 0, 0, 0, 572, 572, + 0, 574, 0, 0, 0, 572, 572, 572, 572, 572, + 572, 0, 0, 0, 0, 0, 573, 0, 0, 0, + 0, 573, 572, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 0, 0, 0, 0, 572, 0, + 0, 0, 0, 0, 0, 573, 0, 573, 0, 573, + 0, 573, 573, 573, 0, 0, 0, 0, 0, 0, + 0, 573, 573, 0, 0, 0, 573, 573, 0, 575, + 0, 0, 0, 0, 0, 573, 573, 573, 573, 0, + 0, 0, 0, 0, 574, 0, 0, 0, 0, 574, + 573, 574, 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 0, 0, 0, 0, 573, 0, 0, 0, + 0, 0, 0, 574, 0, 574, 0, 574, 0, 574, + 574, 574, 0, 0, 0, 0, 0, 0, 0, 574, + 574, 0, 0, 0, 574, 574, 0, 576, 0, 0, + 0, 0, 0, 574, 574, 574, 574, 0, 0, 0, + 0, 0, 575, 0, 0, 0, 0, 575, 574, 575, + 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, + 0, 0, 0, 0, 574, 0, 0, 0, 0, 0, + 0, 575, 0, 575, 0, 575, 0, 575, 575, 575, + 0, 0, 0, 0, 0, 0, 0, 575, 575, 0, + 0, 0, 575, 575, 0, 577, 0, 0, 0, 0, + 0, 575, 575, 575, 575, 0, 0, 0, 0, 0, + 576, 0, 0, 0, 0, 576, 575, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, 0, 0, + 0, 0, 575, 0, 0, 0, 0, 0, 0, 576, + 0, 576, 0, 576, 0, 576, 576, 576, 0, 0, + 0, 0, 0, 0, 0, 576, 576, 0, 0, 0, + 576, 576, 0, 578, 0, 0, 0, 0, 0, 0, + 0, 576, 576, 0, 0, 0, 0, 0, 577, 0, + 0, 0, 0, 577, 576, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 0, 0, 0, 0, + 576, 0, 0, 0, 0, 0, 0, 577, 0, 577, + 0, 577, 0, 577, 577, 577, 0, 0, 0, 0, + 0, 0, 0, 577, 577, 0, 0, 0, 577, 577, + 0, 579, 0, 0, 0, 0, 0, 0, 0, 577, + 577, 0, 0, 0, 0, 0, 578, 0, 0, 0, + 0, 578, 577, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 0, 0, 0, 0, 577, 0, + 0, 0, 0, 0, 0, 578, 0, 578, 0, 578, + 0, 578, 578, 578, 0, 0, 0, 0, 0, 0, + 0, 0, 578, 0, 0, 0, 578, 578, 0, 580, + 0, 0, 0, 0, 0, 0, 0, 578, 578, 0, + 0, 0, 0, 0, 579, 0, 0, 0, 0, 579, + 578, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 0, 0, 0, 0, 578, 0, 0, 0, + 0, 0, 0, 579, 0, 579, 0, 579, 0, 579, + 579, 579, 0, 0, 0, 0, 0, 0, 0, 0, + 579, 0, 0, 0, 579, 579, 0, 581, 0, 0, + 0, 0, 0, 0, 0, 579, 579, 0, 0, 0, + 0, 0, 580, 0, 0, 0, 0, 580, 579, 580, + 580, 580, 580, 580, 580, 580, 580, 580, 580, 580, + 0, 0, 0, 0, 579, 0, 0, 0, 0, 0, + 0, 580, 0, 580, 0, 580, 0, 580, 580, 580, + 0, 0, 0, 0, 0, 0, 0, 0, 580, 0, + 0, 0, 0, 580, 0, 582, 0, 0, 0, 0, + 0, 0, 0, 580, 580, 0, 0, 0, 0, 0, + 581, 0, 0, 0, 0, 581, 580, 581, 581, 581, + 581, 581, 581, 581, 581, 581, 581, 581, 0, 0, + 0, 0, 580, 0, 0, 0, 0, 0, 0, 581, + 0, 581, 0, 581, 0, 581, 581, 581, 0, 0, + 0, 0, 0, 0, 0, 0, 581, 0, 0, 0, + 0, 581, 0, 583, 0, 0, 0, 0, 0, 0, + 0, 581, 581, 0, 0, 0, 0, 0, 582, 0, + 0, 0, 0, 582, 581, 582, 582, 582, 582, 582, + 582, 582, 582, 582, 582, 582, 0, 0, 0, 0, + 581, 0, 0, 0, 0, 0, 0, 582, 0, 582, + 0, 582, 0, 582, 582, 582, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 582, + 0, 584, 0, 0, 0, 0, 0, 0, 0, 582, + 582, 0, 0, 0, 0, 0, 583, 0, 0, 0, + 0, 583, 582, 583, 583, 583, 583, 583, 583, 583, + 583, 583, 583, 583, 0, 0, 0, 0, 582, 0, + 0, 0, 0, 0, 0, 583, 0, 583, 0, 583, + 0, 583, 583, 583, 0, 0, 0, 585, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 583, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 583, 583, 0, + 0, 0, 0, 0, 584, 0, 0, 0, 0, 584, + 583, 584, 584, 584, 584, 584, 584, 584, 584, 584, + 584, 584, 0, 0, 0, 0, 583, 0, 0, 0, + 0, 0, 0, 584, 0, 584, 0, 584, 0, 584, + 584, 584, 0, 0, 0, 0, 338, 0, 0, 0, + 746, 0, 0, 0, 0, 584, 0, 0, 0, 0, + 585, 0, 0, 0, 0, 585, 584, 585, 585, 585, + 585, 585, 585, 585, 585, 585, 585, 585, 584, 0, + 0, 0, 338, 0, 0, 0, 0, 0, 0, 585, + 0, 585, 0, 585, 584, 585, 585, 585, 746, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 585, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 585, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 585, 0, 0, 0, 0, 0, + 0, 338, 0, 0, 0, 0, 0, 338, 0, 0, + 585, 0, 338, 338, 0, 338, 0, 338, 0, 746, + 338, 0, 338, 338, 0, 338, 338, 338, 338, 338, + 338, 338, 338, 338, 338, 0, 338, 338, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 0, 0, + 55, 0, 338, 0, 338, 0, 0, 338, 56, 24, + 57, 25, 0, 338, 26, 58, 0, 59, 60, 27, 61, 62, 63, 28, 0, 0, 0, 0, 0, 64, 0, 65, 30, 66, 67, 68, 69, 0, 0, 32, 0, 0, 0, 70, 33, 0, 71, 72, 34, 0, @@ -10818,87 +10834,87 @@ void case_982() 0, 0, 101, 0, 102, 0, 0, 0, 0, 0, 103, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 954, 0, 0, 0, 105, 557, 107, 108, 954, - 954, 954, 954, 0, 0, 954, 954, 0, 954, 954, - 954, 954, 954, 954, 954, 0, 0, 0, 0, 0, - 954, 0, 954, 954, 954, 954, 954, 954, 0, 0, - 954, 0, 0, 0, 954, 954, 0, 954, 954, 954, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 954, - 0, 954, 0, 954, 954, 0, 0, 954, 0, 954, - 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, - 954, 0, 954, 0, 0, 954, 954, 0, 0, 954, - 954, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 954, 954, 954, 954, 954, 0, - 0, 0, 954, 0, 0, 0, 954, 0, 0, 0, - 0, 954, 954, 954, 954, 954, 0, 0, 0, 954, - 0, 954, 0, 0, 0, 0, 0, 954, 954, 0, + 0, 955, 0, 0, 0, 105, 557, 107, 108, 955, + 955, 955, 955, 0, 0, 955, 955, 0, 955, 955, + 955, 955, 955, 955, 955, 0, 0, 0, 0, 0, + 955, 0, 955, 955, 955, 955, 955, 955, 0, 0, + 955, 0, 0, 0, 955, 955, 0, 955, 955, 955, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 955, + 0, 955, 0, 955, 955, 0, 0, 955, 0, 955, + 955, 955, 955, 955, 955, 955, 955, 955, 955, 955, + 955, 0, 955, 0, 0, 955, 955, 0, 0, 955, + 955, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 955, 955, 955, 955, 955, 0, + 0, 0, 955, 0, 0, 0, 955, 0, 0, 0, + 0, 955, 955, 955, 955, 955, 0, 0, 0, 955, + 0, 955, 0, 0, 0, 0, 0, 955, 955, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 796, 0, - 0, 0, 954, 954, 954, 954, 796, 796, 796, 796, - 0, 0, 796, 796, 0, 796, 796, 796, 796, 796, - 796, 796, 0, 0, 0, 0, 0, 796, 0, 796, - 796, 796, 796, 796, 796, 0, 0, 796, 0, 0, - 0, 796, 796, 0, 796, 796, 796, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 796, 0, 796, 0, - 796, 796, 0, 0, 796, 0, 796, 796, 796, 796, - 796, 796, 796, 796, 796, 796, 796, 796, 0, 796, - 0, 0, 796, 796, 0, 0, 796, 796, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 797, 0, + 0, 0, 955, 955, 955, 955, 797, 797, 797, 797, + 0, 0, 797, 797, 0, 797, 797, 797, 797, 797, + 797, 797, 0, 0, 0, 0, 0, 797, 0, 797, + 797, 797, 797, 797, 797, 0, 0, 797, 0, 0, + 0, 797, 797, 0, 797, 797, 797, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 797, 0, 797, 0, + 797, 797, 0, 0, 797, 0, 797, 797, 797, 797, + 797, 797, 797, 797, 797, 797, 797, 797, 0, 797, + 0, 0, 797, 797, 0, 0, 797, 797, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 796, 796, 796, 796, 796, 0, 0, 0, 796, - 0, 0, 0, 796, 0, 0, 0, 0, 796, 796, - 796, 796, 796, 0, 0, 0, 796, 0, 796, 0, - 0, 0, 0, 0, 796, 796, 0, 0, 0, 0, + 0, 797, 797, 797, 797, 797, 0, 0, 0, 797, + 0, 0, 0, 797, 0, 0, 0, 0, 797, 797, + 797, 797, 797, 0, 0, 0, 797, 0, 797, 0, + 0, 0, 0, 0, 797, 797, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 743, 0, 0, 0, 796, - 796, 796, 796, 56, 24, 0, 25, 0, 0, 26, - 253, 0, 0, 0, 27, 61, 62, 0, 28, 0, - 0, 174, 0, 174, 64, 0, 174, 30, 0, 0, - 0, 174, 0, 0, 32, 174, 0, 0, 0, 33, - 0, 71, 72, 34, 174, 0, 0, 0, 0, 0, - 0, 174, 0, 0, 0, 36, 174, 37, 74, 0, - 174, 38, 0, 0, 76, 0, 78, 0, 80, 39, - 40, 254, 174, 41, 174, 0, 0, 0, 174, 0, - 86, 0, 0, 87, 88, 0, 174, 174, 0, 0, - 174, 0, 0, 174, 0, 0, 0, 0, 89, 90, + 0, 0, 0, 0, 0, 743, 0, 0, 0, 797, + 797, 797, 797, 56, 24, 0, 25, 0, 0, 26, + 253, 0, 1052, 0, 27, 61, 62, 0, 28, 0, + 0, 24, 0, 25, 64, 0, 26, 30, 0, 0, + 0, 27, 0, 0, 32, 28, 0, 0, 0, 33, + 0, 71, 72, 34, 30, 0, 0, 0, 0, 0, + 0, 32, 0, 0, 0, 36, 33, 37, 74, 0, + 34, 38, 0, 0, 76, 0, 78, 0, 80, 39, + 40, 254, 36, 41, 37, 0, 0, 0, 38, 0, + 86, 0, 0, 87, 88, 0, 39, 40, 0, 0, + 41, 0, 0, 322, 0, 0, 0, 0, 89, 90, 91, 92, 301, 0, 0, 0, 517, 744, 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, - 0, 0, 0, 101, 0, 102, 0, 0, 978, 0, + 0, 0, 0, 101, 0, 102, 0, 0, 0, 0, 0, 103, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 932, 0, 0, 0, 105, 302, 107, 108, 56, 24, 0, 25, 0, 0, 26, 253, 0, 0, - 0, 27, 61, 62, 174, 28, 0, 0, 174, 0, - 174, 64, 0, 174, 30, 0, 0, 0, 174, 0, - 0, 32, 174, 0, 0, 0, 33, 0, 71, 72, - 34, 174, 594, 0, 0, 0, 0, 0, 174, 595, - 0, 0, 36, 174, 37, 74, 0, 174, 38, 0, - 0, 76, 0, 78, 0, 80, 39, 40, 254, 174, - 41, 174, 0, 0, 0, 174, 0, 596, 0, 0, - 87, 88, 0, 174, 174, 0, 0, 174, 0, 0, - 174, 0, 0, 0, 0, 89, 90, 91, 92, 93, + 0, 27, 61, 62, 355, 28, 0, 0, 175, 0, + 175, 64, 0, 175, 30, 0, 0, 0, 175, 0, + 0, 32, 175, 0, 0, 0, 33, 0, 71, 72, + 34, 175, 594, 0, 0, 0, 0, 0, 175, 595, + 0, 0, 36, 175, 37, 74, 0, 175, 38, 0, + 0, 76, 0, 78, 0, 80, 39, 40, 254, 175, + 41, 175, 0, 0, 0, 175, 0, 596, 0, 0, + 87, 88, 0, 175, 175, 0, 0, 175, 0, 0, + 175, 0, 0, 0, 0, 89, 90, 91, 92, 93, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, - 101, 0, 102, 978, 0, 0, 0, 0, 103, 104, + 101, 0, 102, 0, 0, 979, 0, 0, 103, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 936, 0, 0, 0, 105, 106, 107, 108, 56, 24, 0, 25, 0, 0, 26, 253, 0, 0, 0, 27, 61, - 62, 174, 28, 0, 0, 24, 0, 25, 64, 0, - 26, 30, 0, 0, 0, 27, 0, 0, 32, 28, - 0, 0, 0, 33, 0, 71, 72, 34, 30, 0, - 0, 0, 0, 0, 0, 32, 0, 0, 0, 36, - 33, 37, 74, 937, 34, 38, 0, 0, 76, 0, - 78, 0, 80, 39, 40, 254, 36, 41, 37, 0, - 0, 0, 38, 0, 86, 0, 0, 87, 88, 0, - 39, 40, 0, 0, 41, 0, 0, 322, 0, 0, + 62, 175, 28, 0, 0, 175, 0, 175, 64, 0, + 175, 30, 0, 0, 0, 175, 0, 0, 32, 175, + 0, 0, 0, 33, 0, 71, 72, 34, 175, 0, + 0, 0, 0, 0, 0, 175, 0, 0, 0, 36, + 175, 37, 74, 937, 175, 38, 0, 0, 76, 0, + 78, 0, 80, 39, 40, 254, 175, 41, 175, 0, + 0, 0, 175, 0, 86, 0, 0, 87, 88, 0, + 175, 175, 0, 0, 175, 0, 0, 175, 0, 0, 0, 0, 89, 90, 91, 92, 301, 0, 0, 0, 517, 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, - 0, 0, 0, 0, 0, 103, 104, 0, 0, 0, + 979, 0, 0, 0, 0, 103, 104, 0, 0, 0, 0, 0, 0, 56, 24, 0, 25, 0, 0, 26, 253, 0, 0, 0, 27, 61, 62, 0, 28, 0, 105, 302, 107, 108, 64, 0, 0, 30, 0, 0, - 0, 0, 0, 0, 32, 0, 0, 0, 355, 33, + 0, 0, 0, 0, 32, 0, 0, 0, 175, 33, 0, 71, 72, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 37, 74, 0, 0, 38, 0, 0, 76, 0, 78, 0, 80, 39, @@ -10920,7 +10936,7 @@ void case_982() 38, 0, 0, 76, 0, 78, 0, 80, 39, 40, 254, 36, 41, 37, 0, 0, 0, 38, 0, 86, 0, 0, 87, 88, 0, 39, 40, 0, 0, 41, - 0, 0, 519, 0, 0, 0, 0, 89, 90, 91, + 0, 0, 322, 0, 0, 0, 0, 89, 90, 91, 92, 301, 0, 0, 0, 517, 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, 0, 0, 0, 0, 0, @@ -10949,7 +10965,7 @@ void case_982() 33, 37, 74, 0, 34, 38, 0, 0, 76, 0, 78, 0, 80, 39, 40, 254, 36, 41, 37, 0, 0, 0, 38, 0, 86, 0, 0, 87, 88, 0, - 39, 40, 0, 0, 41, 0, 0, 573, 0, 0, + 39, 40, 0, 0, 41, 0, 0, 519, 0, 0, 0, 0, 89, 90, 91, 92, 301, 0, 0, 0, 517, 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, @@ -10965,7 +10981,7 @@ void case_982() 0, 34, 38, 0, 0, 76, 0, 78, 0, 80, 39, 40, 254, 36, 41, 37, 0, 0, 0, 38, 0, 86, 0, 0, 87, 88, 0, 39, 40, 0, - 0, 41, 0, 0, 758, 0, 0, 0, 0, 89, + 0, 41, 0, 0, 573, 0, 0, 0, 0, 89, 90, 91, 92, 301, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, 0, 0, 0, @@ -10973,15 +10989,15 @@ void case_982() 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 309, 0, 0, 0, 105, 302, 107, 108, 56, 24, 0, 25, 0, 0, 26, 253, 0, - 0, 0, 27, 61, 62, 355, 28, 0, 0, 491, - 0, 491, 64, 0, 491, 30, 0, 0, 0, 491, - 0, 0, 32, 491, 0, 0, 0, 33, 0, 71, - 72, 34, 491, 0, 0, 0, 0, 0, 0, 491, - 0, 0, 0, 36, 491, 37, 74, 0, 491, 38, + 0, 0, 27, 61, 62, 355, 28, 0, 0, 24, + 0, 25, 64, 0, 26, 30, 0, 0, 0, 27, + 0, 0, 32, 28, 0, 0, 0, 33, 0, 71, + 72, 34, 30, 0, 0, 0, 0, 0, 0, 32, + 0, 0, 0, 36, 33, 37, 74, 0, 34, 38, 0, 0, 76, 0, 78, 0, 80, 39, 40, 254, - 491, 41, 491, 0, 0, 0, 491, 0, 86, 0, - 0, 87, 88, 0, 491, 491, 0, 0, 491, 0, - 0, 491, 0, 0, 0, 0, 89, 90, 91, 92, + 36, 41, 37, 0, 0, 0, 38, 0, 86, 0, + 0, 87, 88, 0, 39, 40, 0, 0, 41, 0, + 0, 758, 0, 0, 0, 0, 89, 90, 91, 92, 301, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, 0, 0, 0, 0, 0, 103, @@ -10989,14 +11005,14 @@ void case_982() 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 592, 0, 0, 0, 105, 302, 107, 108, 56, 24, 0, 25, 0, 0, 26, 253, 0, 0, 0, 27, - 61, 62, 491, 28, 0, 0, 175, 0, 175, 64, - 0, 175, 30, 0, 0, 0, 175, 0, 0, 32, - 175, 0, 0, 0, 33, 0, 71, 72, 34, 175, - 0, 0, 0, 0, 0, 0, 175, 0, 0, 0, - 36, 175, 37, 74, 0, 175, 38, 0, 0, 76, - 0, 78, 0, 80, 39, 40, 254, 175, 41, 175, - 0, 0, 0, 175, 0, 86, 0, 0, 87, 88, - 0, 175, 175, 0, 0, 175, 0, 0, 175, 0, + 61, 62, 355, 28, 0, 0, 492, 0, 492, 64, + 0, 492, 30, 0, 0, 0, 492, 0, 0, 32, + 492, 0, 0, 0, 33, 0, 71, 72, 34, 492, + 0, 0, 0, 0, 0, 0, 492, 0, 0, 0, + 36, 492, 37, 74, 0, 492, 38, 0, 0, 76, + 0, 78, 0, 80, 39, 40, 254, 492, 41, 492, + 0, 0, 0, 492, 0, 86, 0, 0, 87, 88, + 0, 492, 492, 0, 0, 492, 0, 0, 492, 0, 0, 0, 0, 89, 90, 91, 92, 93, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, @@ -11004,15 +11020,15 @@ void case_982() 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 823, 0, 0, 0, 105, 106, 107, 108, 56, 24, 0, 25, 0, - 0, 26, 253, 0, 0, 0, 27, 61, 62, 175, - 28, 0, 0, 174, 0, 174, 64, 0, 174, 30, - 0, 0, 0, 174, 0, 0, 32, 174, 0, 0, - 0, 33, 0, 71, 72, 34, 174, 0, 0, 0, - 0, 0, 0, 174, 0, 0, 0, 36, 174, 37, - 74, 0, 174, 38, 0, 0, 76, 0, 78, 0, - 80, 39, 40, 254, 174, 41, 174, 0, 0, 0, - 174, 0, 86, 0, 0, 87, 88, 0, 174, 174, - 0, 0, 174, 0, 0, 174, 0, 0, 0, 0, + 0, 26, 253, 0, 0, 0, 27, 61, 62, 492, + 28, 0, 0, 176, 0, 176, 64, 0, 176, 30, + 0, 0, 0, 176, 0, 0, 32, 176, 0, 0, + 0, 33, 0, 71, 72, 34, 176, 0, 0, 0, + 0, 0, 0, 176, 0, 0, 0, 36, 176, 37, + 74, 0, 176, 38, 0, 0, 76, 0, 78, 0, + 80, 39, 40, 254, 176, 41, 176, 0, 0, 0, + 176, 0, 86, 0, 0, 87, 88, 0, 176, 176, + 0, 0, 176, 0, 0, 176, 0, 0, 0, 0, 89, 90, 91, 92, 301, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, 0, 0, @@ -11020,124 +11036,124 @@ void case_982() 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1189, 0, 0, 0, 105, 302, 107, 108, 56, 24, 0, 25, 0, 0, 26, 253, - 0, 0, 0, 27, 61, 62, 174, 28, 0, 0, - 184, 0, 184, 64, 0, 184, 30, 0, 0, 0, - 184, 0, 0, 32, 184, 0, 0, 0, 33, 0, - 71, 72, 34, 184, 0, 0, 0, 0, 0, 0, - 184, 0, 0, 0, 36, 184, 37, 74, 0, 184, + 0, 0, 0, 27, 61, 62, 176, 28, 0, 0, + 175, 0, 175, 64, 0, 175, 30, 0, 0, 0, + 175, 0, 0, 32, 175, 0, 0, 0, 33, 0, + 71, 72, 34, 175, 0, 0, 0, 0, 0, 0, + 175, 0, 0, 0, 36, 175, 37, 74, 0, 175, 38, 0, 0, 76, 0, 78, 0, 80, 39, 40, - 254, 184, 41, 184, 0, 0, 0, 184, 0, 86, - 0, 0, 87, 88, 0, 184, 184, 0, 0, 184, - 0, 0, 184, 0, 0, 0, 0, 89, 90, 91, + 254, 175, 41, 175, 0, 0, 0, 175, 0, 86, + 0, 0, 87, 88, 0, 175, 175, 0, 0, 175, + 0, 0, 175, 0, 0, 0, 0, 89, 90, 91, 92, 301, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, 0, 0, 0, 0, 0, 103, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 610, 0, 0, 0, 105, 302, 107, 108, 610, - 610, 0, 610, 0, 0, 610, 610, 0, 0, 0, - 610, 610, 610, 184, 610, 0, 0, 0, 0, 0, - 610, 0, 0, 610, 0, 0, 0, 0, 0, 0, - 610, 0, 0, 0, 0, 610, 0, 610, 610, 610, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 610, 0, 610, 610, 0, 0, 610, 0, 0, - 610, 0, 610, 0, 610, 610, 610, 610, 0, 610, - 0, 0, 0, 0, 0, 0, 610, 0, 0, 610, - 610, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 610, 610, 610, 610, 610, 0, - 0, 0, 0, 0, 0, 0, 610, 0, 0, 0, - 0, 0, 610, 610, 610, 610, 0, 0, 0, 610, - 0, 610, 0, 0, 0, 0, 0, 610, 610, 0, + 0, 611, 0, 0, 0, 105, 302, 107, 108, 611, + 611, 0, 611, 0, 0, 611, 611, 0, 0, 0, + 611, 611, 611, 175, 611, 0, 0, 185, 0, 185, + 611, 0, 185, 611, 0, 0, 0, 185, 0, 0, + 611, 185, 0, 0, 0, 611, 0, 611, 611, 611, + 185, 0, 0, 0, 0, 0, 0, 185, 0, 0, + 0, 611, 185, 611, 611, 0, 185, 611, 0, 0, + 611, 0, 611, 0, 611, 611, 611, 611, 185, 611, + 185, 0, 0, 0, 185, 0, 611, 0, 0, 611, + 611, 0, 185, 185, 0, 0, 185, 0, 0, 185, + 0, 0, 0, 0, 611, 611, 611, 611, 611, 0, + 0, 0, 0, 0, 0, 0, 611, 0, 0, 0, + 0, 0, 611, 611, 611, 611, 0, 0, 0, 611, + 0, 611, 0, 0, 0, 0, 0, 611, 611, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 500, 0, - 0, 0, 610, 610, 610, 610, 56, 24, 0, 25, + 0, 0, 611, 611, 611, 611, 56, 24, 0, 25, 0, 0, 26, 253, 0, 0, 0, 27, 61, 62, - 0, 28, 0, 0, 0, 0, 0, 64, 0, 0, - 30, 0, 0, 0, 27, 0, 0, 32, 0, 0, - 0, 337, 33, 0, 71, 72, 34, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 27, 36, 0, + 185, 28, 0, 0, 0, 0, 0, 64, 0, 0, + 30, 0, 0, 0, 28, 0, 0, 32, 0, 0, + 0, 338, 33, 0, 71, 72, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 28, 36, 0, 37, 74, 0, 0, 38, 0, 0, 76, 0, 78, - 27, 80, 39, 40, 254, 27, 41, 337, 0, 0, - 27, 0, 27, 27, 27, 27, 0, 0, 27, 0, - 27, 0, 0, 0, 27, 0, 0, 0, 0, 0, - 0, 89, 90, 91, 255, 0, 27, 0, 0, 27, - 0, 27, 0, 95, 0, 0, 0, 0, 0, 0, + 28, 80, 39, 40, 254, 28, 41, 338, 0, 0, + 28, 0, 28, 28, 28, 28, 0, 0, 28, 0, + 28, 0, 0, 0, 28, 0, 0, 0, 0, 0, + 0, 89, 90, 91, 255, 0, 28, 0, 0, 28, + 0, 28, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, - 0, 27, 27, 0, 0, 0, 0, 0, 0, 0, - 337, 337, 337, 337, 745, 0, 0, 337, 337, 105, - 501, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 0, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 0, 48, 0, 48, 0, 48, 337, - 48, 0, 337, 48, 0, 48, 48, 0, 48, 0, - 48, 0, 48, 0, 48, 48, 48, 48, 0, 0, - 48, 48, 0, 0, 0, 0, 48, 48, 48, 48, - 48, 0, 0, 48, 0, 48, 0, 48, 0, 48, - 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, - 48, 48, 0, 0, 48, 48, 48, 0, 0, 0, - 0, 0, 0, 48, 48, 0, 48, 48, 0, 48, - 48, 48, 0, 0, 0, 48, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, + 0, 28, 28, 0, 0, 0, 0, 0, 0, 0, + 338, 338, 338, 338, 746, 0, 0, 338, 338, 105, + 501, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 0, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 338, 0, 49, 0, 49, 0, 49, 338, + 49, 0, 338, 49, 0, 49, 49, 0, 49, 0, + 49, 0, 49, 0, 49, 49, 49, 49, 0, 0, + 49, 49, 0, 0, 0, 0, 49, 49, 49, 49, + 49, 0, 0, 49, 0, 49, 0, 49, 0, 49, + 49, 0, 49, 49, 49, 49, 0, 0, 49, 49, + 49, 49, 0, 0, 49, 49, 49, 0, 0, 0, + 0, 0, 0, 49, 49, 0, 49, 49, 0, 49, + 49, 49, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 48, 0, 48, 48, 47, - 0, 0, 0, 47, 0, 47, 0, 0, 47, 0, - 47, 47, 0, 47, 0, 47, 0, 47, 0, 47, - 47, 47, 47, 0, 0, 47, 47, 0, 0, 0, - 0, 47, 0, 47, 47, 47, 0, 0, 47, 0, - 47, 0, 47, 0, 0, 47, 0, 47, 47, 47, - 47, 48, 0, 0, 47, 47, 47, 0, 0, 47, - 47, 47, 0, 0, 0, 0, 0, 0, 47, 47, - 0, 47, 47, 0, 47, 47, 47, 0, 0, 0, - 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, - 47, 0, 47, 0, 47, 0, 80, 47, 0, 47, - 47, 0, 47, 0, 47, 47, 47, 0, 47, 47, - 47, 47, 0, 0, 47, 47, 0, 0, 0, 0, - 47, 0, 47, 47, 47, 0, 0, 47, 0, 47, - 0, 47, 0, 0, 47, 0, 47, 47, 47, 47, - 0, 0, 0, 47, 47, 47, 47, 0, 47, 47, - 47, 0, 0, 0, 0, 0, 0, 47, 47, 0, - 47, 47, 0, 47, 47, 47, 0, 0, 0, 47, + 0, 0, 0, 0, 0, 49, 0, 49, 49, 48, + 0, 0, 0, 48, 0, 48, 0, 0, 48, 0, + 48, 48, 0, 48, 0, 48, 0, 48, 0, 48, + 48, 48, 48, 0, 0, 48, 48, 0, 0, 0, + 0, 48, 0, 48, 48, 48, 0, 0, 48, 0, + 48, 0, 48, 0, 0, 48, 0, 48, 48, 48, + 48, 49, 0, 0, 48, 48, 48, 0, 0, 48, + 48, 48, 0, 0, 0, 0, 0, 0, 48, 48, + 0, 48, 48, 0, 48, 48, 48, 0, 0, 0, + 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, + 48, 0, 48, 0, 48, 0, 81, 48, 0, 48, + 48, 0, 48, 0, 48, 48, 48, 0, 48, 48, + 48, 48, 0, 0, 48, 48, 0, 0, 0, 0, + 48, 0, 48, 48, 48, 0, 0, 48, 0, 48, + 0, 48, 0, 0, 48, 0, 48, 48, 48, 48, + 0, 0, 0, 48, 48, 48, 48, 0, 48, 48, + 48, 0, 0, 0, 0, 0, 0, 48, 48, 0, + 48, 48, 0, 48, 48, 48, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 48, 0, 47, - 0, 48, 0, 48, 0, 81, 48, 0, 48, 48, - 0, 48, 0, 48, 47, 48, 0, 48, 48, 48, + 0, 0, 0, 0, 0, 0, 0, 49, 0, 48, + 0, 49, 0, 49, 0, 82, 49, 0, 49, 49, + 0, 49, 0, 49, 48, 49, 0, 49, 49, 49, + 49, 0, 0, 49, 49, 0, 0, 0, 0, 49, + 0, 49, 49, 49, 0, 0, 49, 0, 49, 0, + 49, 0, 0, 49, 0, 49, 49, 49, 49, 0, + 0, 0, 49, 49, 49, 48, 0, 49, 49, 49, + 0, 0, 0, 0, 0, 0, 49, 49, 0, 49, + 49, 0, 49, 49, 49, 0, 0, 0, 49, 0, + 0, 0, 0, 48, 0, 0, 0, 48, 0, 48, + 0, 0, 48, 0, 48, 48, 0, 48, 49, 48, + 0, 48, 0, 48, 48, 48, 48, 0, 0, 48, + 48, 0, 0, 49, 0, 48, 0, 48, 48, 48, + 0, 0, 48, 0, 48, 0, 48, 0, 0, 48, + 0, 48, 48, 48, 48, 0, 0, 0, 48, 48, + 48, 0, 0, 48, 48, 48, 0, 0, 0, 0, + 0, 0, 48, 48, 49, 48, 48, 0, 48, 48, + 48, 0, 0, 0, 48, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, + 0, 48, 0, 48, 48, 0, 48, 0, 48, 48, + 215, 48, 0, 48, 0, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 0, 0, 0, 0, 48, - 0, 48, 48, 48, 0, 0, 48, 0, 48, 0, + 0, 48, 48, 48, 0, 0, 48, 0, 48, 338, 48, 0, 0, 48, 0, 48, 48, 48, 48, 0, - 0, 0, 48, 48, 48, 47, 0, 48, 48, 48, - 0, 0, 0, 0, 0, 0, 48, 48, 0, 48, - 48, 0, 48, 48, 48, 0, 0, 0, 48, 0, - 0, 0, 0, 47, 0, 0, 0, 47, 0, 47, - 0, 0, 47, 0, 47, 47, 0, 47, 48, 47, - 0, 47, 0, 47, 47, 47, 47, 0, 0, 47, - 47, 0, 0, 48, 0, 47, 0, 47, 47, 47, - 0, 0, 47, 0, 47, 0, 47, 0, 0, 47, - 0, 47, 47, 47, 47, 0, 0, 0, 47, 47, - 47, 0, 0, 47, 47, 47, 0, 0, 0, 0, - 0, 0, 47, 47, 48, 47, 47, 0, 47, 47, - 47, 0, 0, 0, 47, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, - 0, 47, 0, 47, 47, 0, 47, 0, 47, 47, - 214, 47, 0, 47, 0, 47, 0, 47, 47, 47, - 47, 0, 0, 47, 47, 0, 0, 0, 0, 47, - 0, 47, 47, 47, 0, 0, 47, 0, 47, 337, - 47, 0, 0, 47, 0, 47, 47, 47, 47, 0, - 0, 0, 47, 47, 47, 0, 0, 47, 47, 47, - 47, 0, 337, 0, 0, 0, 47, 47, 0, 47, - 47, 452, 47, 47, 47, 337, 0, 0, 47, 0, - 337, 0, 0, 337, 0, 337, 0, 337, 337, 337, - 337, 0, 0, 0, 453, 337, 0, 0, 47, 337, - 0, 0, 0, 337, 215, 0, 0, 454, 0, 0, - 0, 337, 456, 0, 337, 0, 337, 457, 0, 458, + 0, 0, 48, 48, 48, 0, 0, 48, 48, 48, + 48, 0, 338, 0, 0, 0, 48, 48, 0, 48, + 48, 452, 48, 48, 48, 338, 0, 0, 48, 0, + 338, 0, 0, 338, 0, 338, 0, 338, 338, 338, + 338, 0, 0, 0, 453, 338, 0, 0, 48, 338, + 0, 0, 0, 338, 216, 0, 0, 454, 0, 0, + 0, 338, 456, 0, 338, 0, 338, 457, 0, 458, 459, 460, 461, 0, 0, 0, 0, 462, 0, 0, - 0, 463, 0, 0, 0, 337, 0, 0, 0, 0, - 337, 0, 0, 464, 0, 0, 465, 337, 466, 265, - 0, 337, 0, 0, 47, 56, 24, 0, 25, 0, - 0, 26, 253, 0, 337, 0, 27, 61, 62, 0, + 0, 463, 0, 0, 0, 338, 0, 0, 0, 0, + 338, 0, 0, 464, 0, 0, 465, 338, 466, 266, + 0, 338, 0, 0, 48, 56, 24, 0, 25, 0, + 0, 26, 253, 0, 338, 0, 27, 61, 62, 0, 28, 0, 467, 0, 0, 0, 64, 0, 0, 30, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, - 0, 33, 0, 71, 72, 34, 337, 594, 0, 0, + 0, 33, 0, 71, 72, 34, 338, 594, 0, 0, 0, 0, 0, 0, 595, 0, 0, 36, 0, 37, 74, 0, 0, 38, 0, 0, 76, 0, 78, 0, 80, 39, 40, 254, 0, 41, 0, 0, 1340, 0, @@ -11255,161 +11271,161 @@ void case_982() 91, 92, 93, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, 0, 0, 0, 0, - 0, 103, 104, 0, 0, 0, 0, 0, 0, 77, - 77, 0, 77, 0, 0, 77, 77, 0, 0, 0, - 77, 77, 77, 0, 77, 0, 105, 1044, 107, 108, - 77, 0, 0, 77, 0, 0, 0, 0, 0, 0, - 77, 0, 0, 0, 0, 77, 0, 77, 77, 77, + 0, 103, 104, 0, 0, 0, 0, 0, 0, 78, + 78, 0, 78, 0, 0, 78, 78, 0, 0, 0, + 78, 78, 78, 0, 78, 0, 105, 1044, 107, 108, + 78, 0, 0, 78, 0, 0, 0, 0, 0, 0, + 78, 0, 0, 0, 0, 78, 0, 78, 78, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 77, 0, 77, 77, 0, 0, 77, 0, 0, - 77, 0, 77, 0, 77, 77, 77, 77, 0, 77, - 0, 0, 0, 0, 0, 0, 77, 0, 0, 77, - 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 77, 77, 77, 77, 0, - 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, - 0, 0, 77, 77, 77, 77, 0, 0, 0, 77, - 0, 77, 0, 0, 0, 0, 0, 77, 77, 0, - 0, 0, 0, 0, 0, 135, 135, 0, 135, 0, - 0, 135, 135, 0, 0, 0, 135, 135, 135, 0, - 135, 0, 77, 77, 77, 77, 135, 0, 0, 135, - 0, 0, 0, 0, 0, 0, 135, 0, 0, 0, - 0, 135, 0, 135, 135, 135, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 135, 0, 135, - 135, 0, 0, 135, 0, 0, 135, 0, 135, 0, - 135, 135, 135, 135, 0, 135, 0, 0, 0, 0, - 0, 0, 135, 0, 0, 135, 135, 0, 0, 0, + 0, 78, 0, 78, 78, 0, 0, 78, 0, 0, + 78, 0, 78, 0, 78, 78, 78, 78, 0, 78, + 0, 0, 0, 0, 0, 0, 78, 0, 0, 78, + 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 78, 78, 78, 78, 78, 0, + 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, + 0, 0, 78, 78, 78, 78, 0, 0, 0, 78, + 0, 78, 0, 0, 0, 0, 0, 78, 78, 0, + 0, 0, 0, 0, 0, 136, 136, 0, 136, 0, + 0, 136, 136, 0, 0, 0, 136, 136, 136, 0, + 136, 0, 78, 78, 78, 78, 136, 0, 0, 136, + 0, 0, 0, 0, 0, 0, 136, 0, 0, 0, + 0, 136, 0, 136, 136, 136, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 136, 0, 136, + 136, 0, 0, 136, 0, 0, 136, 0, 136, 0, + 136, 136, 136, 136, 0, 136, 0, 0, 0, 0, + 0, 0, 136, 0, 0, 136, 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 135, 135, 135, 135, 135, 0, 0, 0, 0, 0, - 0, 0, 135, 0, 0, 0, 0, 0, 135, 135, - 135, 135, 0, 0, 0, 135, 0, 135, 0, 0, - 0, 0, 0, 135, 135, 0, 0, 0, 0, 0, + 136, 136, 136, 136, 136, 0, 0, 0, 0, 0, + 0, 0, 136, 0, 0, 0, 0, 0, 136, 136, + 136, 136, 0, 0, 0, 136, 0, 136, 0, 0, + 0, 0, 0, 136, 136, 0, 0, 0, 0, 0, 0, 56, 24, 0, 25, 0, 0, 26, 253, 0, - 0, 0, 27, 61, 62, 0, 28, 0, 135, 135, - 135, 135, 64, 0, 0, 30, 0, 0, 0, 0, - 0, 0, 32, 0, 27, 0, 27, 33, 0, 71, + 0, 0, 27, 61, 62, 0, 28, 0, 136, 136, + 136, 136, 64, 0, 0, 30, 0, 0, 0, 0, + 0, 0, 32, 0, 28, 0, 28, 33, 0, 71, 72, 34, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 36, 0, 37, 74, 27, 0, 38, + 0, 0, 0, 36, 0, 37, 74, 28, 0, 38, 0, 0, 76, 0, 78, 0, 80, 39, 40, 254, - 27, 41, 0, 0, 0, 27, 0, 0, 0, 0, - 27, 0, 27, 27, 27, 27, 0, 0, 0, 0, - 27, 0, 0, 0, 27, 0, 89, 90, 91, 255, - 301, 0, 0, 0, 0, 0, 27, 0, 95, 27, - 0, 27, 0, 0, 97, 98, 99, 100, 0, 0, + 28, 41, 0, 0, 0, 28, 0, 0, 0, 0, + 28, 0, 28, 28, 28, 28, 0, 0, 0, 0, + 28, 0, 0, 0, 28, 0, 89, 90, 91, 255, + 301, 0, 0, 0, 0, 0, 28, 0, 95, 28, + 0, 28, 0, 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, 0, 0, 0, 0, 0, 103, - 104, 0, 0, 0, 0, 27, 0, 0, 0, 0, - 0, 27, 27, 0, 0, 0, 0, 0, 0, 643, - 0, 643, 0, 643, 105, 256, 643, 108, 643, 643, - 0, 643, 0, 643, 0, 643, 0, 643, 643, 643, - 0, 0, 0, 643, 643, 0, 0, 0, 0, 643, - 0, 643, 643, 0, 0, 0, 643, 0, 0, 0, - 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 643, 643, 0, 643, 0, 0, 0, 643, 643, - 0, 0, 0, 0, 0, 0, 643, 643, 56, 24, - 643, 25, 0, 643, 26, 253, 0, 0, 643, 27, + 104, 0, 0, 0, 0, 28, 0, 0, 0, 0, + 0, 28, 28, 0, 0, 0, 0, 0, 0, 644, + 0, 644, 0, 644, 105, 256, 644, 108, 644, 644, + 0, 644, 0, 644, 0, 644, 0, 644, 644, 644, + 0, 0, 0, 644, 644, 0, 0, 0, 0, 644, + 0, 644, 644, 0, 0, 0, 644, 0, 0, 0, + 644, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 644, 644, 0, 644, 0, 0, 0, 644, 644, + 0, 0, 0, 0, 0, 0, 644, 644, 56, 24, + 644, 25, 0, 644, 26, 253, 0, 0, 644, 27, 61, 62, 0, 28, 0, 0, 0, 0, 0, 64, 0, 0, 30, 0, 0, 0, 0, 0, 0, 32, - 643, 643, 0, 0, 33, 0, 71, 72, 34, 0, - 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, + 644, 644, 0, 0, 33, 0, 71, 72, 34, 0, + 0, 0, 0, 644, 0, 0, 0, 0, 0, 0, 36, 0, 37, 74, 0, 0, 38, 0, 0, 76, 0, 78, 0, 80, 39, 40, 254, 0, 41, 0, 0, 84, 0, 0, 0, 0, 0, 0, 24, 0, - 25, 0, 0, 26, 643, 1235, 0, 0, 27, 0, + 25, 0, 0, 26, 644, 1235, 0, 0, 27, 0, 0, 0, 28, 89, 90, 91, 255, 0, 0, 0, - 0, 30, 642, 0, 642, 95, 0, 642, 32, 642, - 642, 0, 642, 33, 642, 1236, 642, 34, 642, 642, - 642, 0, 0, 0, 642, 642, 0, 0, 0, 36, - 642, 37, 642, 642, 0, 38, 1237, 642, 0, 0, - 0, 642, 0, 39, 40, 0, 0, 41, 0, 0, - 322, 105, 256, 642, 0, 642, 0, 0, 0, 642, - 642, 0, 0, 0, 0, 0, 0, 642, 642, 0, - 642, 642, 642, 0, 642, 642, 0, 642, 642, 642, - 642, 0, 642, 0, 642, 0, 642, 642, 642, 0, - 0, 0, 642, 642, 0, 0, 0, 0, 642, 0, - 642, 642, 0, 0, 0, 642, 0, 0, 0, 642, - 0, 0, 0, 0, 642, 0, 0, 0, 0, 0, - 0, 642, 0, 642, 0, 0, 0, 642, 642, 0, - 0, 355, 0, 0, 0, 642, 642, 0, 0, 642, - 0, 0, 642, 0, 24, 0, 25, 642, 0, 26, - 0, 0, 1295, 0, 27, 642, 686, 0, 28, 0, + 0, 30, 643, 0, 643, 95, 0, 643, 32, 643, + 643, 0, 643, 33, 643, 1236, 643, 34, 643, 643, + 643, 0, 0, 0, 643, 643, 0, 0, 0, 36, + 643, 37, 643, 643, 0, 38, 1237, 643, 0, 0, + 0, 643, 0, 39, 40, 0, 0, 41, 0, 0, + 322, 105, 256, 643, 0, 643, 0, 0, 0, 643, + 643, 0, 0, 0, 0, 0, 0, 643, 643, 0, + 643, 643, 643, 0, 643, 643, 0, 643, 643, 643, + 643, 0, 643, 0, 643, 0, 643, 643, 643, 0, + 0, 0, 643, 643, 0, 0, 0, 0, 643, 0, + 643, 643, 0, 0, 0, 643, 0, 0, 0, 643, + 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, + 0, 643, 0, 643, 0, 0, 0, 643, 643, 0, + 0, 355, 0, 0, 0, 643, 643, 0, 0, 643, + 0, 0, 643, 0, 24, 0, 25, 643, 0, 26, + 0, 0, 1295, 0, 27, 643, 686, 0, 28, 0, 687, 1296, 1297, 0, 0, 0, 1298, 30, 0, 0, 0, 0, 1299, 0, 32, 0, 24, 0, 25, 33, 0, 26, 0, 34, 1295, 0, 27, 0, 686, 0, 28, 0, 687, 1296, 1297, 36, 0, 37, 1298, 30, 0, 38, 0, 0, 1299, 0, 32, 0, 0, 39, 40, 33, 0, 41, 0, 34, 1300, 0, 0, 0, - 47, 1301, 47, 642, 0, 47, 0, 36, 0, 37, - 47, 0, 0, 38, 47, 0, 0, 0, 0, 0, - 0, 39, 40, 47, 0, 41, 0, 0, 1300, 0, - 47, 0, 47, 1301, 47, 47, 1302, 47, 0, 47, - 0, 47, 47, 47, 0, 0, 47, 0, 47, 0, - 0, 47, 0, 47, 0, 47, 0, 47, 0, 0, - 47, 0, 47, 0, 0, 47, 47, 47, 0, 47, - 0, 47, 47, 47, 0, 47, 48, 1303, 48, 0, - 47, 48, 0, 47, 0, 47, 48, 0, 0, 47, - 48, 0, 47, 0, 0, 0, 0, 47, 47, 48, - 0, 47, 0, 0, 47, 0, 48, 154, 47, 1303, - 47, 48, 0, 47, 0, 48, 0, 48, 47, 48, - 0, 0, 47, 0, 48, 0, 0, 48, 0, 48, - 0, 47, 0, 48, 0, 0, 48, 154, 47, 0, - 0, 48, 48, 47, 0, 48, 0, 47, 48, 47, - 0, 47, 24, 47, 25, 0, 47, 26, 0, 47, - 0, 47, 27, 0, 0, 47, 28, 0, 47, 0, - 0, 0, 0, 47, 47, 30, 0, 47, 0, 0, - 47, 0, 32, 0, 0, 47, 0, 33, 0, 0, + 48, 1301, 48, 643, 0, 48, 0, 36, 0, 37, + 48, 0, 0, 38, 48, 0, 0, 0, 0, 0, + 0, 39, 40, 48, 0, 41, 0, 0, 1300, 0, + 48, 0, 48, 1301, 48, 48, 1302, 48, 0, 48, + 0, 48, 48, 48, 0, 0, 48, 0, 48, 0, + 0, 48, 0, 48, 0, 48, 0, 48, 0, 0, + 48, 0, 48, 0, 0, 48, 48, 48, 0, 48, + 0, 48, 48, 48, 0, 48, 49, 1303, 49, 0, + 48, 49, 0, 48, 0, 48, 49, 0, 0, 48, + 49, 0, 48, 0, 0, 0, 0, 48, 48, 49, + 0, 48, 0, 0, 48, 0, 49, 155, 48, 1303, + 48, 49, 0, 48, 0, 49, 0, 49, 48, 49, + 0, 0, 48, 0, 49, 0, 0, 49, 0, 49, + 0, 48, 0, 49, 0, 0, 49, 155, 48, 0, + 0, 49, 49, 48, 0, 49, 0, 48, 49, 48, + 0, 48, 24, 48, 25, 0, 48, 26, 0, 48, + 0, 48, 27, 0, 0, 48, 28, 0, 48, 0, + 0, 0, 0, 48, 48, 30, 0, 48, 0, 0, + 48, 0, 32, 0, 0, 48, 0, 33, 0, 0, 0, 34, 0, 570, 0, 0, 0, 24, 0, 25, 571, 0, 26, 36, 0, 37, 0, 27, 0, 38, 0, 28, 572, 0, 0, 29, 0, 39, 40, 0, - 30, 41, 0, 0, 573, 31, 0, 32, 0, 48, - 0, 0, 33, 0, 0, 33, 34, 35, 0, 0, - 0, 0, 0, 0, 0, 0, 33, 0, 36, 0, - 37, 33, 0, 0, 38, 33, 0, 0, 33, 0, - 0, 47, 39, 40, 0, 0, 41, 0, 0, 0, - 33, 33, 0, 0, 0, 33, 33, 0, 0, 0, - 0, 33, 0, 33, 33, 33, 33, 0, 0, 0, - 0, 33, 0, 0, 0, 33, 0, 33, 0, 0, - 0, 0, 0, 0, 0, 574, 0, 33, 0, 33, - 33, 31, 33, 0, 0, 0, 33, 0, 0, 0, - 0, 0, 31, 0, 0, 0, 0, 31, 0, 0, - 0, 31, 0, 0, 31, 0, 33, 0, 0, 0, - 0, 0, 33, 33, 0, 0, 31, 31, 0, 0, - 42, 31, 31, 0, 47, 0, 0, 31, 0, 31, - 31, 31, 31, 0, 0, 47, 0, 31, 0, 0, - 47, 31, 0, 31, 47, 0, 0, 47, 0, 0, - 0, 0, 0, 31, 0, 0, 31, 0, 31, 47, - 47, 0, 31, 0, 47, 47, 0, 47, 0, 0, - 47, 0, 47, 47, 47, 47, 0, 0, 47, 0, - 47, 0, 31, 47, 47, 0, 47, 47, 31, 31, - 47, 0, 0, 0, 0, 0, 47, 0, 0, 47, - 0, 47, 47, 47, 0, 47, 0, 47, 47, 47, - 0, 0, 0, 47, 0, 47, 47, 47, 47, 0, - 0, 0, 0, 47, 0, 47, 0, 47, 0, 47, - 0, 35, 47, 0, 0, 0, 0, 0, 0, 47, - 0, 0, 47, 0, 47, 47, 0, 47, 47, 0, - 47, 0, 0, 0, 0, 47, 0, 47, 47, 47, - 47, 0, 0, 0, 0, 47, 0, 0, 47, 47, - 47, 0, 0, 0, 36, 0, 0, 0, 0, 0, - 0, 47, 0, 47, 47, 47, 47, 0, 47, 0, - 0, 0, 0, 47, 0, 47, 47, 47, 47, 0, - 0, 0, 0, 47, 0, 0, 0, 47, 47, 0, - 47, 0, 47, 47, 0, 0, 196, 0, 0, 47, - 0, 47, 47, 47, 47, 47, 47, 0, 0, 0, - 0, 47, 0, 47, 47, 47, 47, 0, 0, 47, - 0, 47, 0, 0, 0, 47, 47, 0, 47, 0, - 47, 47, 0, 0, 198, 0, 0, 47, 0, 47, - 47, 47, 47, 0, 47, 0, 0, 0, 0, 47, - 0, 47, 47, 47, 47, 0, 0, 0, 0, 47, - 0, 0, 0, 47, 47, 0, 47, 0, 0, 0, - 0, 47, 299, 47, 0, 47, 0, 47, 47, 0, - 47, 0, 47, 0, 0, 0, 0, 47, 0, 47, - 47, 47, 47, 0, 47, 0, 0, 47, 0, 0, - 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, - 300, 452, 47, 47, 0, 0, 47, 47, 47, 47, - 47, 47, 47, 0, 0, 47, 0, 47, 0, 0, - 0, 47, 0, 0, 453, 0, 0, 0, 0, 0, - 0, 452, 47, 47, 47, 47, 47, 454, 47, 0, + 30, 41, 0, 0, 573, 31, 0, 32, 0, 49, + 0, 0, 33, 0, 0, 34, 34, 35, 0, 0, + 0, 0, 0, 0, 0, 0, 34, 0, 36, 0, + 37, 34, 0, 0, 38, 34, 0, 0, 34, 0, + 0, 48, 39, 40, 0, 0, 41, 0, 0, 0, + 34, 34, 0, 0, 0, 34, 34, 0, 0, 0, + 0, 34, 0, 34, 34, 34, 34, 0, 0, 0, + 0, 34, 0, 0, 0, 34, 0, 34, 0, 0, + 0, 0, 0, 0, 0, 574, 0, 34, 0, 34, + 34, 32, 34, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 32, 0, 0, 0, 0, 32, 0, 0, + 0, 32, 0, 0, 32, 0, 34, 0, 0, 0, + 0, 0, 34, 34, 0, 0, 32, 32, 0, 0, + 42, 32, 32, 0, 48, 0, 0, 32, 0, 32, + 32, 32, 32, 0, 0, 48, 0, 32, 0, 0, + 48, 32, 0, 32, 48, 0, 0, 48, 0, 0, + 0, 0, 0, 32, 0, 0, 32, 0, 32, 48, + 48, 0, 32, 0, 48, 48, 0, 48, 0, 0, + 48, 0, 48, 48, 48, 48, 0, 0, 48, 0, + 48, 0, 32, 48, 48, 0, 48, 48, 32, 32, + 48, 0, 0, 0, 0, 0, 48, 0, 0, 48, + 0, 48, 48, 48, 0, 48, 0, 48, 48, 48, + 0, 0, 0, 48, 0, 48, 48, 48, 48, 0, + 0, 0, 0, 48, 0, 48, 0, 48, 0, 48, + 0, 36, 48, 0, 0, 0, 0, 0, 0, 48, + 0, 0, 48, 0, 48, 48, 0, 48, 48, 0, + 48, 0, 0, 0, 0, 48, 0, 48, 48, 48, + 48, 0, 0, 0, 0, 48, 0, 0, 48, 48, + 48, 0, 0, 0, 37, 0, 0, 0, 0, 0, + 0, 48, 0, 48, 48, 48, 48, 0, 48, 0, + 0, 0, 0, 48, 0, 48, 48, 48, 48, 0, + 0, 0, 0, 48, 0, 0, 0, 48, 48, 0, + 48, 0, 48, 48, 0, 0, 197, 0, 0, 48, + 0, 48, 48, 48, 48, 48, 48, 0, 0, 0, + 0, 48, 0, 48, 48, 48, 48, 0, 0, 48, + 0, 48, 0, 0, 0, 48, 48, 0, 48, 0, + 48, 48, 0, 0, 199, 0, 0, 48, 0, 48, + 48, 48, 48, 0, 48, 0, 0, 0, 0, 48, + 0, 48, 48, 48, 48, 0, 0, 0, 0, 48, + 0, 0, 0, 48, 48, 0, 48, 0, 0, 0, + 0, 48, 300, 48, 0, 48, 0, 48, 48, 0, + 48, 0, 48, 0, 0, 0, 0, 48, 0, 48, + 48, 48, 48, 0, 48, 0, 0, 48, 0, 0, + 0, 48, 0, 0, 48, 0, 0, 48, 0, 0, + 301, 452, 48, 48, 0, 0, 48, 48, 48, 48, + 48, 48, 48, 0, 0, 48, 0, 48, 0, 0, + 0, 48, 0, 0, 453, 0, 0, 0, 0, 0, + 0, 452, 48, 48, 48, 48, 48, 454, 48, 0, 0, 455, 456, 0, 0, 0, 0, 457, 0, 458, 459, 460, 461, 0, 453, 0, 0, 462, 0, 0, - 0, 463, 47, 0, 0, 0, 0, 454, 0, 0, + 0, 463, 48, 0, 0, 0, 0, 454, 0, 0, 0, 0, 456, 464, 0, 0, 465, 457, 466, 458, 459, 460, 461, 0, 0, 0, 0, 462, 0, 0, 0, 463, 0, 0, 0, 0, 0, 0, 0, 0, @@ -11579,26 +11595,26 @@ void case_982() 372, 376, 368, 384, 385, 386, 390, 376, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 0, 368, 372, 257, 372, 370, - 418, 261, 367, 372, 0, 368, 368, 373, 372, 370, - 367, 665, 272, 368, 372, 429, 368, 277, 418, 372, - 376, 281, 376, 418, 284, 376, 372, 376, 368, 367, - 372, 368, 686, 372, 368, 376, 296, 297, 367, 315, - 376, 301, 302, 376, 376, 376, 376, 307, 376, 309, - 310, 311, 312, 376, 376, 263, 50, 317, 12, 5, - 958, 321, 852, 323, 1272, 1106, 257, 721, 1106, 723, - 261, 1452, 1415, 333, 1245, 335, 336, 686, 338, 1468, - 1432, 272, 342, 1403, 1398, 1304, 277, 700, 874, 874, - 281, 869, 1316, 284, 1513, 874, 1335, 1146, 1258, 753, - 511, 1270, 362, 1421, 1420, 296, 297, 1507, 368, 369, - 301, 302, 1425, 1203, 768, 1506, 307, 771, 309, 310, - 311, 312, 776, 1360, 1304, 844, 317, 896, 1205, 265, - 321, 267, 323, 817, 270, 532, 369, 791, 1008, 275, - 729, 795, 333, 279, 335, 336, 694, 338, 71, 595, - 335, 342, 288, 726, 399, 401, 1205, 400, 402, 295, - 554, 403, 795, 404, 300, 1279, 1194, 1183, 304, 257, - 581, 362, 1127, 261, 157, 1224, 995, 1071, 369, 1095, - 316, 979, 318, 1022, 272, 1085, 322, 0, 1155, 277, - 1083, 1275, 917, 281, 330, 331, 284, 424, 334, 424, + 418, 261, 368, 372, 0, 368, 370, 372, 367, 418, + 368, 665, 272, 368, 376, 429, 372, 277, 418, 376, + 372, 281, 376, 372, 284, 376, 368, 367, 372, 368, + 368, 372, 686, 376, 367, 315, 296, 297, 373, 376, + 376, 301, 302, 263, 376, 376, 376, 307, 376, 309, + 310, 311, 312, 376, 376, 50, 12, 317, 5, 958, + 1106, 321, 852, 323, 1272, 1106, 257, 721, 1245, 723, + 261, 1452, 1415, 333, 686, 335, 336, 1468, 338, 1403, + 1432, 272, 342, 1304, 1398, 874, 277, 700, 874, 874, + 281, 869, 1316, 284, 1513, 1270, 1335, 1146, 1258, 753, + 511, 1507, 362, 1360, 1421, 296, 297, 1425, 368, 369, + 301, 302, 1420, 1203, 768, 1304, 307, 771, 309, 310, + 311, 312, 776, 844, 1506, 1205, 317, 896, 817, 265, + 321, 267, 323, 595, 270, 532, 369, 791, 1008, 275, + 729, 795, 333, 279, 694, 336, 71, 338, 335, 726, + 399, 342, 288, 400, 402, 401, 1205, 795, 403, 295, + 404, 554, 1194, 1183, 300, 1279, 1127, 157, 304, 257, + 581, 362, 995, 261, 1095, 1224, 367, 368, 369, 1071, + 316, 979, 318, 1022, 272, 1083, 322, 0, 1155, 277, + 917, 1085, 424, 281, 330, 331, 284, 424, 334, 1275, 651, 337, 1167, 530, -1, -1, 850, -1, 296, 297, 849, -1, -1, 301, 302, -1, 870, 871, -1, 307, -1, 309, 310, 311, 312, -1, -1, 363, -1, 317, @@ -11606,7 +11622,7 @@ void case_982() -1, -1, -1, -1, -1, 333, 1295, 1296, 336, 1298, 338, -1, -1, -1, 342, 1304, -1, -1, -1, -1, 256, -1, -1, -1, -1, 261, 262, 1316, -1, 1318, - -1, -1, 1321, -1, 362, -1, -1, -1, -1, -1, + -1, -1, 1321, -1, 362, -1, -1, -1, 0, -1, 1329, 369, 418, 937, -1, -1, -1, -1, 284, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1348, -1, 297, 298, -1, -1, -1, 302, -1, -1, 305, @@ -11624,26 +11640,26 @@ void case_982() 416, -1, 418, -1, 420, -1, -1, 423, -1, -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, -1, -1, -1, 261, -1, - -1, 256, -1, -1, -1, -1, -1, 262, -1, 272, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 272, -1, -1, -1, -1, 277, -1, -1, -1, 281, 1123, -1, 284, -1, 1127, -1, -1, 1130, -1, -1, -1, -1, -1, -1, 296, 297, 896, -1, -1, 301, 302, - -1, -1, 1146, 298, 307, -1, 309, 310, 311, 312, + -1, -1, 1146, -1, 307, -1, 309, 310, 311, 312, 1154, -1, -1, -1, 317, 1159, -1, -1, 321, -1, 323, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 333, -1, -1, 336, -1, 338, -1, -1, -1, 342, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 333, -1, 335, 336, -1, 338, -1, -1, -1, 342, + -1, -1, -1, -1, -1, 257, -1, -1, -1, 261, 1194, -1, -1, -1, -1, -1, -1, -1, 0, 362, - -1, 1205, -1, -1, -1, 368, 369, 1211, 363, -1, - -1, -1, -1, 368, 369, -1, 371, 372, 373, 374, - 1224, 376, -1, 378, 379, -1, 381, 382, 383, 384, - 385, -1, 387, 388, 389, 390, -1, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, - -1, -1, -1, 418, -1, 420, -1, -1, 423, -1, - -1, -1, -1, -1, 429, 1279, 1280, -1, -1, -1, + 272, 1205, -1, -1, -1, 277, 369, 1211, -1, 281, + -1, -1, 284, -1, -1, -1, -1, -1, -1, -1, + 1224, -1, -1, -1, 296, 297, -1, -1, -1, 301, + 302, -1, -1, -1, -1, 307, -1, 309, 310, 311, + 312, -1, -1, -1, -1, 317, -1, -1, -1, 321, + -1, 323, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 333, -1, -1, 336, -1, 338, -1, -1, -1, + 342, -1, -1, -1, -1, 1279, 1280, -1, -1, -1, -1, -1, -1, 1287, -1, -1, -1, 256, 257, -1, - -1, 1295, 1296, -1, 1298, 264, 265, 266, 267, 268, + 362, 1295, 1296, -1, 1298, 264, 265, 266, 267, 268, -1, 270, 271, -1, 273, 274, 275, 276, 277, 278, 279, 280, -1, -1, 1318, -1, 285, 1321, 287, 288, 289, 290, 291, 292, 0, -1, 295, -1, -1, -1, @@ -11777,7 +11793,7 @@ void case_982() 336, -1, 338, 296, 297, -1, 342, -1, 301, 302, -1, -1, -1, -1, 307, -1, 309, 310, 311, 312, -1, -1, -1, -1, 317, -1, 362, -1, 321, -1, - 323, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 323, -1, 368, 369, -1, -1, -1, -1, -1, -1, 333, -1, -1, 336, 257, 338, -1, -1, 261, 342, -1, -1, -1, -1, -1, -1, -1, -1, -1, 272, -1, -1, -1, -1, 277, -1, -1, -1, 281, 362, @@ -11846,32 +11862,32 @@ void case_982() 396, 397, 398, 399, -1, -1, -1, -1, 298, -1, -1, 339, -1, -1, -1, -1, 344, -1, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 368, -1, 370, -1, 372, -1, 374, 375, 376, 339, + -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, + 368, -1, 370, 262, 372, -1, 374, 375, 376, 339, -1, -1, -1, -1, 344, -1, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 367, 368, -1, + -1, -1, -1, -1, -1, -1, -1, 367, 368, 298, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 429, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, -1, 256, 256, -1, -1, -1, - 420, 262, -1, 423, -1, 265, -1, 267, -1, 429, - 270, -1, -1, -1, -1, 275, -1, -1, -1, 279, - -1, -1, -1, -1, -1, -1, -1, -1, 288, -1, - -1, -1, -1, -1, -1, 295, -1, 298, -1, -1, - 300, -1, -1, -1, 304, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 316, -1, 318, -1, - -1, -1, 322, -1, -1, -1, -1, -1, -1, -1, - 330, 331, -1, -1, 334, -1, -1, 337, 339, -1, - -1, -1, -1, 344, -1, 346, 347, 348, 349, 350, + 410, 411, 412, 413, -1, 256, -1, -1, -1, -1, + 420, 262, -1, 423, -1, -1, -1, -1, -1, 429, + -1, -1, -1, -1, 363, -1, -1, -1, -1, 368, + 369, -1, 371, 372, 373, 374, -1, 376, -1, 378, + 379, -1, 381, 382, 383, 384, 385, 298, 387, 388, + 389, 390, -1, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, -1, -1, -1, -1, 418, + -1, 420, -1, -1, 423, -1, -1, -1, 339, -1, + 429, -1, -1, 344, -1, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, - -1, -1, -1, 363, -1, -1, -1, 368, -1, 370, + -1, -1, -1, -1, -1, -1, -1, 368, -1, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, -1, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, -1, 256, 256, -1, -1, 418, 420, + 411, 412, 413, -1, 256, 256, -1, -1, -1, 420, 262, -1, 423, -1, 265, -1, 267, -1, 429, 270, -1, -1, -1, -1, 275, -1, -1, -1, 279, -1, -1, -1, -1, -1, -1, -1, -1, 288, -1, -1, @@ -11882,7 +11898,7 @@ void case_982() 331, -1, -1, 334, -1, -1, 337, 339, -1, -1, -1, -1, 344, -1, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 368, -1, 370, 371, + -1, -1, 363, -1, -1, -1, 368, -1, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, -1, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, @@ -12196,7 +12212,7 @@ void case_982() -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, 417, 418, 419, 420, 264, 265, -1, 267, -1, -1, 270, - 271, -1, -1, -1, 275, 276, 277, -1, 279, -1, + 271, -1, 256, -1, 275, 276, 277, -1, 279, -1, -1, 265, -1, 267, 285, -1, 270, 288, -1, -1, -1, 275, -1, -1, 295, 279, -1, -1, -1, 300, -1, 302, 303, 304, 288, -1, -1, -1, -1, -1, @@ -12207,7 +12223,7 @@ void case_982() 334, -1, -1, 337, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, 367, 368, -1, -1, 371, -1, -1, -1, -1, -1, 377, 378, 379, 380, - -1, -1, -1, 384, -1, 386, -1, -1, 372, -1, + -1, -1, -1, 384, -1, 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, 417, 418, 419, 420, @@ -12223,7 +12239,7 @@ void case_982() 337, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, 371, -1, -1, -1, -1, -1, 377, 378, 379, 380, -1, -1, -1, - 384, -1, 386, 370, -1, -1, -1, -1, 392, 393, + 384, -1, 386, -1, -1, 372, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, 417, 418, 419, 420, 264, 265, -1, @@ -12239,7 +12255,7 @@ void case_982() -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, 367, -1, -1, -1, 371, -1, -1, -1, -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, - -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, + 370, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, 264, 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, -1, 279, -1, 417, 418, 419, 420, 285, -1, -1, 288, -1, -1, @@ -12381,14 +12397,14 @@ void case_982() -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, 417, 418, 419, 420, 264, 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, - 275, 276, 277, 418, 279, -1, -1, -1, -1, -1, - 285, -1, -1, 288, -1, -1, -1, -1, -1, -1, - 295, -1, -1, -1, -1, 300, -1, 302, 303, 304, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 316, -1, 318, 319, -1, -1, 322, -1, -1, - 325, -1, 327, -1, 329, 330, 331, 332, -1, 334, - -1, -1, -1, -1, -1, -1, 341, -1, -1, 344, - 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 275, 276, 277, 418, 279, -1, -1, 265, -1, 267, + 285, -1, 270, 288, -1, -1, -1, 275, -1, -1, + 295, 279, -1, -1, -1, 300, -1, 302, 303, 304, + 288, -1, -1, -1, -1, -1, -1, 295, -1, -1, + -1, 316, 300, 318, 319, -1, 304, 322, -1, -1, + 325, -1, 327, -1, 329, 330, 331, 332, 316, 334, + 318, -1, -1, -1, 322, -1, 341, -1, -1, 344, + 345, -1, 330, 331, -1, -1, 334, -1, -1, 337, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, 371, -1, -1, -1, -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, @@ -12397,7 +12413,7 @@ void case_982() -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, 417, 418, 419, 420, 264, 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, - -1, 279, -1, -1, -1, -1, -1, 285, -1, -1, + 418, 279, -1, -1, -1, -1, -1, 285, -1, -1, 288, -1, -1, -1, 261, -1, -1, 295, -1, -1, -1, 262, 300, -1, 302, 303, 304, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 284, 316, -1, @@ -12764,7 +12780,7 @@ void case_982() -1, -1, 362, }; -#line 6655 "cs-parser.jay" +#line 6665 "cs-parser.jay" // // A class used to hold info about an operator declarator @@ -13100,6 +13116,10 @@ void Error_SyntaxError (int error_code, int token, string msg) // An error message has been reported by tokenizer if (token == Token.ERROR) return; + + // Avoid duplicit error message after unterminated string literals + if (token == Token.LITERAL && lexer.Location.Column == 0) + return; string symbol = GetSymbolName (token); string expecting = GetExpecting (); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay index bfe292aca8..53e5aaae46 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay @@ -538,6 +538,15 @@ namespace_declaration current_container = current_namespace = current_namespace.Parent; } + | opt_attributes NAMESPACE namespace_name + { + report.Error (1514, lexer.Location, "Unexpected symbol `{0}', expecting `.' or `{{'", GetSymbolName (yyToken)); + + var name = (MemberName) $3; + var ns = new NamespaceContainer (name, current_namespace); + lbag.AddLocation (current_container, GetLocation ($2)); + current_namespace.AddTypeContainer (ns); + } ; namespace_name @@ -1737,7 +1746,7 @@ indexer_declaration { valid_param_mod = ParameterModifierType.Params | ParameterModifierType.DefaultValue; } - opt_formal_parameter_list CLOSE_BRACKET OPEN_BRACE + opt_formal_parameter_list CLOSE_BRACKET { valid_param_mod = 0; var type = (FullNamedExpression) $3; @@ -1746,7 +1755,7 @@ indexer_declaration current_property = indexer; current_type.AddIndexer (indexer); - lbag.AddMember (current_property, GetModifierLocations (), GetLocation ($5), GetLocation ($8), GetLocation ($9)); + lbag.AddMember (current_property, GetModifierLocations (), GetLocation ($5), GetLocation ($8)); if (type.Type != null && type.Type.Kind == MemberKind.Void) report.Error (620, GetLocation ($3), "`{0}': indexer return type cannot be `void'", indexer.GetSignatureForError ()); @@ -1762,7 +1771,7 @@ indexer_declaration lexer.PropertyParsing = true; } - accessor_declarations + OPEN_BRACE accessor_declarations { lexer.PropertyParsing = false; } @@ -1774,7 +1783,7 @@ indexer_declaration if (doc_support) current_property.DocComment = ConsumeStoredComment (); - lbag.AppendToMember (current_property, GetLocation ($12)); + lbag.AppendToMember (current_property, GetLocation ($10), GetLocation ($13)); current_property = null; } ; @@ -3348,7 +3357,8 @@ argument_list } | argument_list COMMA error { - lexer.putback (')'); // TODO: Wrong but what can I do + if (lexer.putback_char == -1) + lexer.putback (')'); // TODO: Wrong but what can I do Error_SyntaxError (yyToken); $$ = $1; } @@ -6987,6 +6997,10 @@ void Error_SyntaxError (int error_code, int token, string msg) // An error message has been reported by tokenizer if (token == Token.ERROR) return; + + // Avoid duplicit error message after unterminated string literals + if (token == Token.LITERAL && lexer.Location.Column == 0) + return; string symbol = GetSymbolName (token); string expecting = GetExpecting (); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs index e02d3b956f..1faf94f27f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs @@ -1809,6 +1809,26 @@ namespace Mono.CSharp return x; } + int get_char_withwithoutskippingwindowseol () + { + int x; + if (putback_char != -1) { + x = putback_char; + putback_char = -1; + } else { + x = reader.Read (); + } + + if (x == '\r') { + + } else if (x == '\n') { + advance_line (); + } else { + col++; + } + return x; + } + void advance_line () { line++; @@ -2901,7 +2921,7 @@ namespace Mono.CSharp #endif while (true){ - c = get_char (); + c = get_char_withwithoutskippingwindowseol (); if (c == '"') { if (quoted && peek_char () == '"') { if (pos == value_builder.Length) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/driver.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/driver.cs index 5f2ac1e74d..9b7862560f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/driver.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/driver.cs @@ -173,7 +173,7 @@ namespace Mono.CSharp parser.parse (); return parser; } - + public static int Main (string[] args) { Location.InEmacs = Environment.GetEnvironmentVariable ("EMACS") == "t"; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs index 47bc899d07..07bfe08fc5 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs @@ -1702,7 +1702,7 @@ namespace Mono.CSharp Constant c = expr as Constant; if (c != null) { - c = c.TryReduce (ec, type); + c = c.Reduce (ec, type); if (c != null) return c; } @@ -2661,7 +2661,7 @@ namespace Mono.CSharp return left; if (left.IsZeroInteger) - return left.TryReduce (ec, right.Type); + return left.Reduce (ec, right.Type); break; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs index fa6dd8c796..398b860f45 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs @@ -49,13 +49,21 @@ namespace Mono.CSharp { // in unreachable code, for instance. // - if (warn) + bool unreachable = false; + if (warn && !ec.UnreachableReported) { + ec.UnreachableReported = true; + unreachable = true; ec.Report.Warning (162, 2, loc, "Unreachable code detected"); + } ec.StartFlowBranching (FlowBranching.BranchingType.Block, loc); bool ok = Resolve (ec); ec.KillFlowBranching (); + if (unreachable) { + ec.UnreachableReported = false; + } + return ok; } @@ -1225,7 +1233,7 @@ namespace Mono.CSharp { res = c; } else { TypeSpec type = ec.Switch.SwitchType; - res = c.TryReduce (ec, type); + res = c.Reduce (ec, type); if (res == null) { c.Error_ValueCannotBeConverted (ec, type, true); return false; @@ -2073,9 +2081,7 @@ namespace Mono.CSharp { #endif // int assignable_slots; - bool unreachable_shown; - bool unreachable; - + public Block (Block parent, Location start, Location end) : this (parent, 0, start, end) { @@ -2247,6 +2253,8 @@ namespace Mono.CSharp { Block prev_block = ec.CurrentBlock; bool ok = true; + bool unreachable = ec.IsUnreachable; + bool prev_unreachable = unreachable; ec.CurrentBlock = this; ec.StartFlowBranching (this); @@ -2279,14 +2287,10 @@ namespace Mono.CSharp { if (s is EmptyStatement) continue; - if (!unreachable_shown && !(s is LabeledStatement)) { + if (!ec.UnreachableReported && !(s is LabeledStatement)) { ec.Report.Warning (162, 2, s.loc, "Unreachable code detected"); - unreachable_shown = true; + ec.UnreachableReported = true; } - - Block c_block = s as Block; - if (c_block != null) - c_block.unreachable = c_block.unreachable_shown = true; } // @@ -2310,8 +2314,15 @@ namespace Mono.CSharp { statements [ix] = new EmptyStatement (s.loc); unreachable = ec.CurrentBranching.CurrentUsageVector.IsUnreachable; - if (unreachable && s is LabeledStatement) - throw new InternalErrorException ("should not happen"); + if (unreachable) { + ec.IsUnreachable = true; + } else if (ec.IsUnreachable) + ec.IsUnreachable = false; + } + + if (unreachable != prev_unreachable) { + ec.IsUnreachable = prev_unreachable; + ec.UnreachableReported = false; } while (ec.CurrentBranching is FlowBranchingLabeled) @@ -2335,17 +2346,21 @@ namespace Mono.CSharp { public override bool ResolveUnreachable (BlockContext ec, bool warn) { - unreachable_shown = true; - unreachable = true; - - if (warn) + bool unreachable = false; + if (warn && !ec.UnreachableReported) { + ec.UnreachableReported = true; + unreachable = true; ec.Report.Warning (162, 2, loc, "Unreachable code detected"); + } var fb = ec.StartFlowBranching (FlowBranching.BranchingType.Block, loc); fb.CurrentUsageVector.IsUnreachable = true; bool ok = Resolve (ec); ec.KillFlowBranching (); + if (unreachable) + ec.UnreachableReported = false; + return ok; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/support.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/support.cs index 2deaccfc3e..fa63a971b7 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/support.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/support.cs @@ -127,6 +127,158 @@ namespace Mono.CSharp { return true; } } +#if !FULL_AST + /// + /// This is an arbitrarily seekable StreamReader wrapper. + /// + /// It uses a self-tuning buffer to cache the seekable data, + /// but if the seek is too far, it may read the underly + /// stream all over from the beginning. + /// + public class SeekableStreamReader : IDisposable + { + public const int DefaultReadAheadSize = + 4096 / 2; + + StreamReader reader; + Stream stream; + + char[] buffer; + int read_ahead_length; // the length of read buffer + int buffer_start; // in chars + int char_count; // count of filled characters in buffer[] + int pos; // index into buffer[] + + public SeekableStreamReader (Stream stream, Encoding encoding, char[] sharedBuffer = null) + { + this.stream = stream; + this.buffer = sharedBuffer; + + InitializeStream (DefaultReadAheadSize); + reader = new StreamReader (stream, encoding, true); + } + + public void Dispose () + { + // Needed to release stream reader buffers + reader.Dispose (); + } + + void InitializeStream (int read_length_inc) + { + read_ahead_length += read_length_inc; + + int required_buffer_size = read_ahead_length * 2; + + if (buffer == null || buffer.Length < required_buffer_size) + buffer = new char [required_buffer_size]; + + stream.Position = 0; + buffer_start = char_count = pos = 0; + } + + /// + /// This value corresponds to the current position in a stream of characters. + /// The StreamReader hides its manipulation of the underlying byte stream and all + /// character set/decoding issues. Thus, we cannot use this position to guess at + /// the corresponding position in the underlying byte stream even though there is + /// a correlation between them. + /// + public int Position { + get { + return buffer_start + pos; + } + + set { + // + // If the lookahead was too small, re-read from the beginning. Increase the buffer size while we're at it + // This should never happen until we are parsing some weird source code + // + if (value < buffer_start) { + InitializeStream (read_ahead_length); + + // + // Discard buffer data after underlying stream changed position + // Cannot use handy reader.DiscardBufferedData () because it for + // some strange reason resets encoding as well + // + reader = new StreamReader (stream, reader.CurrentEncoding, true); + } + + while (value > buffer_start + char_count) { + pos = char_count; + if (!ReadBuffer ()) + throw new InternalErrorException ("Seek beyond end of file: " + (buffer_start + char_count - value)); + } + + pos = value - buffer_start; + } + } + + bool ReadBuffer () + { + int slack = buffer.Length - char_count; + + // + // read_ahead_length is only half of the buffer to deal with + // reads ahead and moves back without re-reading whole buffer + // + if (slack <= read_ahead_length) { + // + // shift the buffer to make room for read_ahead_length number of characters + // + int shift = read_ahead_length - slack; + Array.Copy (buffer, shift, buffer, 0, char_count - shift); + + // Update all counters + pos -= shift; + char_count -= shift; + buffer_start += shift; + slack += shift; + } + + char_count += reader.Read (buffer, char_count, slack); + + return pos < char_count; + } + + public char GetChar (int position) + { + if (buffer_start <= position && position < buffer.Length) + return buffer[position]; + return '\0'; + } + + public char[] ReadChars (int fromPosition, int toPosition) + { + char[] chars = new char[toPosition - fromPosition]; + if (buffer_start <= fromPosition && toPosition <= buffer_start + buffer.Length) { + Array.Copy (buffer, fromPosition - buffer_start, chars, 0, chars.Length); + } else { + throw new NotImplementedException (); + } + + return chars; + } + + public int Peek () + { + if ((pos >= char_count) && !ReadBuffer ()) + return -1; + + return buffer [pos]; + } + + public int Read () + { + if ((pos >= char_count) && !ReadBuffer ()) + return -1; + + return buffer [pos++]; + } + } +#endif + public class UnixUtils { [System.Runtime.InteropServices.DllImport ("libc", EntryPoint="isatty")] extern static int _isatty (int fd); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/QueryExpressionExpander.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/QueryExpressionExpander.cs index 35902a21a2..5c494adb59 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/QueryExpressionExpander.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/QueryExpressionExpander.cs @@ -122,14 +122,14 @@ namespace ICSharpCode.NRefactory.CSharp { LambdaExpression CreateLambda(IList parameters, Expression body) { var result = new LambdaExpression(); if (parameters.Count > 1) - result.AddChild(new CSharpTokenNode(TextLocation.Empty), Roles.LPar); + result.AddChild(new CSharpTokenNode(TextLocation.Empty, Roles.LPar), Roles.LPar); result.AddChild(parameters[0], Roles.Parameter); for (int i = 1; i < parameters.Count; i++) { - result.AddChild(new CSharpTokenNode(TextLocation.Empty), Roles.Comma); + result.AddChild(new CSharpTokenNode(TextLocation.Empty, Roles.Comma), Roles.Comma); result.AddChild(parameters[i], Roles.Parameter); } if (parameters.Count > 1) - result.AddChild(new CSharpTokenNode(TextLocation.Empty), Roles.RPar); + result.AddChild(new CSharpTokenNode(TextLocation.Empty, Roles.RPar), Roles.RPar); result.AddChild(body, LambdaExpression.BodyRole); return result; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/BaseRefactoringContext.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/BaseRefactoringContext.cs index 0ba271f151..c7e0c68779 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/BaseRefactoringContext.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/BaseRefactoringContext.cs @@ -36,6 +36,7 @@ using ICSharpCode.NRefactory.Editor; using System.ComponentModel.Design; using ICSharpCode.NRefactory.CSharp.Analysis; using ICSharpCode.NRefactory.Utils; +using System.Collections.Generic; namespace ICSharpCode.NRefactory.CSharp.Refactoring { @@ -87,6 +88,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring { this.resolver = resolver; this.cancellationToken = cancellationToken; + this.referenceFinder = new LocalReferenceFinder(resolver); } @@ -161,6 +163,14 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring { return new CompositeFormatStringParser().Parse(source); } + + LocalReferenceFinder referenceFinder; + + public IList FindReferences(AstNode rootNode, IVariable variable) + { + return referenceFinder.FindReferences(rootNode, variable); + } + #endregion /// diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/ConvertToInitializer/AccessPath.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/ConvertToInitializer/AccessPath.cs index 6968c9675f..10cc5ae3f6 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/ConvertToInitializer/AccessPath.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/ConvertToInitializer/AccessPath.cs @@ -112,7 +112,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring public override bool Equals(object obj) { - if (obj.GetType() != typeof(AccessPath)) + if (obj == null || obj.GetType() != typeof(AccessPath)) return false; var other = (AccessPath)obj; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/CreateFieldAction.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/CreateFieldAction.cs index e93a827d91..f789c83817 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/CreateFieldAction.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/CreateFieldAction.cs @@ -148,10 +148,16 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring return resolver.Compilation.FindType(KnownTypeCode.Object); } + foreach (var method in type.GetMethods (m => m.Name == "GetEnumerator")) { - var pr = method.ReturnType.GetProperties(p => p.Name == "Current").FirstOrDefault(); - if (pr != null) - return pr.ReturnType; + IType returnType = null; + foreach (var prop in method.ReturnType.GetProperties(p => p.Name == "Current")) { + if (returnType != null && prop.ReturnType.IsKnownType (KnownTypeCode.Object)) + continue; + returnType = prop.ReturnType; + } + if (returnType != null) + return returnType; } return resolver.Compilation.FindType(KnownTypeCode.Object); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/SortUsingsAction.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/SortUsingsAction.cs new file mode 100644 index 0000000000..12c15c765c --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/SortUsingsAction.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using ICSharpCode.NRefactory.Semantics; +using ICSharpCode.NRefactory.TypeSystem; +using ICSharpCode.NRefactory.TypeSystem.Implementation; + +namespace ICSharpCode.NRefactory.CSharp.Refactoring +{ + [ContextAction("Sort usings", Description = "Sorts usings by their origin and then alphabetically.")] + public class SortUsingsAction: ICodeActionProvider + { + public IEnumerable GetActions(RefactoringContext context) + { + var usingNode = FindUsingNodeAtCursor(context); + if (usingNode == null) + yield break; + + yield return new CodeAction(context.TranslateString("Sort usings"), script => + { + var blocks = EnumerateUsingBlocks(context.RootNode); + + foreach (var block in blocks) + { + var originalNodes = block.ToArray(); + var sortedNodes = SortUsingBlock(originalNodes, context).ToArray(); + + for (var i = 0; i < originalNodes.Length; ++i) + script.Replace(originalNodes[i], sortedNodes[i].Clone()); + } + }); + } + + private static AstNode FindUsingNodeAtCursor(RefactoringContext context) + { + // If cursor is inside using declaration + var locationAsIs = context.Location; + // If cursor is at end of line with using declaration + var locationLeft = new TextLocation(locationAsIs.Line, locationAsIs.Column - 1); + + var possibleNodes = new[] { locationAsIs, locationLeft } + .Select(_ => context.RootNode.GetNodeAt(_, IsUsingDeclaration)); + var usingNode = possibleNodes.Where(_ => _ != null).Distinct().SingleOrDefault(); + + return usingNode; + } + + private static bool IsUsingDeclaration(AstNode node) + { + return node is UsingDeclaration || node is UsingAliasDeclaration; + } + + private static IEnumerable> EnumerateUsingBlocks(AstNode root) + { + var alreadyAddedNodes = new HashSet(); + + foreach (var child in root.Descendants) + if (IsUsingDeclaration(child) && !alreadyAddedNodes.Contains(child)) { + var blockNodes = EnumerateUsingBlockNodes(child); + + alreadyAddedNodes.UnionWith(blockNodes); + yield return blockNodes; + } + } + + private static IEnumerable EnumerateUsingBlockNodes(AstNode firstNode) + { + for (var node = firstNode; IsUsingDeclaration(node); node = node.NextSibling) + yield return node; + } + + private static IEnumerable SortUsingBlock(IEnumerable nodes, RefactoringContext context) + { + var infos = nodes.Select(_ => new UsingInfo(_, context)); + var orderedInfos = infos.OrderBy(_ => _, new UsingInfoComparer()); + var orderedNodes = orderedInfos.Select(_ => _.Node); + + return orderedNodes; + } + + + private sealed class UsingInfo + { + public AstNode Node { get; private set; } + + public string Alias { get; private set; } + public string Name { get; private set; } + + public bool IsAlias { get; private set; } + public bool IsAssembly { get; private set; } + public bool IsSystem { get; private set; } + + public UsingInfo(AstNode node, RefactoringContext context) + { + var importAndAlias = GetImportAndAlias(node); + + Node = node; + + Alias = importAndAlias.Item2; + Name = importAndAlias.Item1.ToString(); + + IsAlias = Alias != null; + + var result = context.Resolve(importAndAlias.Item1) as NamespaceResolveResult; + var mainSourceAssembly = result != null ? result.Namespace.ContributingAssemblies.First() : null; + var unresolvedAssembly = mainSourceAssembly != null ? mainSourceAssembly.UnresolvedAssembly : null; + IsAssembly = unresolvedAssembly is DefaultUnresolvedAssembly; + + IsSystem = IsAssembly && Name.StartsWith("System"); + } + + private static Tuple GetImportAndAlias(AstNode node) + { + var plainUsing = node as UsingDeclaration; + if (plainUsing != null) + return Tuple.Create(plainUsing.Import, (string)null); + + var aliasUsing = node as UsingAliasDeclaration; + if (aliasUsing != null) + return Tuple.Create(aliasUsing.Import, aliasUsing.Alias); + + throw new InvalidOperationException(string.Format("Invalid using node: {0}", node)); + } + } + + private sealed class UsingInfoComparer: IComparer + { + public int Compare(UsingInfo x, UsingInfo y) + { + if (x.IsAlias != y.IsAlias) + return x.IsAlias && !y.IsAlias ? 1 : -1; + else if (x.IsAssembly != y.IsAssembly) + return x.IsAssembly && !y.IsAssembly ? -1 : 1; + else if (x.IsSystem != y.IsSystem) + return x.IsSystem && !y.IsSystem ? -1 : 1; + else if (x.Alias != y.Alias) + return Comparer.Default.Compare(x.Alias, y.Alias); + else if (x.Name != y.Name) + return Comparer.Default.Compare(x.Name, y.Name); + else + return 0; + } + } + } +} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/AccessToClosureIssues/AccessToClosureIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/AccessToClosureIssues/AccessToClosureIssue.cs index c54af78854..7ff3a99360 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/AccessToClosureIssues/AccessToClosureIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/AccessToClosureIssues/AccessToClosureIssue.cs @@ -27,7 +27,6 @@ using System.Collections.Generic; using System.Linq; using ICSharpCode.NRefactory.CSharp.Analysis; -using ICSharpCode.NRefactory.CSharp.Resolver; using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.TypeSystem; @@ -35,8 +34,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring { public abstract class AccessToClosureIssue : ICodeIssueProvider { - static FindReferences refFinder = new FindReferences (); - static ControlFlowGraphBuilder cfgBuilder = new ControlFlowGraphBuilder (); + ControlFlowGraphBuilder cfgBuilder = new ControlFlowGraphBuilder (); public string Title { get; private set; } @@ -75,7 +73,6 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring class GatherVisitor : GatherVisitorBase { - SyntaxTree unit; string title; AccessToClosureIssue issueProvider; @@ -84,7 +81,6 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring : base (context) { this.title = context.TranslateString (issueProvider.Title); - this.unit = unit; this.issueProvider = issueProvider; } @@ -124,23 +120,18 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring base.VisitParameterDeclaration (parameterDeclaration); } - void FindLocalReferences (IVariable variable, FoundReferenceCallback callback) + void CheckVariable(IVariable variable, Statement env) { - refFinder.FindLocalReferences (variable, ctx.UnresolvedFile, unit, ctx.Compilation, callback, - ctx.CancellationToken); - } - - void CheckVariable (IVariable variable, Statement env) - { - if (!issueProvider.IsTargetVariable (variable)) + if (!issueProvider.IsTargetVariable(variable)) return; var root = new Environment (env, env); var envLookup = new Dictionary (); envLookup [env] = root; - FindLocalReferences (variable, (astNode, resolveResult) => - AddNode (envLookup, new Node (astNode, issueProvider.GetNodeKind (astNode)))); + foreach (var result in ctx.FindReferences(env, variable)) { + AddNode(envLookup, new Node(result.Node, issueProvider.GetNodeKind(result.Node))); + } root.SortChildren (); CollectIssues (root, variable.Name); @@ -152,7 +143,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring IDictionary> modifications = null; if (env.Body != null) { - cfg = cfgBuilder.BuildControlFlowGraph (env.Body); + cfg = issueProvider.cfgBuilder.BuildControlFlowGraph (env.Body); modifications = new Dictionary> (); foreach (var node in env.Children) { if (node.Kind == NodeKind.Modification || node.Kind == NodeKind.ReferenceAndModification) { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ForControlVariableNotModifiedIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ForControlVariableNotModifiedIssue.cs index 78fa121783..4f2da17b48 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ForControlVariableNotModifiedIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ForControlVariableNotModifiedIssue.cs @@ -26,7 +26,6 @@ using System.Collections.Generic; using System.Linq; -using ICSharpCode.NRefactory.CSharp.Resolver; using ICSharpCode.NRefactory.PatternMatching; using ICSharpCode.NRefactory.Semantics; @@ -39,24 +38,16 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring IssueMarker = IssueMarker.Underline)] public class ForControlVariableNotModifiedIssue : ICodeIssueProvider { - static FindReferences refFinder = new FindReferences (); - public IEnumerable GetIssues (BaseRefactoringContext context) { - var unit = context.RootNode as SyntaxTree; - if (unit == null) - return Enumerable.Empty (); - - return new GatherVisitor (context, unit).GetIssues (); + return new GatherVisitor (context).GetIssues (); } class GatherVisitor : GatherVisitorBase { - SyntaxTree unit; - public GatherVisitor (BaseRefactoringContext ctx, SyntaxTree unit) + public GatherVisitor (BaseRefactoringContext ctx) : base (ctx) { - this.unit = unit; } static VariableInitializer GetControlVariable(VariableDeclarationStatement variableDecl, @@ -111,25 +102,24 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring if (localResolveResult == null) return; + var results = ctx.FindReferences (forStatement, localResolveResult.Variable); var modified = false; - refFinder.FindLocalReferences (localResolveResult.Variable, ctx.UnresolvedFile, unit, ctx.Compilation, - (node, resolveResult) => - { - if (modified) - return; - - var unary = node.Parent as UnaryOperatorExpression; - if (unary != null && unary.Expression == node) { - modified = unary.Operator == UnaryOperatorType.Decrement || - unary.Operator == UnaryOperatorType.PostDecrement || - unary.Operator == UnaryOperatorType.Increment || - unary.Operator == UnaryOperatorType.PostIncrement; - return; - } - - var assignment = node.Parent as AssignmentExpression; - modified = assignment != null && assignment.Left == node; - }, ctx.CancellationToken); + foreach (var result in results) { + if (modified) + break; + var node = result.Node; + var unary = node.Parent as UnaryOperatorExpression; + if (unary != null && unary.Expression == node) { + modified = unary.Operator == UnaryOperatorType.Decrement || + unary.Operator == UnaryOperatorType.PostDecrement || + unary.Operator == UnaryOperatorType.Increment || + unary.Operator == UnaryOperatorType.PostIncrement; + continue; + } + + var assignment = node.Parent as AssignmentExpression; + modified = assignment != null && assignment.Left == node; + } if (!modified) AddIssue (controlVariable.NameToken, diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/FormatStringIssues/FormatStringIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/FormatStringIssues/FormatStringIssue.cs index ae7778b53f..a9bd959e22 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/FormatStringIssues/FormatStringIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/FormatStringIssues/FormatStringIssue.cs @@ -54,6 +54,15 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring public override void VisitInvocationExpression(InvocationExpression invocationExpression) { base.VisitInvocationExpression(invocationExpression); + + // Speed up the inspector by discarding some invocations early + var hasEligibleArgument = invocationExpression.Arguments.Any(argument => { + var primitiveArg = argument as PrimitiveExpression; + return primitiveArg != null && primitiveArg.Value is string; + }); + if (!hasEligibleArgument) + return; + var invocationResolveResult = context.Resolve(invocationExpression) as CSharpInvocationResolveResult; if (invocationResolveResult == null) return; @@ -65,7 +74,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring return; } var primitiveArgument = formatArgument as PrimitiveExpression; - if (primitiveArgument == null || !(primitiveArgument.Value is String)) + if (primitiveArgument == null || !(primitiveArgument.Value is string)) return; var format = (string)primitiveArgument.Value; var parsingResult = context.ParseFormatString(format); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/IncorrectExceptionParameterOrderingIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/IncorrectExceptionParameterOrderingIssue.cs index 6a39b2de52..dc7ab72d0f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/IncorrectExceptionParameterOrderingIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/IncorrectExceptionParameterOrderingIssue.cs @@ -58,9 +58,6 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring public override void VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression) { - var type = context.Resolve(objectCreateExpression.Type) as TypeResolveResult; - if (type == null) - return; var parameters = objectCreateExpression.Arguments; if (parameters.Count != 2) return; @@ -69,6 +66,9 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring if (firstParam == null || firstParam.Value.GetType() != typeof(string) || secondParam == null || firstParam.Value.GetType() != typeof(string)) return; + var type = context.Resolve(objectCreateExpression.Type) as TypeResolveResult; + if (type == null) + return; var leftLength = (firstParam.Value as string).Length; var rightLength = (secondParam.Value as string).Length; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/MethodNeverReturnsIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/MethodNeverReturnsIssue.cs index 3738fb4068..68ae2e8529 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/MethodNeverReturnsIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/MethodNeverReturnsIssue.cs @@ -43,7 +43,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring class GatherVisitor : GatherVisitorBase { - static readonly ControlFlowGraphBuilder cfgBuilder = new ControlFlowGraphBuilder (); + readonly ControlFlowGraphBuilder cfgBuilder = new ControlFlowGraphBuilder (); public GatherVisitor(BaseRefactoringContext ctx) : base (ctx) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/MultipleEnumerationIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/MultipleEnumerationIssue.cs index 5312964071..7b5b79c770 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/MultipleEnumerationIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/MultipleEnumerationIssue.cs @@ -42,11 +42,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring { public IEnumerable GetIssues (BaseRefactoringContext context) { - var unit = context.RootNode as SyntaxTree; - if (unit == null) - return Enumerable.Empty (); - - return new GatherVisitor (context, unit).GetIssues (); + return new GatherVisitor (context).GetIssues (); } class AnalysisStatementCollector : DepthFirstAstVisitor @@ -110,15 +106,11 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring class GatherVisitor : GatherVisitorBase { - static FindReferences refFinder = new FindReferences (); - - SyntaxTree unit; HashSet collectedAstNodes; - public GatherVisitor (BaseRefactoringContext ctx, SyntaxTree unit) + public GatherVisitor (BaseRefactoringContext ctx) : base (ctx) { - this.unit = unit; this.collectedAstNodes = new HashSet (); } @@ -139,7 +131,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring base.VisitParameterDeclaration (parameterDeclaration); var resolveResult = ctx.Resolve (parameterDeclaration) as LocalResolveResult; - CollectIssues (parameterDeclaration, resolveResult); + CollectIssues (parameterDeclaration, parameterDeclaration.Parent, resolveResult); } public override void VisitVariableInitializer (VariableInitializer variableInitializer) @@ -147,7 +139,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring base.VisitVariableInitializer (variableInitializer); var resolveResult = ctx.Resolve (variableInitializer) as LocalResolveResult; - CollectIssues (variableInitializer, resolveResult); + CollectIssues (variableInitializer, variableInitializer.Parent.Parent, resolveResult); } static bool IsAssignment (AstNode node) @@ -200,42 +192,42 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring HashSet collectedNodes; Dictionary nodeDegree; // number of enumerations a node can reach - void FindReferences (AstNode variableDecl, IVariable variable) + void FindReferences (AstNode variableDecl, AstNode rootNode, IVariable variable) { references = new HashSet (); refStatements = new HashSet (); lambdaExpressions = new HashSet (); - refFinder.FindLocalReferences (variable, ctx.UnresolvedFile, unit, ctx.Compilation, - (astNode, resolveResult) => { - if (astNode == variableDecl) - return; - - var parent = astNode.Parent; - while (!(parent == null || parent is Statement || parent is LambdaExpression)) - parent = parent.Parent; - if (parent == null) - return; - - // lambda expression with expression body, should be analyzed separately - var expr = parent as LambdaExpression; - if (expr != null) { - if (IsAssignment (astNode) || IsEnumeration (astNode)) { - references.Add (astNode); - lambdaExpressions.Add (expr); - } - return; - } + foreach (var result in ctx.FindReferences (rootNode, variable)) { + var astNode = result.Node; + if (astNode == variableDecl) + continue; - var statement = (Statement)parent; + var parent = astNode.Parent; + while (!(parent == null || parent is Statement || parent is LambdaExpression)) + parent = parent.Parent; + if (parent == null) + continue; + + // lambda expression with expression body, should be analyzed separately + var expr = parent as LambdaExpression; + if (expr != null) { if (IsAssignment (astNode) || IsEnumeration (astNode)) { references.Add (astNode); - refStatements.Add (statement); + lambdaExpressions.Add (expr); } - }, ctx.CancellationToken); + continue; + } + + if (IsAssignment (astNode) || IsEnumeration (astNode)) { + references.Add (astNode); + var statement = (Statement)parent; + refStatements.Add (statement); + } + } } - void CollectIssues (AstNode variableDecl, LocalResolveResult resolveResult) + void CollectIssues (AstNode variableDecl, AstNode rootNode, LocalResolveResult resolveResult) { if (resolveResult == null) return; @@ -246,15 +238,16 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring typeDef.KnownTypeCode != KnownTypeCode.IEnumerableOfT)) return; - FindReferences (variableDecl, resolveResult.Variable); + FindReferences (variableDecl, rootNode, resolveResult.Variable); var statements = AnalysisStatementCollector.Collect (variableDecl); + var builder = new VariableReferenceGraphBuilder (ctx); foreach (var statement in statements) { - var vrNode = VariableReferenceGraphBuilder.Build (statement, references, refStatements, ctx); + var vrNode = builder.Build (statement, references, refStatements, ctx); FindMultipleEnumeration (vrNode); } foreach (var lambda in lambdaExpressions) { - var vrNode = VariableReferenceGraphBuilder.Build (references, ctx.Resolver, (Expression)lambda.Body); + var vrNode = builder.Build (references, ctx.Resolver, (Expression)lambda.Body); FindMultipleEnumeration (vrNode); } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/OptionalParameterCouldBeSkippedIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/OptionalParameterCouldBeSkippedIssue.cs index 6c7f378a4d..792ac2fa9e 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/OptionalParameterCouldBeSkippedIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/OptionalParameterCouldBeSkippedIssue.cs @@ -66,15 +66,24 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring (invocation, args) => new InvocationExpression(invocation.Target.Clone(), args)); } - void CheckMethodCall (T node, IEnumerable arguments, Func, T> generateReplacement) where T: AstNode + void CheckMethodCall (T node, IEnumerable args, Func, T> generateReplacement) where T: AstNode { + // The first two checks are unnecessary, but eliminates the majority of calls early, + // improving performance. + var arguments = args.ToArray(); + if (arguments.Length == 0) + return; + var lastArg = arguments[arguments.Length - 1]; + if (!(lastArg is PrimitiveExpression || lastArg is NamedArgumentExpression)) + return; + var invocationResolveResult = ctx.Resolve(node) as CSharpInvocationResolveResult; if (invocationResolveResult == null) return; string actionMessage = ctx.TranslateString("Remove redundant arguments"); - var redundantArguments = GetRedundantArguments(arguments.ToArray(), invocationResolveResult); + var redundantArguments = GetRedundantArguments(arguments, invocationResolveResult); var action = new CodeAction(actionMessage, script => { var newArgumentList = arguments .Where(arg => !redundantArguments.Contains(arg)) @@ -84,7 +93,6 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring }); var issueMessage = ctx.TranslateString("Argument is identical to the default value"); var lastPositionalArgument = redundantArguments.FirstOrDefault(expression => !(expression is NamedArgumentExpression)); - bool hasNamedArguments = false; foreach (var argument in redundantArguments) { var localArgument = argument; @@ -100,7 +108,6 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring var newInvocation = generateReplacement(node, newArgumentList); script.Replace(node, newInvocation); })); - hasNamedArguments = true; } else { var title = ctx.TranslateString("Remove this and the following positional arguments"); actions.Add(new CodeAction(title, script => { @@ -116,11 +123,13 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring } } - IEnumerable GetRedundantArguments(Expression[] arguments, CSharpInvocationResolveResult invocationResolveResult) + IList GetRedundantArguments(Expression[] arguments, CSharpInvocationResolveResult invocationResolveResult) { var argumentToParameterMap = invocationResolveResult.GetArgumentToParameterMap(); var resolvedParameters = invocationResolveResult.Member.Parameters; + IList redundantArguments = new List(); + for (int i = arguments.Length - 1; i >= 0; i--) { var parameterIndex = argumentToParameterMap[i]; if (parameterIndex == -1) @@ -141,7 +150,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring // Stop here since any arguments before this one has to be there // to enable the passing of this argument break; - yield return argument; + redundantArguments.Add(argument); } else if (argument is NamedArgumentExpression) { var expression = ((NamedArgumentExpression)argument).Expression as PrimitiveExpression; if (expression == null) @@ -150,12 +159,13 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring if (expressionResolveResult == null || parameter.ConstantValue != expressionResolveResult.ConstantValue) // continue, since there can still be more arguments that are redundant continue; - yield return argument; + redundantArguments.Add(argument); } else { // This is a non-constant positional argument => no more redundancies are possible break; } } + return redundantArguments; } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ParameterCanBeDemotedIssue/ParameterCanBeDemotedIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ParameterCanBeDemotedIssue/ParameterCanBeDemotedIssue.cs index d8091430cf..9fa163dd8a 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ParameterCanBeDemotedIssue/ParameterCanBeDemotedIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ParameterCanBeDemotedIssue/ParameterCanBeDemotedIssue.cs @@ -54,13 +54,13 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring #region ICodeIssueProvider implementation public IEnumerable GetIssues(BaseRefactoringContext context) { - var sw = new Stopwatch(); - sw.Start(); +// var sw = new Stopwatch(); +// sw.Start(); var gatherer = new GatherVisitor(context, tryResolve); var issues = gatherer.GetIssues(); - sw.Stop(); - Console.WriteLine("Elapsed time in ParameterCanBeDemotedIssue: {0} (Checked types: {3, 4} Qualified for resolution check: {5, 4} Members with issues: {4, 4} Method bodies resolved: {2, 4} File: '{1}')", - sw.Elapsed, context.UnresolvedFile.FileName, gatherer.MethodResolveCount, gatherer.TypesChecked, gatherer.MembersWithIssues, gatherer.TypeResolveCount); +// sw.Stop(); +// Console.WriteLine("Elapsed time in ParameterCanBeDemotedIssue: {0} (Checked types: {3, 4} Qualified for resolution check: {5, 4} Members with issues: {4, 4} Method bodies resolved: {2, 4} File: '{1}')", +// sw.Elapsed, context.UnresolvedFile.FileName, gatherer.MethodResolveCount, gatherer.TypesChecked, gatherer.MembersWithIssues, gatherer.TypeResolveCount); return issues; } #endregion diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantAssignmentIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantAssignmentIssue.cs index 3effea84aa..af2e192431 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantAssignmentIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantAssignmentIssue.cs @@ -26,7 +26,6 @@ using System.Collections.Generic; using System.Linq; -using ICSharpCode.NRefactory.CSharp.Resolver; using ICSharpCode.NRefactory.Semantics; namespace ICSharpCode.NRefactory.CSharp.Refactoring @@ -48,14 +47,9 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring class GatherVisitor : GatherVisitorBase { - static FindReferences refFinder = new FindReferences (); - - SyntaxTree unit; - public GatherVisitor (BaseRefactoringContext ctx, SyntaxTree unit) : base (ctx) { - this.unit = unit; } public override void VisitParameterDeclaration (ParameterDeclaration parameterDeclaration) @@ -89,40 +83,45 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring { if (rootStatement == null || resolveResult == null) return; + var references = new HashSet (); var refStatements = new HashSet (); var usedInLambda = false; - refFinder.FindLocalReferences (resolveResult.Variable, ctx.UnresolvedFile, unit, ctx.Compilation, - (astNode, rr) => { - if (usedInLambda || astNode == variableDecl) - return; - - var parent = astNode.Parent; - while (!(parent == null || parent is Statement || parent is LambdaExpression)) - parent = parent.Parent; - if (parent == null) - return; - - var statement = parent as Statement; - if (statement != null) { - references.Add (astNode); - refStatements.Add (statement); - } + var results = ctx.FindReferences (rootStatement, resolveResult.Variable); + foreach (var result in results) { + var node = result.Node; + if (node == variableDecl) + continue; + + var parent = node.Parent; + while (!(parent == null || parent is Statement || parent is LambdaExpression)) + parent = parent.Parent; + if (parent == null) + continue; + + var statement = parent as Statement; + if (statement != null) { + references.Add (node); + refStatements.Add (statement); + } - while (parent != null && parent != rootStatement) { - if (parent is LambdaExpression || parent is AnonymousMethodExpression) { - usedInLambda = true; - break; - } - parent = parent.Parent; + while (parent != null && parent != rootStatement) { + if (parent is LambdaExpression || parent is AnonymousMethodExpression) { + usedInLambda = true; + break; } - }, ctx.CancellationToken); + parent = parent.Parent; + } + if (usedInLambda) { + break; + } + } // stop analyzing if the variable is used in any lambda expression or anonymous method if (usedInLambda) return; - var startNode = VariableReferenceGraphBuilder.Build (rootStatement, references, refStatements, ctx); + var startNode = new VariableReferenceGraphBuilder (ctx).Build (rootStatement, references, refStatements, ctx); var variableInitializer = variableDecl as VariableInitializer; if (variableInitializer != null && !variableInitializer.Initializer.IsNull) startNode.References.Insert (0, variableInitializer); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantNamespaceUsageIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantNamespaceUsageIssue.cs index ce063af684..84d69449be 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantNamespaceUsageIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantNamespaceUsageIssue.cs @@ -71,7 +71,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring { base.VisitMemberType(memberType); HandleMemberReference( - memberType, memberType.Target, memberType.MemberNameToken, memberType.TypeArguments, NameLookupMode.Type, + memberType, memberType.Target, memberType.MemberNameToken, memberType.TypeArguments, memberType.GetNameLookupMode(), script => { script.Replace(memberType, RefactoringAstHelper.RemoveTarget(memberType)); }); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantToStringIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantToStringIssue.cs index 8d7df7b841..ef39599247 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantToStringIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantToStringIssue.cs @@ -64,7 +64,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring void CheckExpressionInAutoCallContext(Expression expression) { - if (expression is InvocationExpression) { + if (expression is InvocationExpression && !processedNodes.Contains(expression)) { CheckInvocationInAutoCallContext((InvocationExpression)expression); } } @@ -75,12 +75,12 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring if (memberExpression == null) { return; } - var resolveResult = ctx.Resolve(invocationExpression) as CSharpInvocationResolveResult; - if (resolveResult == null) { + if (memberExpression.MemberName != "ToString" || invocationExpression.Arguments.Any ()) { return; } - var member = resolveResult.Member; - if (member.Name != "ToString" || member.Parameters.Count != 0) { + + var resolveResult = ctx.Resolve(invocationExpression) as CSharpInvocationResolveResult; + if (resolveResult == null) { return; } AddRedundantToStringIssue(memberExpression, invocationExpression); @@ -88,9 +88,8 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring void AddRedundantToStringIssue(MemberReferenceExpression memberExpression, InvocationExpression invocationExpression) { - if (processedNodes.Contains(invocationExpression)) { - return; - } + // Simon Lindgren 2012-09-14: Previously there was a check here to see if the node had already been processed + // This has been moved out to the callers, to check it earlier for a 30-40% run time reduction processedNodes.Add(invocationExpression); AddIssue(memberExpression.DotToken.StartLocation, invocationExpression.RParToken.EndLocation, @@ -176,7 +175,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring void CheckTargetedObject(InvocationExpression invocationExpression, IType type, IMember member) { var memberExpression = invocationExpression.Target as MemberReferenceExpression; - if (memberExpression != null) { + if (memberExpression != null && !processedNodes.Contains(invocationExpression)) { if (type.IsKnownType(KnownTypeCode.String) && member.Name == "ToString") { AddRedundantToStringIssue(memberExpression, invocationExpression); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ReferenceEqualsCalledWithValueTypeIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ReferenceEqualsCalledWithValueTypeIssue.cs index 24f6671fd5..f9d6571491 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ReferenceEqualsCalledWithValueTypeIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ReferenceEqualsCalledWithValueTypeIssue.cs @@ -54,6 +54,11 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring { base.VisitInvocationExpression (invocationExpression); + // Quickly determine if this invocation is eligible to speed up the inspector + var nameToken = invocationExpression.Target.GetChildByRole(Roles.Identifier); + if (nameToken.Name != "ReferenceEquals") + return; + var resolveResult = ctx.Resolve (invocationExpression) as InvocationResolveResult; if (resolveResult == null || resolveResult.Member.DeclaringTypeDefinition == null || diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ValueParameterUnusedIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ValueParameterUnusedIssue.cs index 6a35677b6a..8d0412c412 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ValueParameterUnusedIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/ValueParameterUnusedIssue.cs @@ -45,13 +45,8 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring class GatherVisitor : GatherVisitorBase { - readonly BaseRefactoringContext context; - - readonly FindReferences findRef = new FindReferences(); - public GatherVisitor(BaseRefactoringContext context, ValueParameterUnusedIssue inspector) : base (context) { - this.context = context; } public override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration) @@ -77,22 +72,22 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring if (!IsEligible(body)) return; - var localResolveResult = context.GetResolverStateBefore(body) + var localResolveResult = ctx.GetResolverStateBefore(body) .LookupSimpleNameOrTypeName("value", new List(), NameLookupMode.Expression) as LocalResolveResult; if (localResolveResult == null) return; - var variable = localResolveResult.Variable; bool referenceFound = false; - var syntaxTree = (SyntaxTree)context.RootNode; - findRef.FindLocalReferences(variable, context.UnresolvedFile, syntaxTree, context.Compilation, (n, entity) => { - if (n.StartLocation >= body.StartLocation && n.EndLocation <= body.EndLocation) { + foreach (var result in ctx.FindReferences (body, localResolveResult.Variable)) { + var node = result.Node; + if (node.StartLocation >= body.StartLocation && node.EndLocation <= body.EndLocation) { referenceFound = true; + break; } - }, CancellationToken.None); + } if(!referenceFound) - AddIssue(anchor, context.TranslateString("The " + accessorName + " does not use the 'value' parameter")); + AddIssue(anchor, ctx.TranslateString("The " + accessorName + " does not use the 'value' parameter")); } static bool IsEligible(BlockStatement body) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableDeclaredInWideScopeIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableDeclaredInWideScopeIssue.cs index 83facbfdd9..57df04e568 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableDeclaredInWideScopeIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableDeclaredInWideScopeIssue.cs @@ -210,6 +210,8 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring var binaryOperator = node as BinaryOperatorExpression; if (binaryOperator != null) { var resolveResult = context.Resolve(binaryOperator) as OperatorResolveResult; + if (resolveResult == null) + return false; // Built-in operators are ok, user defined ones not so much return resolveResult.UserDefinedOperatorMethod != null; } @@ -226,6 +228,8 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring var binaryOperator = node as BinaryOperatorExpression; if (binaryOperator != null) { var resolveResult = context.Resolve(binaryOperator) as OperatorResolveResult; + if (resolveResult == null) + return false; return resolveResult.UserDefinedOperatorMethod != null; } return IsConflictingAssignment(node, identifiers, members, locals); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableNotUsedIssues/LocalVariableNotUsedIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableNotUsedIssues/LocalVariableNotUsedIssue.cs index f6645bf9ef..4eebbc615a 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableNotUsedIssues/LocalVariableNotUsedIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableNotUsedIssues/LocalVariableNotUsedIssue.cs @@ -25,6 +25,8 @@ // THE SOFTWARE. using ICSharpCode.NRefactory.Semantics; +using System.Linq; +using ICSharpCode.NRefactory.TypeSystem; namespace ICSharpCode.NRefactory.CSharp.Refactoring { @@ -33,21 +35,22 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring Category = IssueCategories.Redundancies, Severity = Severity.Warning, IssueMarker = IssueMarker.GrayOut)] - public class LocalVariableNotUsedIssue : VariableNotUsedIssue + public class LocalVariableNotUsedIssue : ICodeIssueProvider { - internal override GatherVisitorBase GetGatherVisitor (BaseRefactoringContext context, SyntaxTree unit) + #region ICodeIssueProvider implementation + + public System.Collections.Generic.IEnumerable GetIssues(BaseRefactoringContext context) { - return new GatherVisitor (context, unit); + return new GatherVisitor (context).GetIssues (); } + #endregion + class GatherVisitor : GatherVisitorBase { - SyntaxTree unit; - - public GatherVisitor (BaseRefactoringContext ctx, SyntaxTree unit) + public GatherVisitor (BaseRefactoringContext ctx) : base (ctx) { - this.unit = unit; } public override void VisitVariableInitializer (VariableInitializer variableInitializer) @@ -65,7 +68,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring if (resolveResult == null) return; - if (FindUsage (ctx, unit, resolveResult.Variable, variableInitializer)) + if (IsUsed (decl.Parent, resolveResult.Variable, variableInitializer)) return; AddIssue (variableInitializer.NameToken, ctx.TranslateString ("Remove unused local variable"), @@ -90,11 +93,16 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring if (resolveResult == null) return; - if (FindUsage (ctx, unit, resolveResult.Variable, foreachStatement.VariableNameToken)) + if (IsUsed (foreachStatement, resolveResult.Variable, foreachStatement.VariableNameToken)) return; AddIssue (foreachStatement.VariableNameToken, ctx.TranslateString ("Local variable is never used")); } + + bool IsUsed(AstNode rootNode, IVariable variable, AstNode variableNode) + { + return ctx.FindReferences(rootNode, variable).Any(result => result.Node != variableNode); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableNotUsedIssues/ParameterNotUsedIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableNotUsedIssues/ParameterNotUsedIssue.cs index d8b24b8b56..cb9a51d76d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableNotUsedIssues/ParameterNotUsedIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableNotUsedIssues/ParameterNotUsedIssue.cs @@ -27,6 +27,7 @@ using ICSharpCode.NRefactory.Semantics; using System.Linq; using ICSharpCode.NRefactory.TypeSystem; +using System.Collections.Generic; namespace ICSharpCode.NRefactory.CSharp.Refactoring { @@ -35,22 +36,20 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring Category = IssueCategories.Redundancies, Severity = Severity.Warning, IssueMarker = IssueMarker.GrayOut)] - public class ParameterNotUsedIssue : VariableNotUsedIssue + public class ParameterNotUsedIssue : ICodeIssueProvider { - - internal override GatherVisitorBase GetGatherVisitor (BaseRefactoringContext context, SyntaxTree unit) + #region ICodeIssueProvider implementation + public IEnumerable GetIssues(BaseRefactoringContext context) { - return new GatherVisitor (context, unit); + return new GatherVisitor (context).GetIssues (); } + #endregion class GatherVisitor : GatherVisitorBase { - SyntaxTree unit; - - public GatherVisitor (BaseRefactoringContext ctx, SyntaxTree unit) + public GatherVisitor (BaseRefactoringContext ctx) : base (ctx) { - this.unit = unit; } public override void VisitMethodDeclaration(MethodDeclaration methodDeclaration) @@ -81,7 +80,8 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring var resolveResult = ctx.Resolve (parameterDeclaration) as LocalResolveResult; if (resolveResult == null) return; - if (FindUsage (ctx, unit, resolveResult.Variable, parameterDeclaration)) + + if (ctx.FindReferences (parameterDeclaration.Parent, resolveResult.Variable).Any(r => r.Node != parameterDeclaration)) return; AddIssue (parameterDeclaration.NameToken, ctx.TranslateString ("Parameter is never used")); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableNotUsedIssues/VariableNotUsedIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableNotUsedIssues/VariableNotUsedIssue.cs deleted file mode 100644 index c00869dddf..0000000000 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableNotUsedIssues/VariableNotUsedIssue.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// VariableNotUsedIssue.cs -// -// Author: -// Mansheng Yang -// -// Copyright (c) 2012 Mansheng Yang -// -// 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.Collections.Generic; -using System.Linq; -using ICSharpCode.NRefactory.CSharp.Resolver; -using ICSharpCode.NRefactory.TypeSystem; - -namespace ICSharpCode.NRefactory.CSharp.Refactoring -{ - public abstract class VariableNotUsedIssue : ICodeIssueProvider - { - static FindReferences refFinder = new FindReferences (); - - public IEnumerable GetIssues (BaseRefactoringContext context) - { - var unit = context.RootNode as SyntaxTree; - if (unit == null) - return Enumerable.Empty (); - return GetGatherVisitor(context, unit).GetIssues (); - } - - protected static bool FindUsage (BaseRefactoringContext context, SyntaxTree unit, IVariable variable, - AstNode declaration) - { - var found = false; - refFinder.FindLocalReferences (variable, context.UnresolvedFile, unit, context.Compilation, - (node, resolveResult) => - { - found = found || node != declaration; - }, context.CancellationToken); - return found; - } - - internal abstract GatherVisitorBase GetGatherVisitor (BaseRefactoringContext context, SyntaxTree unit); - } -} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableOnlyAssignedIssues/LocalVariableOnlyAssignedIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableOnlyAssignedIssues/LocalVariableOnlyAssignedIssue.cs index c619d03157..d30d245654 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableOnlyAssignedIssues/LocalVariableOnlyAssignedIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableOnlyAssignedIssues/LocalVariableOnlyAssignedIssue.cs @@ -36,19 +36,16 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring IssueMarker = IssueMarker.Underline)] public class LocalVariableOnlyAssignedIssue : VariableOnlyAssignedIssue { - internal override GatherVisitorBase GetGatherVisitor (BaseRefactoringContext ctx, SyntaxTree unit) + internal override GatherVisitorBase GetGatherVisitor (BaseRefactoringContext ctx) { - return new GatherVisitor (ctx, unit); + return new GatherVisitor (ctx); } class GatherVisitor : GatherVisitorBase { - SyntaxTree unit; - - public GatherVisitor (BaseRefactoringContext ctx, SyntaxTree unit) + public GatherVisitor (BaseRefactoringContext ctx) : base (ctx) { - this.unit = unit; } public override void VisitVariableInitializer (VariableInitializer variableInitializer) @@ -62,7 +59,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring var resolveResult = ctx.Resolve (variableInitializer) as LocalResolveResult; if (resolveResult == null) return; - if (!TestOnlyAssigned (ctx, unit, resolveResult.Variable)) + if (!TestOnlyAssigned (ctx, decl.Parent, resolveResult.Variable)) return; AddIssue (variableInitializer.NameToken, ctx.TranslateString ("Local variable is assigned by its value is never used")); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableOnlyAssignedIssues/ParameterOnlyAssignedIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableOnlyAssignedIssues/ParameterOnlyAssignedIssue.cs index bea8b1599e..0d5ab0c8da 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableOnlyAssignedIssues/ParameterOnlyAssignedIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableOnlyAssignedIssues/ParameterOnlyAssignedIssue.cs @@ -23,7 +23,6 @@ // 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 ICSharpCode.NRefactory.Semantics; namespace ICSharpCode.NRefactory.CSharp.Refactoring @@ -35,33 +34,33 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring IssueMarker = IssueMarker.Underline)] public class ParameterOnlyAssignedIssue : VariableOnlyAssignedIssue { - internal override GatherVisitorBase GetGatherVisitor (BaseRefactoringContext ctx, SyntaxTree unit) + internal override GatherVisitorBase GetGatherVisitor(BaseRefactoringContext ctx) { - return new GatherVisitor (ctx, unit); + return new GatherVisitor(ctx); } private class GatherVisitor : GatherVisitorBase { - SyntaxTree unit; - - public GatherVisitor (BaseRefactoringContext ctx, SyntaxTree unit) + public GatherVisitor(BaseRefactoringContext ctx) : base (ctx) { - this.unit = unit; } - public override void VisitParameterDeclaration (ParameterDeclaration parameterDeclaration) + public override void VisitParameterDeclaration(ParameterDeclaration parameterDeclaration) { - base.VisitParameterDeclaration (parameterDeclaration); + base.VisitParameterDeclaration(parameterDeclaration); - var resolveResult = ctx.Resolve (parameterDeclaration) as LocalResolveResult; + var resolveResult = ctx.Resolve(parameterDeclaration) as LocalResolveResult; if (resolveResult == null) return; - if (parameterDeclaration.ParameterModifier == ParameterModifier.Out || parameterDeclaration.ParameterModifier == ParameterModifier.Ref - || !TestOnlyAssigned (ctx, unit, resolveResult.Variable)) + + var parameterModifier = parameterDeclaration.ParameterModifier; + if (parameterModifier == ParameterModifier.Out || parameterModifier == ParameterModifier.Ref || + !TestOnlyAssigned(ctx, parameterDeclaration.Parent, resolveResult.Variable)) { return; - AddIssue (parameterDeclaration.NameToken, - ctx.TranslateString ("Parameter is assigned by its value is never used")); + } + AddIssue(parameterDeclaration.NameToken, + ctx.TranslateString("Parameter is assigned by its value is never used")); } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableOnlyAssignedIssues/VariableOnlyAssignedIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableOnlyAssignedIssues/VariableOnlyAssignedIssue.cs index a4b965ed69..6c6d6820c2 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableOnlyAssignedIssues/VariableOnlyAssignedIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/VariableOnlyAssignedIssues/VariableOnlyAssignedIssue.cs @@ -25,68 +25,61 @@ // THE SOFTWARE. using System.Collections.Generic; -using System.Linq; -using ICSharpCode.NRefactory.CSharp.Resolver; using ICSharpCode.NRefactory.TypeSystem; namespace ICSharpCode.NRefactory.CSharp.Refactoring { public abstract class VariableOnlyAssignedIssue : ICodeIssueProvider { - static FindReferences refFinder = new FindReferences (); public IEnumerable GetIssues (BaseRefactoringContext context) { - var unit = context.RootNode as SyntaxTree; - if (unit == null) - return Enumerable.Empty (); - return GetGatherVisitor (context, unit).GetIssues (); + return GetGatherVisitor (context).GetIssues (); } - protected static bool TestOnlyAssigned (BaseRefactoringContext ctx, SyntaxTree unit, IVariable variable) + protected static bool TestOnlyAssigned(BaseRefactoringContext ctx, AstNode rootNode, IVariable variable) { var assignment = false; var nonAssignment = false; - refFinder.FindLocalReferences (variable, ctx.UnresolvedFile, unit, ctx.Compilation, - (node, resolveResult) => - { - if (node is ParameterDeclaration) - return; + foreach (var result in ctx.FindReferences(rootNode, variable)) { + var node = result.Node; + if (node is ParameterDeclaration) + continue; - if (node is VariableInitializer) { - if (!(node as VariableInitializer).Initializer.IsNull) - assignment = true; - return; - } + if (node is VariableInitializer) { + if (!(node as VariableInitializer).Initializer.IsNull) + assignment = true; + continue; + } - if (node is IdentifierExpression) { - var parent = node.Parent; - if (parent is AssignmentExpression) { - if (((AssignmentExpression)parent).Left == node) { - assignment = true; - return; - } - } else if (parent is UnaryOperatorExpression) { - var op = ((UnaryOperatorExpression)parent).Operator; - switch (op) { + if (node is IdentifierExpression) { + var parent = node.Parent; + if (parent is AssignmentExpression) { + if (((AssignmentExpression)parent).Left == node) { + assignment = true; + continue; + } + } else if (parent is UnaryOperatorExpression) { + var op = ((UnaryOperatorExpression)parent).Operator; + switch (op) { case UnaryOperatorType.Increment: case UnaryOperatorType.PostIncrement: case UnaryOperatorType.Decrement: case UnaryOperatorType.PostDecrement: assignment = true; - return; - } - } else if (parent is DirectionExpression) { - if (((DirectionExpression)parent).FieldDirection == FieldDirection.Out) { - assignment = true; - return; - } + continue; + } + } else if (parent is DirectionExpression) { + if (((DirectionExpression)parent).FieldDirection == FieldDirection.Out) { + assignment = true; + continue; } } - nonAssignment = true; - }, ctx.CancellationToken); + } + nonAssignment = true; + } return assignment && !nonAssignment; } - internal abstract GatherVisitorBase GetGatherVisitor (BaseRefactoringContext ctx, SyntaxTree unit); + internal abstract GatherVisitorBase GetGatherVisitor (BaseRefactoringContext ctx); } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/LocalReferenceFinder.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/LocalReferenceFinder.cs new file mode 100644 index 0000000000..5ecdb91b55 --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/LocalReferenceFinder.cs @@ -0,0 +1,154 @@ +// +// LocalReferenceFinder.cs +// +// Author: +// Simon Lindgren +// +// Copyright (c) 2012 Simon Lindgren +// +// 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.Collections.Generic; +using System.Linq; +using ICSharpCode.NRefactory.CSharp.Resolver; +using ICSharpCode.NRefactory.Semantics; +using ICSharpCode.NRefactory.TypeSystem; +using ICSharpCode.NRefactory.Utils; +using System.Diagnostics; + +namespace ICSharpCode.NRefactory.CSharp.Refactoring +{ + + /// + /// Finds references to IVariables. + /// + /// + /// This class is more efficient than + /// if there is already a resolved tree or if multiple searches needs + /// to be performed. + /// + public class LocalReferenceFinder + { + LocalReferenceLocator locator; + + MultiDictionary references = new MultiDictionary(); + + HashSet visitedRoots = new HashSet(); + + public LocalReferenceFinder(CSharpAstResolver resolver) + { + locator = new LocalReferenceLocator(resolver, this); + } + + public LocalReferenceFinder(BaseRefactoringContext context) : this(context.Resolver) + { + } + + void VisitIfNeccessary(AstNode rootNode) + { + // If any of the parent nodes are recorded as visited, + // we don't need to traverse rootNode this time. + var tmpRoot = rootNode; + while(tmpRoot != null){ + if (visitedRoots.Contains(tmpRoot)) + return; + tmpRoot = tmpRoot.Parent; + } + + locator.ProccessRoot (rootNode); + } + + /// + /// Finds the references to . + /// + /// + /// Root node for the search. + /// + /// + /// The variable to find references for. + /// + /// + /// When a single is reused for multiple + /// searches, which references outside of are + /// or are not reported is undefined. + /// + public IList FindReferences(AstNode rootNode, IVariable variable) + { + lock (locator) { + VisitIfNeccessary(rootNode); + var lookup = (ILookup)references; + if (!lookup.Contains(variable)) + return new List(); + // Clone the list for thread safety + return references[variable].ToList(); + } + } + + class LocalReferenceLocator : DepthFirstAstVisitor + { + CSharpAstResolver resolver; + + LocalReferenceFinder referenceFinder; + + public LocalReferenceLocator(CSharpAstResolver resolver, LocalReferenceFinder referenceFinder) + { + this.resolver = resolver; + this.referenceFinder = referenceFinder; + } + + IList processedVariables = new List(); + + public void ProccessRoot (AstNode rootNode) + { + rootNode.AcceptVisitor(this); + referenceFinder.visitedRoots.Add(rootNode); + } + + protected override void VisitChildren(AstNode node) + { + if (referenceFinder.visitedRoots.Contains(node)) + return; + var localResolveResult = resolver.Resolve(node) as LocalResolveResult; + if (localResolveResult != null && !processedVariables.Contains(localResolveResult.Variable)) { + referenceFinder.references.Add(localResolveResult.Variable, new ReferenceResult(node, localResolveResult)); + + processedVariables.Add(localResolveResult.Variable); + base.VisitChildren(node); + Debug.Assert(processedVariables.Contains(localResolveResult.Variable), "Variable should still be in the list of processed variables."); + processedVariables.Remove(localResolveResult.Variable); + } else { + base.VisitChildren(node); + } + } + } + } + + public class ReferenceResult + { + public ReferenceResult (AstNode node, LocalResolveResult resolveResult) + { + Node = node; + ResolveResult = resolveResult; + } + + public AstNode Node { get; private set; } + + public LocalResolveResult ResolveResult { get; private set; } + } +} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/NamingHelper.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/NamingHelper.cs index afd32272a7..272c223426 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/NamingHelper.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/NamingHelper.cs @@ -103,6 +103,9 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring /// /// The type of the variable. /// + /// + /// Suggested base name. + /// public string GenerateVariableName(AstType type, string baseName = null) { if (baseName == null) { @@ -142,6 +145,9 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring /// /// The type of the variable. /// + /// + /// Suggested base name. + /// public string GenerateVariableName(IType type, string baseName = null) { AstType astType = ToAstType(type); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/TypeSystemAstBuilder.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/TypeSystemAstBuilder.cs index 12faf6e8ab..0c9ab68c3d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/TypeSystemAstBuilder.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/TypeSystemAstBuilder.cs @@ -55,6 +55,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring this.ShowTypeParameterConstraints = true; this.ShowParameterNames = true; this.ShowConstantValues = true; + this.UseAliases = true; } /// @@ -129,6 +130,12 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring /// The default value is false. /// public bool ConvertUnboundTypeArguments { get; set;} + + /// + /// Controls if aliases should be used inside the type name or not. + /// The default value is true. + /// + public bool UseAliases { get; set;} #endregion #region Convert Type @@ -218,11 +225,13 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring if (resolver != null) { // Look if there's an alias to the target type - for (ResolvedUsingScope usingScope = resolver.CurrentUsingScope; usingScope != null; usingScope = usingScope.Parent) { - foreach (var pair in usingScope.UsingAliases) { - if (pair.Value is TypeResolveResult) { - if (TypeMatches(pair.Value.Type, typeDef, typeArguments)) - return new SimpleType(pair.Key); + if (UseAliases) { + for (ResolvedUsingScope usingScope = resolver.CurrentUsingScope; usingScope != null; usingScope = usingScope.Parent) { + foreach (var pair in usingScope.UsingAliases) { + if (pair.Value is TypeResolveResult) { + if (TypeMatches(pair.Value.Type, typeDef, typeArguments)) + return new SimpleType(pair.Key); + } } } } @@ -236,12 +245,15 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring } else { localTypeArguments = EmptyList.Instance; } - TypeResolveResult trr = resolver.ResolveSimpleName(typeDef.Name, localTypeArguments) as TypeResolveResult; - if (trr != null && !trr.IsError && TypeMatches(trr.Type, typeDef, typeArguments)) { - // We can use the short type name - SimpleType shortResult = new SimpleType(typeDef.Name); - AddTypeArguments(shortResult, typeDef, typeArguments, outerTypeParameterCount, typeDef.TypeParameterCount); - return shortResult; + ResolveResult rr = resolver.ResolveSimpleName(typeDef.Name, localTypeArguments); + TypeResolveResult trr = rr as TypeResolveResult; + if (trr != null || (localTypeArguments.Count == 0 && resolver.IsVariableReferenceWithSameType(rr, typeDef.Name, out trr))) { + if (!trr.IsError && TypeMatches(trr.Type, typeDef, typeArguments)) { + // We can use the short type name + SimpleType shortResult = new SimpleType(typeDef.Name); + AddTypeArguments(shortResult, typeDef, typeArguments, outerTypeParameterCount, typeDef.TypeParameterCount); + return shortResult; + } } } @@ -315,11 +327,13 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring { if (resolver != null) { // Look if there's an alias to the target namespace - for (ResolvedUsingScope usingScope = resolver.CurrentUsingScope; usingScope != null; usingScope = usingScope.Parent) { - foreach (var pair in usingScope.UsingAliases) { - NamespaceResolveResult nrr = pair.Value as NamespaceResolveResult; - if (nrr != null && nrr.NamespaceName == ns) - return new SimpleType(pair.Key); + if (UseAliases) { + for (ResolvedUsingScope usingScope = resolver.CurrentUsingScope; usingScope != null; usingScope = usingScope.Parent) { + foreach (var pair in usingScope.UsingAliases) { + NamespaceResolveResult nrr = pair.Value as NamespaceResolveResult; + if (nrr != null && nrr.NamespaceName == ns) + return new SimpleType(pair.Key); + } } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/VariableReferenceGraph.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/VariableReferenceGraph.cs index 74a4c08523..e53b740359 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/VariableReferenceGraph.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/VariableReferenceGraph.cs @@ -65,23 +65,30 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring class VariableReferenceGraphBuilder { - static ControlFlowGraphBuilder cfgBuilder = new ControlFlowGraphBuilder (); - static CfgVariableReferenceNodeBuilder cfgVrNodeBuilder = new CfgVariableReferenceNodeBuilder (); + ControlFlowGraphBuilder cfgBuilder = new ControlFlowGraphBuilder (); + CfgVariableReferenceNodeBuilder cfgVrNodeBuilder; + BaseRefactoringContext ctx; - public static VariableReferenceNode Build (ISet references, CSharpAstResolver resolver, + public VariableReferenceGraphBuilder(BaseRefactoringContext ctx) + { + this.ctx = ctx; + cfgVrNodeBuilder = new CfgVariableReferenceNodeBuilder (this); + } + + public VariableReferenceNode Build (ISet references, CSharpAstResolver resolver, Expression expression) { return ExpressionNodeCreationVisitor.CreateNode (references, resolver, new [] { expression }); } - public static VariableReferenceNode Build (Statement statement, ISet references, + public VariableReferenceNode Build (Statement statement, ISet references, ISet refStatements, BaseRefactoringContext context) { var cfg = cfgBuilder.BuildControlFlowGraph (statement, context.Resolver, context.CancellationToken); return cfgVrNodeBuilder.Build (cfg [0], references, refStatements, context.Resolver); } - public static VariableReferenceNode Build (Statement statement, ISet references, + public VariableReferenceNode Build (Statement statement, ISet references, ISet refStatements, CSharpAstResolver resolver, CancellationToken cancellationToken = default(CancellationToken)) { var cfg = cfgBuilder.BuildControlFlowGraph (statement, resolver, cancellationToken); @@ -169,13 +176,19 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring class CfgVariableReferenceNodeBuilder { - static GetExpressionsVisitor getExpr = new GetExpressionsVisitor (); + readonly VariableReferenceGraphBuilder variableReferenceGraphBuilder; + GetExpressionsVisitor getExpr = new GetExpressionsVisitor (); ISet references; ISet refStatements; CSharpAstResolver resolver; Dictionary nodeDict; + public CfgVariableReferenceNodeBuilder(VariableReferenceGraphBuilder variableReferenceGraphBuilder) + { + this.variableReferenceGraphBuilder = variableReferenceGraphBuilder; + } + public VariableReferenceNode Build (ControlFlowNode startNode, ISet references, ISet refStatements, CSharpAstResolver resolver) { @@ -214,6 +227,8 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring var node = new VariableReferenceNode (); var cfNode = startNode; while (true) { + if (variableReferenceGraphBuilder.ctx.CancellationToken.IsCancellationRequested) + return null; if (nodeDict.ContainsKey (cfNode)) { node.AddNextNode (nodeDict [cfNode]); break; @@ -246,12 +261,12 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring if (tryc != null) { VariableReferenceNode outNode = null; foreach (var n in tryc.CatchClauses) { - var catchNode = VariableReferenceGraphBuilder.Build(n.Body, references, refStatements, this.resolver); + var catchNode = variableReferenceGraphBuilder.Build(n.Body, references, refStatements, this.resolver); (outNode ?? node).AddNextNode (catchNode); outNode = catchNode; } if (!tryc.FinallyBlock.IsNull) { - var finallyNode = VariableReferenceGraphBuilder.Build(tryc.FinallyBlock, references, refStatements, this.resolver); + var finallyNode = variableReferenceGraphBuilder.Build(tryc.FinallyBlock, references, refStatements, this.resolver); (outNode ?? node).AddNextNode (finallyNode); outNode = finallyNode; } @@ -261,7 +276,10 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring } } } - return nodeDict [startNode]; + VariableReferenceNode result; + if (!nodeDict.TryGetValue (startNode, out result)) + return new VariableReferenceNode (); + return result; } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/AwaitResolveResult.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/AwaitResolveResult.cs new file mode 100644 index 0000000000..da758c4339 --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/AwaitResolveResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// 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; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using ICSharpCode.NRefactory.Semantics; +using ICSharpCode.NRefactory.TypeSystem; + +namespace ICSharpCode.NRefactory.CSharp.Resolver +{ + /// + /// Represents the result of an await expression. + /// + public class AwaitResolveResult : ResolveResult + { + /// + /// The method representing the GetAwaiter() call. Can be null if the GetAwaiter method was not found. + /// + public readonly ResolveResult GetAwaiterInvocation; + + /// + /// Awaiter type. Will not be null (but can be UnknownType). + /// + public readonly IType AwaiterType; + + /// + /// Property representing the IsCompleted property on the awaiter type. Can be null if the awaiter type or the property was not found, or when awaiting a dynamic expression. + /// + public readonly IProperty IsCompletedProperty; + + /// + /// Method representing the OnCompleted method on the awaiter type. Can be null if the awaiter type or the method was not found, or when awaiting a dynamic expression. + /// + public readonly IMethod OnCompletedMethod; + + /// + /// Method representing the GetResult method on the awaiter type. Can be null if the awaiter type or the method was not found, or when awaiting a dynamic expression. + /// + public readonly IMethod GetResultMethod; + + public AwaitResolveResult(IType resultType, ResolveResult getAwaiterInvocation, IType awaiterType, IProperty isCompletedProperty, IMethod onCompletedMethod, IMethod getResultMethod) + : base(resultType) + { + if (awaiterType == null) + throw new ArgumentNullException("awaiterType"); + if (getAwaiterInvocation == null) + throw new ArgumentNullException("getAwaiterInvocation"); + this.GetAwaiterInvocation = getAwaiterInvocation; + this.AwaiterType = awaiterType; + this.IsCompletedProperty = isCompletedProperty; + this.OnCompletedMethod = onCompletedMethod; + this.GetResultMethod = getResultMethod; + } + + public override bool IsError { + get { return this.GetAwaiterInvocation.IsError || (AwaiterType.Kind != TypeKind.Dynamic && (this.IsCompletedProperty == null || this.OnCompletedMethod == null || this.GetResultMethod == null)); } + } + + public override IEnumerable GetChildResults() { + return new[] { GetAwaiterInvocation }; + } + } +} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpConversions.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpConversions.cs index aa96853535..8e6e92248f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpConversions.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpConversions.cs @@ -651,7 +651,10 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver long val = (long)rr.ConstantValue; return val >= 0 && toTypeCode == TypeCode.UInt64; } else if (fromTypeCode == TypeCode.Int32) { - int val = (int)rr.ConstantValue; + object cv = rr.ConstantValue; + if (cv == null) + return false; + int val = (int)cv; switch (toTypeCode) { case TypeCode.SByte: return val >= SByte.MinValue && val <= SByte.MaxValue; @@ -903,13 +906,13 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver MethodGroupResolveResult rr = resolveResult as MethodGroupResolveResult; if (rr == null) return Conversion.None; - IMethod m = toType.GetDelegateInvokeMethod(); - if (m == null) + IMethod invoke = toType.GetDelegateInvokeMethod(); + if (invoke == null) return Conversion.None; - ResolveResult[] args = new ResolveResult[m.Parameters.Count]; + ResolveResult[] args = new ResolveResult[invoke.Parameters.Count]; for (int i = 0; i < args.Length; i++) { - IParameter param = m.Parameters[i]; + IParameter param = invoke.Parameters[i]; IType parameterType = param.Type; if ((param.IsRef || param.IsOut) && parameterType.Kind == TypeKind.ByReference) { parameterType = ((ByReferenceType)parameterType).ElementType; @@ -918,16 +921,58 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver args[i] = new ResolveResult(parameterType); } } - var or = rr.PerformOverloadResolution(compilation, args, allowExpandingParams: false, conversions: this); + var or = rr.PerformOverloadResolution(compilation, args, allowExpandingParams: false, allowOptionalParameters: false, conversions: this); if (or.FoundApplicableCandidate) { IMethod method = (IMethod)or.GetBestCandidateWithSubstitutedTypeArguments(); var thisRR = rr.TargetResult as ThisResolveResult; bool isVirtual = method.IsOverridable && !(thisRR != null && thisRR.CausesNonVirtualInvocation); - return Conversion.MethodGroupConversion(method, isVirtual); + bool isValid = !or.IsAmbiguous && IsDelegateCompatible(method, invoke, or.IsExtensionMethodInvocation); + if (isValid) + return Conversion.MethodGroupConversion(method, isVirtual); + else + return Conversion.InvalidMethodGroupConversion(method, isVirtual); } else { return Conversion.None; } } + + /// + /// Gets whether a method is compatible with a delegate type. + /// §15.2 Delegate compatibility + /// + /// The method to test for compatibility + /// The invoke method of the delegate + /// Gets whether m is accessed using extension method syntax. + /// If this parameter is true, the first parameter of will be ignored. + bool IsDelegateCompatible(IMethod m, IMethod invoke, bool isExtensionMethodInvocation) + { + if (m == null) + throw new ArgumentNullException("m"); + if (invoke == null) + throw new ArgumentNullException("invoke"); + int firstParameterInM = isExtensionMethodInvocation ? 1 : 0; + if (m.Parameters.Count - firstParameterInM != invoke.Parameters.Count) + return false; + for (int i = 0; i < invoke.Parameters.Count; i++) { + var pm = m.Parameters[firstParameterInM + i]; + var pd = invoke.Parameters[i]; + // ret/out must match + if (pm.IsRef != pd.IsRef || pm.IsOut != pd.IsOut) + return false; + if (pm.IsRef || pm.IsOut) { + // ref/out parameters must have same types + if (!pm.Type.Equals(pd.Type)) + return false; + } else { + // non-ref/out parameters must have an identity or reference conversion from pd to pm + if (!IdentityConversion(pd.Type, pm.Type) && !IsImplicitReferenceConversion(pd.Type, pm.Type)) + return false; + } + } + // check return type compatibility + return IdentityConversion(m.ReturnType, invoke.ReturnType) + || IsImplicitReferenceConversion(m.ReturnType, invoke.ReturnType); + } #endregion #region BetterConversion diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpInvocationResolveResult.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpInvocationResolveResult.cs index e1e34a2606..066dc38ae4 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpInvocationResolveResult.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpInvocationResolveResult.cs @@ -107,8 +107,12 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver } } } - if (IsExpandedForm) - results[results.Length - 1] = new ArrayCreateResolveResult(Member.Parameters.Last().Type, null, paramsArguments.ToArray()); + if (IsExpandedForm){ + IType arrayType = Member.Parameters.Last().Type; + IType int32 = Member.Compilation.FindType(KnownTypeCode.Int32); + ResolveResult[] sizeArguments = { new ConstantResolveResult(int32, paramsArguments.Count) }; + results[results.Length - 1] = new ArrayCreateResolveResult(arrayType, sizeArguments, paramsArguments); + } for (int i = 0; i < results.Length; i++) { if (results[i] == null) { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpResolver.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpResolver.cs index 5542338aeb..a65bbced93 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpResolver.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpResolver.cs @@ -360,8 +360,14 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver #region ResolveUnaryOperator method public ResolveResult ResolveUnaryOperator(UnaryOperatorType op, ResolveResult expression) { - if (expression.Type.Kind == TypeKind.Dynamic) - return UnaryOperatorResolveResult(SpecialType.Dynamic, op, expression); + if (expression.Type.Kind == TypeKind.Dynamic) { + if (op == UnaryOperatorType.Await) { + return new AwaitResolveResult(SpecialType.Dynamic, new DynamicInvocationResolveResult(new DynamicMemberResolveResult(expression, "GetAwaiter"), DynamicInvocationType.Invocation, EmptyList.Instance), SpecialType.Dynamic, null, null, null); + } + else { + return UnaryOperatorResolveResult(SpecialType.Dynamic, op, expression); + } + } // C# 4.0 spec: §7.3.3 Unary operator overload resolution string overloadableOperatorName = GetOverloadableOperatorName(op); @@ -375,17 +381,37 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return ErrorResult; case UnaryOperatorType.AddressOf: return UnaryOperatorResolveResult(new PointerType(expression.Type), op, expression); - case UnaryOperatorType.Await: + case UnaryOperatorType.Await: { ResolveResult getAwaiterMethodGroup = ResolveMemberAccess(expression, "GetAwaiter", EmptyList.Instance, NameLookupMode.InvocationTarget); ResolveResult getAwaiterInvocation = ResolveInvocation(getAwaiterMethodGroup, new ResolveResult[0]); - var getResultMethodGroup = CreateMemberLookup().Lookup(getAwaiterInvocation, "GetResult", EmptyList.Instance, true) as MethodGroupResolveResult; + + var lookup = CreateMemberLookup(); + IMethod getResultMethod; + IType awaitResultType; + var getResultMethodGroup = lookup.Lookup(getAwaiterInvocation, "GetResult", EmptyList.Instance, true) as MethodGroupResolveResult; if (getResultMethodGroup != null) { - var or = getResultMethodGroup.PerformOverloadResolution(compilation, new ResolveResult[0], allowExtensionMethods: false, conversions: conversions); - IType awaitResultType = or.GetBestCandidateWithSubstitutedTypeArguments().ReturnType; - return UnaryOperatorResolveResult(awaitResultType, UnaryOperatorType.Await, expression); - } else { - return UnaryOperatorResolveResult(SpecialType.UnknownType, UnaryOperatorType.Await, expression); + var getResultOR = getResultMethodGroup.PerformOverloadResolution(compilation, new ResolveResult[0], allowExtensionMethods: false, conversions: conversions); + getResultMethod = getResultOR.FoundApplicableCandidate ? getResultOR.GetBestCandidateWithSubstitutedTypeArguments() as IMethod : null; + awaitResultType = getResultMethod != null ? getResultMethod.ReturnType : SpecialType.UnknownType; + } + else { + getResultMethod = null; + awaitResultType = SpecialType.UnknownType; + } + + var isCompletedRR = lookup.Lookup(getAwaiterInvocation, "IsCompleted", EmptyList.Instance, false); + var isCompletedProperty = (isCompletedRR is MemberResolveResult ? ((MemberResolveResult)isCompletedRR).Member as IProperty : null); + + var onCompletedMethodGroup = lookup.Lookup(getAwaiterInvocation, "OnCompleted", EmptyList.Instance, true) as MethodGroupResolveResult; + IMethod onCompletedMethod = null; + if (onCompletedMethodGroup != null) { + var onCompletedOR = onCompletedMethodGroup.PerformOverloadResolution(compilation, new ResolveResult[] { new TypeResolveResult(compilation.FindType(new FullTypeName("System.Action"))) }, allowExtensionMethods: false, conversions: conversions); + onCompletedMethod = (onCompletedOR.FoundApplicableCandidate ? onCompletedOR.GetBestCandidateWithSubstitutedTypeArguments() as IMethod : null); } + + return new AwaitResolveResult(awaitResultType, getAwaiterInvocation, getAwaiterInvocation.Type, isCompletedProperty, onCompletedMethod, getResultMethod); + } + default: throw new ArgumentException("Invalid value for UnaryOperatorType", "op"); } @@ -1279,6 +1305,8 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return new ConstantResolveResult(targetType, CSharpPrimitiveCast(code, expression.ConstantValue)); } catch (OverflowException) { return new ErrorResolveResult(targetType); + } catch (InvalidCastException) { + return new ErrorResolveResult(targetType); } } else if (code == TypeCode.String) { if (expression.ConstantValue == null || expression.ConstantValue is string) @@ -1292,6 +1320,8 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return new ConstantResolveResult(targetType, CSharpPrimitiveCast(code, expression.ConstantValue)); } catch (OverflowException) { return new ErrorResolveResult(targetType); + } catch (InvalidCastException) { + return new ErrorResolveResult(targetType); } } } @@ -2433,21 +2463,48 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver /// The array element type. /// Pass null to resolve an implicitly-typed array creation. /// - /// - /// The number of array dimensions. + /// + /// The size arguments. + /// The length of this array will be used as the number of dimensions of the array type. + /// Negative values will be treated as errors. + /// + /// + /// The initializer elements. May be null if no array initializer was specified. + /// The resolver may mutate this array to wrap elements in s! + /// + public ArrayCreateResolveResult ResolveArrayCreation(IType elementType, int[] sizeArguments, ResolveResult[] initializerElements = null) + { + ResolveResult[] sizeArgResults = new ResolveResult[sizeArguments.Length]; + for (int i = 0; i < sizeArguments.Length; i++) { + if (sizeArguments[i] < 0) + sizeArgResults[i] = ErrorResolveResult.UnknownError; + else + sizeArgResults[i] = new ConstantResolveResult(compilation.FindType(KnownTypeCode.Int32), sizeArguments[i]); + } + return ResolveArrayCreation(elementType, sizeArgResults, initializerElements); + } + + /// + /// Resolves an array creation. + /// + /// + /// The array element type. + /// Pass null to resolve an implicitly-typed array creation. /// /// - /// The size arguments. May be null if no explicit size was given. + /// The size arguments. + /// The length of this array will be used as the number of dimensions of the array type. /// The resolver may mutate this array to wrap elements in s! /// /// /// The initializer elements. May be null if no array initializer was specified. /// The resolver may mutate this array to wrap elements in s! /// - public ArrayCreateResolveResult ResolveArrayCreation(IType elementType, int dimensions = 1, ResolveResult[] sizeArguments = null, ResolveResult[] initializerElements = null) + public ArrayCreateResolveResult ResolveArrayCreation(IType elementType, ResolveResult[] sizeArguments, ResolveResult[] initializerElements = null) { - if (sizeArguments != null && dimensions != Math.Max(1, sizeArguments.Length)) - throw new ArgumentException("dimensions and sizeArguments.Length don't match"); + int dimensions = sizeArguments.Length; + if (dimensions == 0) + throw new ArgumentException("sizeArguments.Length must not be 0"); if (elementType == null) { TypeInference typeInference = new TypeInference(compilation, conversions); bool success; @@ -2455,8 +2512,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver } IType arrayType = new ArrayType(compilation, elementType, dimensions); - if (sizeArguments != null) - AdjustArrayAccessArguments(sizeArguments); + AdjustArrayAccessArguments(sizeArguments); if (initializerElements != null) { for (int i = 0; i < initializerElements.Length; i++) { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/FindReferences.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/FindReferences.cs index c269f581d1..15382b0e8a 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/FindReferences.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/FindReferences.cs @@ -244,6 +244,8 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver scope = FindMemberReferences(entity, m => new FindPropertyReferences((IProperty)m)); if (entity.Name == "Current") additionalScope = FindEnumeratorCurrentReferences((IProperty)entity); + else if (entity.Name == "IsCompleted") + additionalScope = FindAwaiterIsCompletedReferences((IProperty)entity); break; case EntityType.Event: scope = FindMemberReferences(entity, m => new FindEventReferences((IEvent)m)); @@ -661,6 +663,15 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return imported != null ? new FindEnumeratorCurrentReferencesNavigator(imported) : null; }); } + + SearchScope FindAwaiterIsCompletedReferences(IProperty property) + { + return new SearchScope( + delegate(ICompilation compilation) { + IProperty imported = compilation.Import(property); + return imported != null ? new FindAwaiterIsCompletedReferencesNavigator(imported) : null; + }); + } sealed class FindEnumeratorCurrentReferencesNavigator : FindReferenceNavigator { @@ -682,6 +693,27 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return ferr != null && ferr.CurrentProperty != null && findReferences.IsMemberMatch(property, ferr.CurrentProperty, true); } } + + sealed class FindAwaiterIsCompletedReferencesNavigator : FindReferenceNavigator + { + IProperty property; + + public FindAwaiterIsCompletedReferencesNavigator(IProperty property) + { + this.property = property; + } + + internal override bool CanMatch(AstNode node) + { + return node is UnaryOperatorExpression; + } + + internal override bool IsMatch(ResolveResult rr) + { + AwaitResolveResult arr = rr as AwaitResolveResult; + return arr != null && arr.IsCompletedProperty != null && findReferences.IsMemberMatch(property, arr.IsCompletedProperty, true); + } + } #endregion #region Find Method References @@ -724,6 +756,11 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver case "MoveNext": specialNodeType = typeof(ForeachStatement); break; + case "GetAwaiter": + case "GetResult": + case "OnCompleted": + specialNodeType = typeof(UnaryOperatorExpression); + break; default: specialNodeType = null; break; @@ -794,6 +831,12 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return IsMatch(ferr.GetEnumeratorCall) || (ferr.MoveNextMethod != null && findReferences.IsMemberMatch(method, ferr.MoveNextMethod, true)); } + var arr = rr as AwaitResolveResult; + if (arr != null) { + return IsMatch(arr.GetAwaiterInvocation) + || (arr.GetResultMethod != null && findReferences.IsMemberMatch(method, arr.GetResultMethod, true)) + || (arr.OnCompletedMethod != null && findReferences.IsMemberMatch(method, arr.OnCompletedMethod, true)); + } } var mrr = rr as MemberResolveResult; return mrr != null && findReferences.IsMemberMatch(method, mrr.Member, mrr.IsVirtualCall); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/MethodGroupResolveResult.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/MethodGroupResolveResult.cs index 39571f2918..fddfda7c5a 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/MethodGroupResolveResult.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/MethodGroupResolveResult.cs @@ -220,7 +220,11 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return string.Format("[{0} with {1} method(s)]", GetType().Name, this.Methods.Count()); } - public OverloadResolution PerformOverloadResolution(ICompilation compilation, ResolveResult[] arguments, string[] argumentNames = null, bool allowExtensionMethods = true, bool allowExpandingParams = true, bool checkForOverflow = false, CSharpConversions conversions = null) + public OverloadResolution PerformOverloadResolution(ICompilation compilation, ResolveResult[] arguments, string[] argumentNames = null, + bool allowExtensionMethods = true, + bool allowExpandingParams = true, + bool allowOptionalParameters = true, + bool checkForOverflow = false, CSharpConversions conversions = null) { Log.WriteLine("Performing overload resolution for " + this); Log.WriteCollection(" Arguments: ", arguments); @@ -228,6 +232,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver var typeArgumentArray = this.TypeArguments.ToArray(); OverloadResolution or = new OverloadResolution(compilation, arguments, argumentNames, typeArgumentArray, conversions); or.AllowExpandingParams = allowExpandingParams; + or.AllowOptionalParameters = allowOptionalParameters; or.CheckForOverflow = checkForOverflow; or.AddMethodLists(methodLists); @@ -249,6 +254,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver } var extOr = new OverloadResolution(compilation, extArguments, extArgumentNames, typeArgumentArray, conversions); extOr.AllowExpandingParams = allowExpandingParams; + extOr.AllowOptionalParameters = allowOptionalParameters; extOr.IsExtensionMethodInvocation = true; extOr.CheckForOverflow = checkForOverflow; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/OverloadResolution.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/OverloadResolution.cs index ce1ce09570..6c4e814f20 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/OverloadResolution.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/OverloadResolution.cs @@ -155,6 +155,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver this.conversions = conversions ?? CSharpConversions.Get(compilation); this.AllowExpandingParams = true; + this.AllowOptionalParameters = true; } #endregion @@ -174,6 +175,13 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver /// public bool AllowExpandingParams { get; set; } + /// + /// Gets/Sets whether optional parameters may be left at their default value. + /// The default value is true. + /// If this property is set to false, optional parameters will be treated like regular parameters. + /// + public bool AllowOptionalParameters { get; set; } + /// /// Gets/Sets whether ConversionResolveResults created by this OverloadResolution /// instance apply overflow checking. @@ -543,7 +551,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver if (candidate.IsExpandedForm && i == argumentCountPerParameter.Length - 1) continue; // any number of arguments is fine for the params-array if (argumentCountPerParameter[i] == 0) { - if (candidate.Parameters[i].IsOptional) + if (this.AllowOptionalParameters && candidate.Parameters[i].IsOptional) candidate.HasUnmappedOptionalParameters = true; else candidate.AddError(OverloadResolutionErrors.MissingArgumentForRequiredParameter); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs index 016fe07b78..74ab04cbbc 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs @@ -1,4 +1,4 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team // // 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 @@ -53,6 +53,10 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver node = syntaxTree.GetNodeAt(location); if (node == null || node is ArrayInitializerExpression) return null; + if (node.Parent is UsingAliasDeclaration && node.Role == UsingAliasDeclaration.AliasRole) { + var r = new CSharpAstResolver(compilation.Value, syntaxTree, unresolvedFile); + return r.Resolve(((UsingAliasDeclaration)node.Parent).Import, cancellationToken); + } if (CSharpAstResolver.IsUnresolvableNode(node)) { if (node is Identifier) { node = node.Parent; @@ -81,6 +85,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return null; } } + if (node == null) return null; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs index 890eb07bbc..2a3ce9f8eb 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs @@ -735,12 +735,13 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver if (aie != null && arrayType != null) { StoreCurrentState(aie); List initializerElements = new List(); - UnpackArrayInitializer(initializerElements, aie, arrayType.Dimensions, true); + int[] sizes = new int[arrayType.Dimensions]; + UnpackArrayInitializer(initializerElements, sizes, aie, 0, true); ResolveResult[] initializerElementResults = new ResolveResult[initializerElements.Count]; for (int i = 0; i < initializerElementResults.Length; i++) { initializerElementResults[i] = Resolve(initializerElements[i]); } - var arrayCreation = resolver.ResolveArrayCreation(arrayType.ElementType, arrayType.Dimensions, null, initializerElementResults); + var arrayCreation = resolver.ResolveArrayCreation(arrayType.ElementType, sizes, initializerElementResults); StoreResult(aie, arrayCreation); ProcessConversionResults(initializerElements, arrayCreation.InitializerElements); } else if (variableInitializer.Parent is FixedStatement) { @@ -1201,6 +1202,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver ResolveResult IAstVisitor.VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression) { int dimensions = arrayCreateExpression.Arguments.Count; + IEnumerable sizeArgumentExpressions; ResolveResult[] sizeArguments; IEnumerable additionalArraySpecifiers; if (dimensions == 0) { @@ -1213,24 +1215,29 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver additionalArraySpecifiers = arrayCreateExpression.AdditionalArraySpecifiers; } sizeArguments = null; + sizeArgumentExpressions = null; } else { + sizeArgumentExpressions = arrayCreateExpression.Arguments; sizeArguments = new ResolveResult[dimensions]; int pos = 0; - foreach (var node in arrayCreateExpression.Arguments) + foreach (var node in sizeArgumentExpressions) sizeArguments[pos++] = Resolve(node); additionalArraySpecifiers = arrayCreateExpression.AdditionalArraySpecifiers; } + int[] sizes; List initializerElements; ResolveResult[] initializerElementResults; if (arrayCreateExpression.Initializer.IsNull) { + sizes = null; initializerElements = null; initializerElementResults = null; } else { StoreCurrentState(arrayCreateExpression.Initializer); initializerElements = new List(); - UnpackArrayInitializer(initializerElements, arrayCreateExpression.Initializer, dimensions, true); + sizes = new int[dimensions]; + UnpackArrayInitializer(initializerElements, sizes, arrayCreateExpression.Initializer, 0, true); initializerElementResults = new ResolveResult[initializerElements.Count]; for (int i = 0; i < initializerElementResults.Length; i++) { initializerElementResults[i] = Resolve(initializerElements[i]); @@ -1238,39 +1245,59 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver StoreResult(arrayCreateExpression.Initializer, voidResult); } - ArrayCreateResolveResult acrr; + IType elementType; if (arrayCreateExpression.Type.IsNull) { - acrr = resolver.ResolveArrayCreation(null, dimensions, sizeArguments, initializerElementResults); + elementType = null; } else { - IType elementType = ResolveType(arrayCreateExpression.Type); + elementType = ResolveType(arrayCreateExpression.Type); foreach (var spec in additionalArraySpecifiers.Reverse()) { elementType = new ArrayType(resolver.Compilation, elementType, spec.Dimensions); } - acrr = resolver.ResolveArrayCreation(elementType, dimensions, sizeArguments, initializerElementResults); } + ArrayCreateResolveResult acrr; + if (sizeArguments != null) { + acrr = resolver.ResolveArrayCreation(elementType, sizeArguments, initializerElementResults); + } else if (sizes != null) { + acrr = resolver.ResolveArrayCreation(elementType, sizes, initializerElementResults); + } else { + // neither size arguments nor an initializer exist -> error + return new ErrorResolveResult(new ArrayType(resolver.Compilation, elementType ?? SpecialType.UnknownType, dimensions)); + } + if (sizeArgumentExpressions != null) + ProcessConversionResults(sizeArgumentExpressions, acrr.SizeArguments); + if (acrr.InitializerElements != null) + ProcessConversionResults(initializerElements, acrr.InitializerElements); return acrr; } - void UnpackArrayInitializer(List elementList, ArrayInitializerExpression initializer, int dimensions, bool resolveNestedInitializesToVoid) + void UnpackArrayInitializer(List elementList, int[] sizes, ArrayInitializerExpression initializer, int dimension, bool resolveNestedInitializersToVoid) { - Debug.Assert(dimensions >= 1); - if (dimensions > 1) { + Debug.Assert(dimension < sizes.Length); + int elementCount = 0; + if (dimension + 1 < sizes.Length) { foreach (var node in initializer.Elements) { ArrayInitializerExpression aie = node as ArrayInitializerExpression; if (aie != null) { - if (resolveNestedInitializesToVoid) { + if (resolveNestedInitializersToVoid) { StoreCurrentState(aie); StoreResult(aie, voidResult); } - UnpackArrayInitializer(elementList, aie, dimensions - 1, resolveNestedInitializesToVoid); + UnpackArrayInitializer(elementList, sizes, aie, dimension + 1, resolveNestedInitializersToVoid); } else { elementList.Add(node); } + elementCount++; } } else { - foreach (var expr in initializer.Elements) + foreach (var expr in initializer.Elements) { elementList.Add(expr); + elementCount++; + } } + if (sizes[dimension] == 0) // 0 = uninitialized + sizes[dimension] = elementCount; + else if (sizes[dimension] != elementCount) + sizes[dimension] = -1; // -1 = error } ResolveResult IAstVisitor.VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression) @@ -1556,7 +1583,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver var addRR = memberLookup.Lookup(initializedObject, "Add", EmptyList.Instance, true); var mgrr = addRR as MethodGroupResolveResult; if (mgrr != null) { - OverloadResolution or = mgrr.PerformOverloadResolution(resolver.Compilation, addArguments, null, false, false, resolver.CheckForOverflow, resolver.conversions); + OverloadResolution or = mgrr.PerformOverloadResolution(resolver.Compilation, addArguments, null, false, false, false, resolver.CheckForOverflow, resolver.conversions); var invocationRR = or.CreateResolveResult(initializedObject); StoreResult(aie, invocationRR); ProcessInvocationResult(null, aie.Elements, invocationRR); @@ -2718,7 +2745,9 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver } else { var getEnumeratorMethodGroup = memberLookup.Lookup(expression, "GetEnumerator", EmptyList.Instance, true) as MethodGroupResolveResult; if (getEnumeratorMethodGroup != null) { - var or = getEnumeratorMethodGroup.PerformOverloadResolution(compilation, new ResolveResult[0]); + var or = getEnumeratorMethodGroup.PerformOverloadResolution( + compilation, new ResolveResult[0], + allowExtensionMethods: false, allowExpandingParams: false, allowOptionalParameters: false); if (or.FoundApplicableCandidate && !or.IsAmbiguous && !or.BestCandidate.IsStatic && or.BestCandidate.IsPublic) { collectionType = expression.Type; getEnumeratorInvocation = or.CreateResolveResult(expression); @@ -2735,7 +2764,9 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver IMethod moveNextMethod = null; var moveNextMethodGroup = memberLookup.Lookup(new ResolveResult(enumeratorType), "MoveNext", EmptyList.Instance, false) as MethodGroupResolveResult; if (moveNextMethodGroup != null) { - var or = moveNextMethodGroup.PerformOverloadResolution(compilation, new ResolveResult[0]); + var or = moveNextMethodGroup.PerformOverloadResolution( + compilation, new ResolveResult[0], + allowExtensionMethods: false, allowExpandingParams: false, allowOptionalParameters: false); moveNextMethod = or.GetBestCandidateWithSubstitutedTypeArguments() as IMethod; } @@ -3237,7 +3268,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver } // Figure out the correct lookup mode: - NameLookupMode lookupMode = GetNameLookupMode(simpleType); + NameLookupMode lookupMode = simpleType.GetNameLookupMode(); var typeArguments = ResolveTypeArguments(simpleType.TypeArguments); Identifier identifier = simpleType.IdentifierToken; @@ -3252,23 +3283,6 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return rr; } - NameLookupMode GetNameLookupMode(AstType type) - { - AstType outermostType = type; - while (outermostType.Parent is AstType) - outermostType = (AstType)outermostType.Parent; - - if (outermostType.Parent is UsingDeclaration || outermostType.Parent is UsingAliasDeclaration) { - return NameLookupMode.TypeInUsingDeclaration; - } else if (outermostType.Role == Roles.BaseType) { - // Use BaseTypeReference for a type's base type, and for a constraint on a type. - // Do not use it for a constraint on a method. - if (outermostType.Parent is TypeDeclaration || (outermostType.Parent is Constraint && outermostType.Parent.Parent is TypeDeclaration)) - return NameLookupMode.BaseTypeReference; - } - return NameLookupMode.Type; - } - ResolveResult IAstVisitor.VisitMemberType(MemberType memberType) { ResolveResult target; @@ -3285,7 +3299,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver target = Resolve(memberType.Target); } - NameLookupMode lookupMode = GetNameLookupMode(memberType); + NameLookupMode lookupMode = memberType.GetNameLookupMode(); var typeArguments = ResolveTypeArguments(memberType.TypeArguments); Identifier identifier = memberType.MemberNameToken; ResolveResult rr = resolver.ResolveMemberAccess(target, identifier.Name, typeArguments, lookupMode); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/TypeInference.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/TypeInference.cs index e082f98d8e..6438b82856 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/TypeInference.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/TypeInference.cs @@ -510,7 +510,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver } var or = mgrr.PerformOverloadResolution(compilation, args, - allowExpandingParams: false); + allowExpandingParams: false, allowOptionalParameters: false); if (or.FoundApplicableCandidate && or.BestCandidateAmbiguousWith == null) { IType returnType = or.GetBestCandidateWithSubstitutedTypeArguments().ReturnType; MakeLowerBoundInference(returnType, m.ReturnType); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs index bda16fc326..181099b29c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs @@ -99,6 +99,10 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem root = new NS(this); Dictionary dict = new Dictionary(compilation.NameComparer); dict.Add(string.Empty, root); + // Add namespaces declared in C# files, even if they're empty: + foreach (var usingScope in projectContent.Files.OfType().SelectMany(f => f.UsingScopes)) { + GetOrAddNamespace(dict, usingScope.NamespaceName); + } foreach (var pair in GetTypes()) { NS ns = GetOrAddNamespace(dict, pair.Key.Namespace); if (ns.types != null) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/ConstantValues.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/ConstantValues.cs index 56333627ee..79ed801716 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/ConstantValues.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/ConstantValues.cs @@ -480,10 +480,11 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem.ConstantValues for (int i = 0; i < elements.Length; i++) { elements[i] = arrayElements[i].Resolve(resolver); } + int[] sizeArguments = { elements.Length }; if (elementType != null) { - return resolver.ResolveArrayCreation(elementType.Resolve(resolver.CurrentTypeResolveContext), 1, null, elements); + return resolver.ResolveArrayCreation(elementType.Resolve(resolver.CurrentTypeResolveContext), sizeArguments, elements); } else { - return resolver.ResolveArrayCreation(null, 1, null, elements); + return resolver.ResolveArrayCreation(null, sizeArguments, elements); } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CSharpOutputVisitorTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CSharpOutputVisitorTests.cs index 8b662c6233..5745e5da80 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CSharpOutputVisitorTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CSharpOutputVisitorTests.cs @@ -86,11 +86,11 @@ namespace ICSharpCode.NRefactory.CSharp public void InlineCommentAtEndOfCondition() { IfElseStatement condition = new IfElseStatement(); - condition.AddChild(new CSharpTokenNode(new TextLocation(1, 1)), IfElseStatement.IfKeywordRole); - condition.AddChild(new CSharpTokenNode(new TextLocation(1, 4)), Roles.LPar); + condition.AddChild(new CSharpTokenNode(new TextLocation(1, 1), IfElseStatement.IfKeywordRole), IfElseStatement.IfKeywordRole); + condition.AddChild(new CSharpTokenNode(new TextLocation(1, 4), Roles.LPar), Roles.LPar); condition.AddChild(new IdentifierExpression("cond", new TextLocation(1, 5)), IfElseStatement.ConditionRole); condition.AddChild(new Comment(CommentType.MultiLine, new TextLocation(1, 9), new TextLocation(1, 14)) { Content = "a" }, Roles.Comment); - condition.AddChild(new CSharpTokenNode(new TextLocation(1, 14)), Roles.RPar); + condition.AddChild(new CSharpTokenNode(new TextLocation(1, 14), Roles.RPar), Roles.RPar); condition.AddChild(new ReturnStatement(), IfElseStatement.TrueRole); AssertOutput("if (cond/*a*/)\n$return;\n", condition); @@ -138,5 +138,14 @@ namespace ICSharpCode.NRefactory.CSharp "case 3: {\n$int a = 3;\n$return a;\n}\n" + "default:\n$break;\n}\n", type); } + + [Test] + public void ZeroLiterals() + { + AssertOutput("0.0", new PrimitiveExpression(0.0)); + AssertOutput("-0.0", new PrimitiveExpression(-0.0)); + AssertOutput("0f", new PrimitiveExpression(0f)); + AssertOutput("-0f", new PrimitiveExpression(-0f)); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/SortUsingsTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/SortUsingsTests.cs new file mode 100644 index 0000000000..71af592bfd --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/SortUsingsTests.cs @@ -0,0 +1,109 @@ +using NUnit.Framework; +using ICSharpCode.NRefactory.CSharp.Refactoring; + +namespace ICSharpCode.NRefactory.CSharp.CodeActions +{ + [TestFixture] + public class SortUsingsTests : ContextActionTestBase + { + [Test] + public void TestActiveWhenCursorAtUsing() + { + Test(@"using Sys$tem.Linq; +using System;", @"using System; +using System.Linq;"); + } + + [Test] + public void TestActiveWhenCursorBehindUsing() + { + Test(@"using System.Linq;$ +using System;", @"using System; +using System.Linq;"); + } + + [Test] + public void TestInActiveWhenCursorOutsideUsings() + { + TestWrongContext(@"using System.Linq; +using System; +$"); + } + + [Test] + public void TestSortsAllUsingBlocksInFile() + { + Test(@"using $System.Linq; +using System; + +namespace Foo +{ + using System.IO; + using System.Collections; +} + +namespace Bar +{ + using System.IO; + using System.Runtime; + using System.Diagnostics; +}", @"using System; +using System.Linq; + +namespace Foo +{ + using System.Collections; + using System.IO; +} + +namespace Bar +{ + using System.Diagnostics; + using System.IO; + using System.Runtime; +}"); + } + + [Test] + public void TestAliasesGoesToTheEnd() + { + Test(@"$using Sys = System; +using System;", @"using System; +using Sys = System;"); + } + + [Test] + public void TestUnknownNamespacesGoesAfterKnownOnes() + { + Test(@"$using Foo; +using System;", @"using System; +using Foo;"); + } + + [Test] + public void TestMixedStuff() + { + Test(@"$using Foo; +using System.Linq; +using Sys = System; +using System; +using FooAlias = Foo; +using Linq = System.Linq;", @"using System; +using System.Linq; +using Foo; +using Linq = System.Linq; +using Sys = System; +using FooAlias = Foo;"); + } + + [Test] + public void TestPreservesEmptyLinesWhichIsInFactABug() + { + Test(@"$using System.Linq; + +using System;", @"using System; + +using System.Linq;"); + } + } +} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionBugTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionBugTests.cs index ae18efe4cd..de0d21303d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionBugTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionBugTests.cs @@ -37,6 +37,8 @@ using ICSharpCode.NRefactory.CSharp.TypeSystem; using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.TypeSystem; using NUnit.Framework; +using ICSharpCode.NRefactory.CSharp.Resolver; +using ICSharpCode.NRefactory.CSharp.Refactoring; namespace ICSharpCode.NRefactory.CSharp.CodeCompletion { @@ -68,6 +70,16 @@ namespace ICSharpCode.NRefactory.CSharp.CodeCompletion class TestFactory : ICompletionDataFactory { + readonly CSharpResolver state; + readonly TypeSystemAstBuilder builder; + + public TestFactory(CSharpResolver state) + { + this.state = state; + builder = new TypeSystemAstBuilder(state); + builder.ConvertUnboundTypeArguments = true; + } + class CompletionData : ICompletionData { @@ -141,13 +153,23 @@ namespace ICSharpCode.NRefactory.CSharp.CodeCompletion { return new CompletionData (entity.Name); } - - public ICompletionData CreateTypeCompletionData (ICSharpCode.NRefactory.TypeSystem.IType type, string shortType) + public ICompletionData CreateTypeCompletionData (ICSharpCode.NRefactory.TypeSystem.IType type, bool fullName, bool isInAttributeContext) { - return new CompletionData (shortType); + string name = fullName ? builder.ConvertType(type).GetText() : type.Name; + if (isInAttributeContext && name.EndsWith("Attribute") && name.Length > "Attribute".Length) { + name = name.Substring(0, name.Length - "Attribute".Length); + } + return new CompletionData (name); } + public ICompletionData CreateMemberCompletionData(IType type, IEntity member) + { + string name = builder.ConvertType(type).GetText(); + return new CompletionData (name + "."+ member.Name); + } + + public ICompletionData CreateLiteralCompletionData (string title, string description, string insertText) { return new CompletionData (title); @@ -196,12 +218,27 @@ namespace ICSharpCode.NRefactory.CSharp.CodeCompletion #endregion } - public static IUnresolvedAssembly SystemAssembly { get { return systemAssembly.Value; } } static readonly Lazy systemAssembly = new Lazy( delegate { - return new CecilLoader().LoadAssemblyFile(typeof(System.ComponentModel.BrowsableAttribute).Assembly.Location); + var loader = new CecilLoader(); + loader.IncludeInternalMembers = true; + return loader.LoadAssemblyFile(typeof(System.ComponentModel.BrowsableAttribute).Assembly.Location); }); - + + static readonly Lazy mscorlib = new Lazy( + delegate { + var loader = new CecilLoader(); + loader.IncludeInternalMembers = true; + return loader.LoadAssemblyFile(typeof(object).Assembly.Location); + }); + + static readonly Lazy systemCore = new Lazy( + delegate { + var loader = new CecilLoader(); + loader.IncludeInternalMembers = true; + return loader.LoadAssemblyFile(typeof(System.Linq.Enumerable).Assembly.Location); + }); + public static CSharpCompletionEngine CreateEngine(string text, out int cursorPosition, params IUnresolvedAssembly[] references) { string parsedText; @@ -222,7 +259,7 @@ namespace ICSharpCode.NRefactory.CSharp.CodeCompletion var doc = new ReadOnlyDocument(editorText); IProjectContent pctx = new CSharpProjectContent(); - var refs = new List { CecilLoaderTests.Mscorlib, CecilLoaderTests.SystemCore, SystemAssembly }; + var refs = new List { mscorlib.Value, systemCore.Value, systemAssembly.Value }; if (references != null) refs.AddRange (references); @@ -251,7 +288,7 @@ namespace ICSharpCode.NRefactory.CSharp.CodeCompletion } var mb = new DefaultCompletionContextProvider(doc, unresolvedFile); mb.AddSymbol ("TEST"); - var engine = new CSharpCompletionEngine(doc, mb, new TestFactory(), pctx, rctx); + var engine = new CSharpCompletionEngine(doc, mb, new TestFactory(new CSharpResolver (rctx)), pctx, rctx); engine.EolMarker = Environment.NewLine; engine.FormattingPolicy = FormattingOptionsFactory.CreateMono(); @@ -283,7 +320,7 @@ namespace ICSharpCode.NRefactory.CSharp.CodeCompletion var cmp = pctx.CreateCompilation(); var mb = new DefaultCompletionContextProvider(doc, unresolvedFile); - var engine = new CSharpCompletionEngine (doc, mb, new TestFactory (), pctx, new CSharpTypeResolveContext (cmp.MainAssembly)); + var engine = new CSharpCompletionEngine (doc, mb, new TestFactory (new CSharpResolver (new CSharpTypeResolveContext (cmp.MainAssembly))), pctx, new CSharpTypeResolveContext (cmp.MainAssembly)); engine.EolMarker = Environment.NewLine; engine.FormattingPolicy = FormattingOptionsFactory.CreateMono (); return Tuple.Create (doc, engine); @@ -5182,7 +5219,7 @@ class Foo }); } - [Test()] + [Test, Ignore("broken")] public void TestCatchContextFollowUp() { CombinedProviderTest( @@ -5476,5 +5513,126 @@ public class FooBar Assert.IsNull(provider.Find("using")); }); } + + /// + /// Bug 7207 - Missing inherited enum in completion + /// + [Test()] + public void TestBug7207() + { + CombinedProviderTest( + @"using System; + +class A +{ + protected enum MyEnum + { + A + } + + class Hidden {} + +} + +class C : A +{ + class NotHidden {} + public static void Main () + { + $var a2 = M$ + } +} + +", provider => { + Assert.IsNotNull(provider.Find("MyEnum")); + Assert.IsNotNull(provider.Find("NotHidden")); + Assert.IsNull(provider.Find("Hidden")); + }); + } + + + /// + /// Bug 7191 - code completion problem with generic interface using nested type + /// + [Test()] + public void TestBug7191() + { + CombinedProviderTest( + @"using System.Collections.Generic; +namespace bug +{ + public class Outer + { + public class Nested + { + } + } + public class TestClass + { + void Bar() + { + $IList foo = new $ + } + } +} + +", provider => { + Assert.IsNotNull(provider.Find("List")); + }); + } + + + /// + /// Bug 6849 - Regression: Inaccesible types in completion + /// + [Test()] + public void TestBug6849() + { + CombinedProviderTest( + @" +namespace bug +{ + public class TestClass + { + void Bar() + { + $new System.Collections.Generic.$ + } + } +} + +", provider => { + // it's likely to be mono specific. + Assert.IsNull(provider.Find("RBTree")); + Assert.IsNull(provider.Find("GenericComparer")); + Assert.IsNull(provider.Find("InternalStringComparer")); + }); + } + + + [Test()] + public void TestBug6849Case2() + { + + CombinedProviderTest( + @" +namespace bug +{ + public class TestClass + { + void Bar() + { + $System.Collections.Generic.$ + } + } +} + +", provider => { + // it's likely to be mono specific. + Assert.IsNull(provider.Find("RBTree")); + Assert.IsNull(provider.Find("GenericComparer")); + Assert.IsNull(provider.Find("InternalStringComparer")); + }); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/KeywordTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/KeywordTests.cs index f71373e9a7..727919a030 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/KeywordTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/KeywordTests.cs @@ -145,11 +145,27 @@ class Test public void GetSetKeywordTest () { CodeCompletionBugTests.CombinedProviderTest ( -@"class Test + @"class Test { public int MyProperty { $g$ } +", provider => { + Assert.IsNotNull (provider.Find ("public"), "keyword 'public' not found."); + Assert.IsNotNull (provider.Find ("get"), "keyword 'get' not found."); + Assert.IsNotNull (provider.Find ("set"), "keyword 'set' not found."); + }); + } + + [Test()] + public void GetSetKeywordIndexerCaseTest () + { + CodeCompletionBugTests.CombinedProviderTest ( + @"class Test +{ + public int this[int i] { + $g$ +} ", provider => { Assert.IsNotNull (provider.Find ("public"), "keyword 'public' not found."); Assert.IsNotNull (provider.Find ("get"), "keyword 'get' not found."); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/NameContextTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/NameContextTests.cs index bca62a6288..06795a1c22 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/NameContextTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/NameContextTests.cs @@ -44,7 +44,6 @@ namespace ICSharpCode.NRefactory.CSharp.CodeCompletion Assert.IsTrue (provider == null || provider.Count == 0, "provider should be empty."); } - [Ignore("Parser bug.")] [Test()] public void TestNamespaceNameCase3 () { @@ -187,7 +186,7 @@ namespace ICSharpCode.NRefactory.CSharp.CodeCompletion Assert.AreEqual (0, provider.Count, "provider needs to be empty"); }); } - [Ignore("TODO")] + [Test()] public void TestIndexerParameterName () { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ObjectInitializerTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ObjectInitializerTests.cs index d75fddec79..81acf52a76 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ObjectInitializerTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ObjectInitializerTests.cs @@ -587,6 +587,64 @@ class MyTest ); } + + /// + /// Bug 7383 - Object initializer completion inaccessible + /// + [Test()] + public void TestBug7383() + { + var provider = CodeCompletionBugTests.CreateCtrlSpaceProvider( + @"using System.Runtime.InteropServices; + +class S +{ + public int Foo { get; protected set; } + public int Bar { get; set; } +} + +class C +{ + public static void Main () + { + var s = new S () { + $Fo$ + }; + } +} + +"); + Assert.IsNull(provider.Find("Foo"), "'Foo' found."); + Assert.IsNotNull(provider.Find("Bar"), "'Bar' not found."); + } + + [Test()] + public void TestBug7383Case2() + { + var provider = CodeCompletionBugTests.CreateCtrlSpaceProvider( + @"using System.Runtime.InteropServices; + +class S +{ + public int Foo { get; protected set; } + public int Bar { get; set; } +} + +class C : S +{ + public static void Main () + { + var s = new C () { + $Fo$ + }; + } +} + +"); + Assert.IsNotNull(provider.Find("Foo"), "'Foo' found."); + Assert.IsNotNull(provider.Find("Bar"), "'Bar' not found."); + } + } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ParameterCompletionTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ParameterCompletionTests.cs index 6cbfc5c57b..55ee718284 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ParameterCompletionTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ParameterCompletionTests.cs @@ -985,5 +985,58 @@ public class B Assert.IsNotNull (provider, "provider was not created."); Assert.AreEqual (1, provider.Count); } + + + [Test()] + public void TestLambdaCase() + { + IParameterDataProvider provider = CreateProvider( + @"using System; +class TestClass +{ + void F (Action i, int foo) + { + $F (()=> Something(),$ + + } +} +"); + Assert.IsTrue (provider != null && provider.Count == 1); + } + + [Test()] + public void TestJaggedArrayCreation() + { + IParameterDataProvider provider = CreateProvider( + @"using System; +class TestClass +{ + void F (Action i, int foo) + { + $new foo[1,2][$ + + } +} +"); + Assert.IsTrue (provider == null || provider.Count == 0); + } + + [Test()] + public void TestJaggedArrayCreationCase2() + { + IParameterDataProvider provider = CreateProvider( + @"using System; +class TestClass +{ + void F (Action i, int foo) + { + $new foo[1,2][1,$ + + } +} +"); + Assert.IsTrue (provider == null || provider.Count == 0); + } + } } \ No newline at end of file diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantNamespaceUsageInspectorTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantNamespaceUsageInspectorTests.cs index 2296a5b763..6c3a0d2466 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantNamespaceUsageInspectorTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantNamespaceUsageInspectorTests.cs @@ -81,5 +81,15 @@ class Foo } }"); } + + [Test] + public void UsingAlias() + { + var input = @"using IEnumerable = System.Collections.IEnumerable;"; + + TestRefactoringContext context; + var issues = GetIssues (new RedundantNamespaceUsageIssue (), input, out context); + Assert.AreEqual (0, issues.Count); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/PrimitiveExpressionTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/PrimitiveExpressionTests.cs index ce0cdc6b52..a72871924c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/PrimitiveExpressionTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/PrimitiveExpressionTests.cs @@ -244,7 +244,6 @@ namespace ICSharpCode.NRefactory.CSharp.Parser.Expression Assert.AreEqual(code, pe.LiteralValue); } - [Ignore("Waiting for upstream fix.")] [Test] public void LargeVerbatimString() { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeSystemConvertVisitorTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeSystemConvertVisitorTests.cs index 2f1d58eb09..8657662f5c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeSystemConvertVisitorTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeSystemConvertVisitorTests.cs @@ -36,6 +36,16 @@ namespace ICSharpCode.NRefactory.CSharp.Parser { compilation = ParseTestCase().CreateCompilation(); } + + static IProjectContent CreateContent (IUnresolvedFile unresolvedFile) + { + return new CSharpProjectContent() + .AddOrUpdateFiles(unresolvedFile) + .AddAssemblyReferences(new[] { + CecilLoaderTests.Mscorlib + }) + .SetAssemblyName(typeof(TypeSystemTests).Assembly.GetName().Name); + } internal static IProjectContent ParseTestCase() { @@ -47,11 +57,7 @@ namespace ICSharpCode.NRefactory.CSharp.Parser syntaxTree = parser.Parse(s, fileName); } - var unresolvedFile = syntaxTree.ToTypeSystem(); - return new CSharpProjectContent() - .AddOrUpdateFiles(unresolvedFile) - .AddAssemblyReferences(new[] { CecilLoaderTests.Mscorlib }) - .SetAssemblyName(typeof(TypeSystemTests).Assembly.GetName().Name); + return CreateContent(syntaxTree.ToTypeSystem()); } [Test] @@ -80,6 +86,19 @@ namespace ICSharpCode.NRefactory.CSharp.Parser var method = t.GetMethods(m => m.Name == "PartialMethodWithoutImplementation").Single(); Assert.AreEqual(1, method.Parts.Count); } + + [Test] + public void CyclicConstants() + { + var syntaxTree = SyntaxTree.Parse ("class Test { const int foo = foo; }"); + syntaxTree.FileName = "a.cs"; + var content = CreateContent (syntaxTree.ToTypeSystem()); + var testType = content.CreateCompilation ().MainAssembly.GetTypeDefinition ("", "Test"); + Assert.NotNull (testType); + var field = testType.Fields.First (); + Assert.IsTrue (field.IsConst); + Assert.IsNull (field.ConstantValue); + } } [TestFixture] diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Refactoring/TypeSystemAstBuilderTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Refactoring/TypeSystemAstBuilderTests.cs index 82a677cb15..8b924fb72b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Refactoring/TypeSystemAstBuilderTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Refactoring/TypeSystemAstBuilderTests.cs @@ -32,13 +32,14 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring [TestFixture] public class TypeSystemAstBuilderTests { - const string program = @" + const string mainProgram = @" using System; using System.Collections.Generic; using OtherNS; class Base { public class Nested { } + public class Sibling { } } class Derived : Base { } @@ -55,11 +56,22 @@ namespace OtherNS { IProjectContent pc; ICompilation compilation; - ITypeDefinition baseClass, derivedClass, nestedClass, systemClass; + ITypeDefinition baseClass, derivedClass, nestedClass, siblingClass, systemClass; CSharpUnresolvedFile unresolvedFile; [SetUp] public void SetUp() + { + Init(mainProgram); + + baseClass = compilation.RootNamespace.GetTypeDefinition("Base", 1); + nestedClass = baseClass.NestedTypes.Single(t => t.Name == "Nested"); + siblingClass = baseClass.NestedTypes.Single(t => t.Name == "Sibling"); + derivedClass = compilation.RootNamespace.GetTypeDefinition("Derived", 2); + systemClass = compilation.RootNamespace.GetChildNamespace("NS").GetTypeDefinition("System", 0); + } + + void Init(string program) { pc = new CSharpProjectContent(); pc = pc.SetAssemblyName("MyAssembly"); @@ -68,11 +80,6 @@ namespace OtherNS { pc = pc.AddAssemblyReferences(new [] { CecilLoaderTests.Mscorlib }); compilation = pc.CreateCompilation(); - - baseClass = compilation.RootNamespace.GetTypeDefinition("Base", 1); - nestedClass = baseClass.NestedTypes.Single(); - derivedClass = compilation.RootNamespace.GetTypeDefinition("Derived", 2); - systemClass = compilation.RootNamespace.GetChildNamespace("NS").GetTypeDefinition("System", 0); } TypeSystemAstBuilder CreateBuilder(ITypeDefinition currentTypeDef = null) @@ -92,20 +99,10 @@ namespace OtherNS { } [Test] - public void PrimitiveVoid() + public void PrimitiveTypeNames() { Assert.AreEqual("void", TypeToString(compilation.FindType(KnownTypeCode.Void))); - } - - [Test] - public void PrimitiveInt() - { Assert.AreEqual("int", TypeToString(compilation.FindType(KnownTypeCode.Int32))); - } - - [Test] - public void PrimitiveDecimal() - { Assert.AreEqual("decimal", TypeToString(compilation.FindType(KnownTypeCode.Decimal))); } @@ -150,19 +147,26 @@ namespace OtherNS { Assert.AreEqual("L", TypeToString(type, systemClass)); } + [Test] + public void AliasedTypeWrongTypeArgument() + { + var type = new ParameterizedType(compilation.FindType(typeof(List<>)).GetDefinition(), new[] { compilation.FindType(KnownTypeCode.Int32) }); + Assert.AreEqual("List", TypeToString(type, systemClass)); + } + [Test] public void UnboundType() { Assert.AreEqual("Base<>", TypeToString(baseClass)); Assert.AreEqual("Base<>.Nested<>", TypeToString(nestedClass)); - } + } [Test] public void UnboundTypeConvertUnboundTypeArgumentsOption() { Assert.AreEqual("Base", TypeToString(baseClass, null, builder => builder.ConvertUnboundTypeArguments = true)); Assert.AreEqual("Base.Nested", TypeToString(nestedClass, null, builder => builder.ConvertUnboundTypeArguments = true)); - } + } [Test] public void NestedType() @@ -195,6 +199,20 @@ namespace OtherNS { Assert.AreEqual("Nested", TypeToString(type2, derivedClass)); } + [Test] + public void SiblingClass() + { + var type = new ParameterizedType(siblingClass, new[] { baseClass.TypeParameters[0] }); + Assert.AreEqual("Sibling", TypeToString(type, nestedClass)); + } + + [Test] + public void GenericClass() + { + var type = new ParameterizedType(nestedClass, new[] { baseClass.TypeParameters[0], compilation.FindType(KnownTypeCode.String) }); + Assert.AreEqual("Nested", TypeToString(type, siblingClass)); + } + [Test] public void MultidimensionalArray() { @@ -219,5 +237,37 @@ namespace OtherNS { Assert.AreEqual("System.Array", TypeToString(compilation.FindType(typeof(Array)))); Assert.AreEqual("OtherNS.Array", TypeToString(compilation.MainAssembly.GetTypeDefinition(new TopLevelTypeName("OtherNS", "Array")))); } + + [Test] + public void NestedFooCollidingWithProperty_SameType() + { + string program = @"class MainClass { + public enum Foo { Value1, Value2 } + + public class Test { + Foo Foo { get; set; } + } + }"; + Init(program); + var foo = compilation.MainAssembly.GetTypeDefinition(new FullTypeName("MainClass+Foo")); + var test = compilation.MainAssembly.GetTypeDefinition(new FullTypeName("MainClass+Test")); + Assert.AreEqual("Foo", TypeToString(foo, test)); + } + + [Test] + public void NestedFooCollidingWithProperty_DifferentType() + { + string program = @"class MainClass { + public enum Foo { Value1, Value2 } + + public class Test { + int Foo { get; set; } + } + }"; + Init(program); + var foo = compilation.MainAssembly.GetTypeDefinition(new FullTypeName("MainClass+Foo")); + var test = compilation.MainAssembly.GetTypeDefinition(new FullTypeName("MainClass+Test")); + Assert.AreEqual("MainClass.Foo", TypeToString(foo, test)); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ArrayCreateTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ArrayCreateTests.cs index 8f0d437d5e..964ac78330 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ArrayCreateTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ArrayCreateTests.cs @@ -17,6 +17,7 @@ // DEALINGS IN THE SOFTWARE. using System; +using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.TypeSystem; using NUnit.Framework; @@ -111,5 +112,104 @@ class A { var result = Resolve(program); Assert.AreEqual("System.Int32[,]", result.Type.ReflectionName); } + + [Test] + public void SizeArguments2x3() + { + string program = @"using System.Collections.Generic; +class A { + int[,] a = ${ { 1, 2, 3 }, { 4, 5, 6 } }$; +} +"; + var result = Resolve(program); + Assert.AreEqual(6, result.InitializerElements.Count); + Assert.AreEqual(2, result.SizeArguments.Count); + Assert.AreEqual(2, result.SizeArguments[0].ConstantValue); + Assert.AreEqual(3, result.SizeArguments[1].ConstantValue); + } + + [Test] + public void SizeArguments3x2() + { + string program = @"using System.Collections.Generic; +class A { + int[,] a = $new int[,] { { 1, 2 }, { 3, 4 }, { 5, 6 } }$; +} +"; + var result = Resolve(program); + Assert.AreEqual("System.Int32[,]", result.Type.ReflectionName); + Assert.AreEqual(6, result.InitializerElements.Count); + Assert.AreEqual(2, result.SizeArguments.Count); + Assert.AreEqual(3, result.SizeArguments[0].ConstantValue); + Assert.AreEqual(2, result.SizeArguments[1].ConstantValue); + } + + [Test] + public void SizeArguments2xInvalid() + { + string program = @"using System.Collections.Generic; +class A { + int[,] a = ${ { 1, 2, 3 }, { 4, 5 } }$; +} +"; + var result = Resolve(program); + Assert.AreEqual("System.Int32[,]", result.Type.ReflectionName); + Assert.AreEqual(5, result.InitializerElements.Count); + Assert.AreEqual(2, result.SizeArguments.Count); + Assert.AreEqual(2, result.SizeArguments[0].ConstantValue); + Assert.IsTrue(result.SizeArguments[1].IsError); + } + + [Test] + public void SizeArgumentsExplicitSizeInconsistentWithActualSize() + { + string program = @"using System.Collections.Generic; +class A { + int[,] a = $new int[5,6] { { 1, 2, 3 }, { 4, 5, 6 } }$; +} +"; + var result = Resolve(program); + Assert.AreEqual("System.Int32[,]", result.Type.ReflectionName); + Assert.AreEqual(6, result.InitializerElements.Count); + Assert.AreEqual(2, result.SizeArguments.Count); + Assert.AreEqual(5, result.SizeArguments[0].ConstantValue); + Assert.AreEqual(6, result.SizeArguments[1].ConstantValue); + } + + [Test] + public void ArraySizeArgumentConversion() + { + string program = @"using System.Collections.Generic; +class A { + static byte b = 5; + int[] a = new int[$b$]; +} +"; + Assert.AreEqual(Conversion.ImplicitNumericConversion, GetConversion(program)); + } + + [Test] + public void ArrayInitializerConversion() + { + string program = @"using System.Collections.Generic; +class A { + static byte b = 5; + int[] a = new int[] { $b$ }; +} +"; + Assert.AreEqual(Conversion.ImplicitNumericConversion, GetConversion(program)); + } + + [Test] + public void ArrayInitializerConversion2() + { + string program = @"using System.Collections.Generic; +class A { + static byte b = 5; + int[] a = { $b$ }; +} +"; + Assert.AreEqual(Conversion.ImplicitNumericConversion, GetConversion(program)); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ComTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ComTests.cs index 4117240a2a..92e031a08e 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ComTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ComTests.cs @@ -17,6 +17,7 @@ // DEALINGS IN THE SOFTWARE. using System; +using System.Linq; using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.TypeSystem; using NUnit.Framework; @@ -47,5 +48,18 @@ public class Test : Dummy { Assert.AreEqual("Dummy", rr.Type.ReflectionName); Assert.AreEqual(1, rr.Member.Parameters.Count); } + + [Test] + public void CyclicCoClass() + { + string program = @"using System; +using System.Runtime.InteropServices; + +[ComImport, Guid(""698D8281-3890-41A6-8A2F-DBC29CBAB8BC""), CoClass(typeof(Dummy))] +public interface $Dummy { }"; + + var trr = ResolveAtLocation(program); + Assert.AreEqual(0, trr.Type.GetConstructors().Count()); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ConversionsTest.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ConversionsTest.cs index 18b73ae011..836d9c2526 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ConversionsTest.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ConversionsTest.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using ICSharpCode.NRefactory.CSharp.TypeSystem; using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.TypeSystem; @@ -602,5 +603,233 @@ class Test { Assert.AreEqual(C.ImplicitReferenceConversion, GetConversion(program)); } + [Test] + public void MethodGroupConversion_Void() + { + string program = @"using System; +delegate void D(); +class Test { + D d = $M$; + public static void M() {} +}"; + var c = GetConversion(program); + Assert.IsTrue(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + Assert.IsNotNull(c.Method); + } + + [Test] + public void MethodGroupConversion_MatchingSignature() + { + string program = @"using System; +delegate object D(int argument); +class Test { + D d = $M$; + public static object M(int argument) {} +}"; + var c = GetConversion(program); + Assert.IsTrue(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + } + + [Test] + public void MethodGroupConversion_InvalidReturnType() + { + string program = @"using System; +delegate object D(int argument); +class Test { + D d = $M$; + public static int M(int argument) {} +}"; + var c = GetConversion(program); + Assert.IsFalse(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + } + + [Test] + public void MethodGroupConversion_CovariantReturnType() + { + string program = @"using System; +delegate object D(int argument); +class Test { + D d = $M$; + public static string M(int argument) {} +}"; + var c = GetConversion(program); + Assert.IsTrue(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + } + + [Test] + public void MethodGroupConversion_RefArgumentTypesEqual() + { + string program = @"using System; +delegate void D(ref object o); +class Test { + D d = $M$; + public static void M(ref object o) {} +}"; + var c = GetConversion(program); + Assert.IsTrue(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + } + + [Test] + public void MethodGroupConversion_RefArgumentObjectVsDynamic() + { + string program = @"using System; +delegate void D(ref object o); +class Test { + D d = $M$; + public static void M(ref dynamic o) {} +}"; + var c = GetConversion(program); + Assert.IsFalse(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + } + + [Test] + public void MethodGroupConversion_RefVsOut() + { + string program = @"using System; +delegate void D(ref object o); +class Test { + D d = $M$; + public static void M(out object o) {} +}"; + var c = GetConversion(program); + Assert.IsFalse(c.IsValid); + } + + [Test] + public void MethodGroupConversion_RefVsNormal() + { + string program = @"using System; +delegate void D(ref object o); +class Test { + D d = $M$; + public static void M(object o) {} +}"; + var c = GetConversion(program); + Assert.IsFalse(c.IsValid); + } + + [Test] + public void MethodGroupConversion_NormalVsOut() + { + string program = @"using System; +delegate void D(object o); +class Test { + D d = $M$; + public static void M(out object o) {} +}"; + var c = GetConversion(program); + Assert.IsFalse(c.IsValid); + } + + [Test] + public void MethodGroupConversion_MatchingNormalParameter() + { + string program = @"using System; +delegate void D(object o); +class Test { + D d = $M$; + public static void M(object o) {} +}"; + var c = GetConversion(program); + Assert.IsTrue(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + } + + [Test] + public void MethodGroupConversion_IdentityConversion() + { + string program = @"using System; +delegate void D(object o); +class Test { + D d = $M$; + public static void M(dynamic o) {} +}"; + var c = GetConversion(program); + Assert.IsTrue(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + } + + [Test] + public void MethodGroupConversion_Contravariance() + { + string program = @"using System; +delegate void D(string o); +class Test { + D d = $M$; + public static void M(object o) {} +}"; + var c = GetConversion(program); + Assert.IsTrue(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + + } + + [Test, Ignore("Not sure if this conversion should be valid or not... NR and mcs both accept it as valid, csc treats it as invalid")] + public void MethodGroupConversion_NoContravarianceDynamic() + { + string program = @"using System; +delegate void D(string o); +class Test { + D d = $M$; + public static void M(dynamic o) {} +}"; + var c = GetConversion(program); + //Assert.IsFrue(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + } + + [Test] + public void MethodGroupConversion_ExactMatchIsBetter() + { + string program = @"using System; +class Test { + delegate void D(string a); + D d = $M$; + static void M(object x) {} + static void M(string x = null) {} +}"; + var c = GetConversion(program); + Assert.IsTrue(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + Assert.AreEqual("System.String", c.Method.Parameters.Single().Type.FullName); + } + + [Test] + public void MethodGroupConversion_CannotLeaveOutOptionalParameters() + { + string program = @"using System; +class Test { + delegate void D(string a); + D d = $M$; + static void M(object x) {} + static void M(string x, string y = null) {} +}"; + var c = GetConversion(program); + Assert.IsTrue(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + Assert.AreEqual("System.Object", c.Method.Parameters.Single().Type.FullName); + } + + [Test] + public void MethodGroupConversion_CannotUseExpandedParams() + { + string program = @"using System; +class Test { + delegate void D(string a); + D d = $M$; + static void M(object x) {} + static void M(params string[] x) {} +}"; + var c = GetConversion(program); + Assert.IsTrue(c.IsValid); + Assert.IsTrue(c.IsMethodGroupConversion); + Assert.AreEqual("System.Object", c.Method.Parameters.Single().Type.FullName); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/FindReferencesTest.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/FindReferencesTest.cs index 87cf3cc3cf..6fc077d250 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/FindReferencesTest.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/FindReferencesTest.cs @@ -211,5 +211,63 @@ class Calls { Assert.IsTrue(actual.Any(r => r.StartLocation.Line == 9 && r is InvocationExpression)); } #endregion + + #region Await + const string awaitTest = @"using System; +class MyAwaiter { + public bool IsCompleted { get { return false; } } + public void OnCompleted(Action continuation) {} + public int GetResult() { return 0; } +} +class MyAwaitable { + public MyAwaiter GetAwaiter() { return null; } +} +public class C { + public async void M() { + MyAwaitable x = null; + int i = await x; + } +}"; + + [Test] + public void GetAwaiterReferenceInAwaitExpressionIsFound() { + Init(awaitTest); + var test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == "MyAwaitable"); + var method = test.Methods.Single(m => m.Name == "GetAwaiter"); + var actual = FindReferences(method).ToList(); + Assert.IsTrue(actual.Any(r => r.StartLocation.Line == 8 && r is MethodDeclaration)); + Assert.IsTrue(actual.Any(r => r.StartLocation.Line == 13 && r is UnaryOperatorExpression)); + } + + [Test] + public void GetResultReferenceInAwaitExpressionIsFound() { + Init(awaitTest); + var test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == "MyAwaiter"); + var method = test.Methods.Single(m => m.Name == "GetResult"); + var actual = FindReferences(method).ToList(); + Assert.IsTrue(actual.Any(r => r.StartLocation.Line == 5 && r is MethodDeclaration)); + Assert.IsTrue(actual.Any(r => r.StartLocation.Line == 13 && r is UnaryOperatorExpression)); + } + + [Test] + public void OnCompletedReferenceInAwaitExpressionIsFound() { + Init(awaitTest); + var test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == "MyAwaiter"); + var method = test.Methods.Single(m => m.Name == "OnCompleted"); + var actual = FindReferences(method).ToList(); + Assert.IsTrue(actual.Any(r => r.StartLocation.Line == 4 && r is MethodDeclaration)); + Assert.IsTrue(actual.Any(r => r.StartLocation.Line == 13 && r is UnaryOperatorExpression)); + } + + [Test] + public void IsCompletedReferenceInAwaitExpressionIsFound() { + Init(awaitTest); + var test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == "MyAwaiter"); + var property = test.Properties.Single(m => m.Name == "IsCompleted"); + var actual = FindReferences(property).ToList(); + Assert.IsTrue(actual.Any(r => r.StartLocation.Line == 3 && r is PropertyDeclaration)); + Assert.IsTrue(actual.Any(r => r.StartLocation.Line == 13 && r is UnaryOperatorExpression)); + } + #endregion } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/MethodTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/MethodTests.cs index 0e26185351..061fba8bc8 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/MethodTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/MethodTests.cs @@ -22,7 +22,7 @@ using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.TypeSystem; using NUnit.Framework; -namespace ICSharpCode.NRefactory.CSharp.Resolver +namespace ICSharpCode.NRefactory.CSharp.Resolver { [TestFixture] public class MethodTests : ResolverTestBase @@ -225,5 +225,21 @@ class TestClass { Assert.IsTrue(ReferenceEquals(value1, value2)); } + + [Test] + public void MethodWithInvalidCastInDefaultValue() + { + var input = @" +class TestClass +{ + void TestMethod ($int x = true$) + { + } +}"; + var rr = Resolve(input); + IParameter p = (IParameter)rr.Variable; + Assert.IsTrue(p.IsOptional); + Assert.IsNull(p.ConstantValue); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/NameLookupTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/NameLookupTests.cs index 4669356f58..9eda66f4ba 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/NameLookupTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/NameLookupTests.cs @@ -1065,5 +1065,33 @@ namespace foo { var method = a.Methods.Single(m => m.Name == "M"); Assert.AreEqual("A.B", method.TypeParameters.Single().DirectBaseTypes.Single().FullName); } + + [Test] + public void EmptyNamespaces() + { + // should maybe a typesystem test - but empty namespaces don't make sense in cecil. + string program = @"namespace A.B.C.D +{ + +} + +namespace Test +{ + using $A.B.C.D$; + + public class C + { + public static void Main () + { + + } + } +} + + "; + var nrr = Resolve(program); + Assert.AreEqual("A.B.C.D", nrr.NamespaceName); + } + } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/UnaryOperatorTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/UnaryOperatorTests.cs index a87aa6d0f6..2039011f9d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/UnaryOperatorTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/UnaryOperatorTests.cs @@ -274,5 +274,371 @@ class Test { Assert.IsFalse(rr.IsError); Assert.AreEqual(unchecked( (ushort)~3 ), rr.ConstantValue); } + + [Test] + public void Await() { + string program = @" +using System; +class MyAwaiter { + public bool IsCompleted { get { return false; } } + public void OnCompleted(Action continuation) {} + public int GetResult() { return 0; } +} +class MyAwaitable { + public MyAwaiter GetAwaiter() { return null; } + public MyAwaiter GetAwaiter(int i) { return null; } +} +public class C { + public async void M() { + MyAwaitable x = null; + int i = $await x$; + } +}"; + + var rr = Resolve(program); + Assert.IsFalse(rr.IsError); + Assert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32)); + Assert.IsInstanceOf(rr.GetAwaiterInvocation); + var getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation; + Assert.IsFalse(rr.GetAwaiterInvocation.IsError); + Assert.AreEqual(0, getAwaiterInvocation.Arguments.Count); + Assert.AreEqual("MyAwaitable.GetAwaiter", getAwaiterInvocation.Member.FullName); + Assert.AreEqual(0, getAwaiterInvocation.Member.Parameters.Count); + + Assert.AreEqual("MyAwaiter", rr.AwaiterType.FullName); + + Assert.IsNotNull(rr.IsCompletedProperty); + Assert.AreEqual("MyAwaiter.IsCompleted", rr.IsCompletedProperty.FullName); + + Assert.IsNotNull(rr.OnCompletedMethod); + Assert.AreEqual("MyAwaiter.OnCompleted", rr.OnCompletedMethod.FullName); + + Assert.IsNotNull(rr.GetResultMethod); + Assert.AreEqual("MyAwaiter.GetResult", rr.GetResultMethod.FullName); + } + + [Test] + public void AwaitWhenGetAwaiterIsAnExtensionMethod() { + string program = @" +using System; +namespace N { + class MyAwaiter { + public bool IsCompleted { get { return false; } } + public void OnCompleted(Action continuation) {} + public int GetResult() { return 0; } + } + class MyAwaitable { + } + static class MyAwaitableExtensions { + public static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; } + } + public class C { + public async void M() { + MyAwaitable x = null; + int i = $await x$; + } + } +}"; + + var rr = Resolve(program); + Assert.IsFalse(rr.IsError); + Assert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32)); + Assert.IsInstanceOf(rr.GetAwaiterInvocation); + var getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation; + Assert.IsFalse(rr.GetAwaiterInvocation.IsError); + Assert.AreEqual(1, getAwaiterInvocation.Arguments.Count); + Assert.AreEqual("N.MyAwaitableExtensions.GetAwaiter", getAwaiterInvocation.Member.FullName); + Assert.AreEqual(1, getAwaiterInvocation.Member.Parameters.Count); + Assert.IsTrue(getAwaiterInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)getAwaiterInvocation.Arguments[0]).Variable.Name == "x"); + + Assert.AreEqual("N.MyAwaiter", rr.AwaiterType.FullName); + + Assert.IsNotNull(rr.IsCompletedProperty); + Assert.AreEqual("N.MyAwaiter.IsCompleted", rr.IsCompletedProperty.FullName); + + Assert.IsNotNull(rr.OnCompletedMethod); + Assert.AreEqual("N.MyAwaiter.OnCompleted", rr.OnCompletedMethod.FullName); + + Assert.IsNotNull(rr.GetResultMethod); + Assert.AreEqual("N.MyAwaiter.GetResult", rr.GetResultMethod.FullName); + } + + [Test, Ignore("TODO: MS C# (at least the RC version) refuses to use default values in GetAwaiter(). I do not know, however, if this is by design, and I could not find a simple, nice way to do the implementation")] + public void GetAwaiterMethodWithDefaultArgumentCannotBeUsed() { + string program = @" +using System; +class MyAwaiter { + public bool IsCompleted { get { return false; } } + public void OnCompleted(Action continuation) {} + public int GetResult() { return 0; } +} +class MyAwaitable { + public MyAwaiter GetAwaiter(int i = 0) { return null; } +} +public class C { + public async void M() { + MyAwaitable x = null; + int i = $await x$; + } +}"; + + var rr = Resolve(program); + Assert.IsFalse(rr.IsError); + Assert.AreEqual(SpecialType.UnknownType, rr.Type); + Assert.IsInstanceOf(rr.GetAwaiterInvocation); + Assert.IsTrue(rr.GetAwaiterInvocation.IsError); + + Assert.AreEqual(rr.AwaiterType, SpecialType.UnknownType); + + Assert.IsNull(rr.IsCompletedProperty); + Assert.IsNull(rr.OnCompletedMethod); + Assert.IsNull(rr.GetResultMethod); + } + + [Test, Ignore("TODO: MS C# (at least the RC version) refuses to use default values in GetAwaiter(). I do not know, however, if this is by design, and I could not find a simple, nice way to do the implementation")] + public void GetAwaiterMethodWithDefaultArgumentHidesExtensionMethodAndResultsInError() { + string program = @" +using System; +namespace N { + class MyAwaiter { + public bool IsCompleted { get { return false; } } + public void OnCompleted(Action continuation) {} + public int GetResult() { return 0; } + } + class MyAwaitable { + public MyAwaiter GetAwaiter(int i = 0) { return null; } + } + static class MyAwaitableExtensions { + public static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; } + } + public class C { + public async void M() { + MyAwaitable x = null; + int i = $await x$; + } + } +}"; + + var rr = Resolve(program); + Assert.IsFalse(rr.IsError); + Assert.AreEqual(SpecialType.UnknownType, rr.Type); + Assert.IsInstanceOf(rr.GetAwaiterInvocation); + Assert.IsTrue(rr.GetAwaiterInvocation.IsError); + + Assert.AreEqual(rr.AwaiterType, SpecialType.UnknownType); + + Assert.IsNull(rr.IsCompletedProperty); + Assert.IsNull(rr.OnCompletedMethod); + Assert.IsNull(rr.GetResultMethod); + } + + [Test] + public void GetAwaiterMethodWithArgumentDoesNotHideExtensionMethod() { + string program = @" +using System; +namespace N { + class MyAwaiter { + public bool IsCompleted { get { return false; } } + public void OnCompleted(Action continuation) {} + public int GetResult() { return 0; } + } + class MyAwaitable { + public static MyAwaiter GetAwaiter(int i) { return null; } + } + static class MyAwaitableExtensions { + public static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; } + } + public class C { + public async void M() { + MyAwaitable x = null; + int i = $await x$; + } + } +}"; + + var rr = Resolve(program); + Assert.IsFalse(rr.IsError); + Assert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32)); + Assert.IsInstanceOf(rr.GetAwaiterInvocation); + var getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation; + Assert.IsFalse(rr.GetAwaiterInvocation.IsError); + Assert.AreEqual(1, getAwaiterInvocation.Arguments.Count); + Assert.AreEqual("N.MyAwaitableExtensions.GetAwaiter", getAwaiterInvocation.Member.FullName); + Assert.AreEqual(1, getAwaiterInvocation.Member.Parameters.Count); + Assert.IsTrue(getAwaiterInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)getAwaiterInvocation.Arguments[0]).Variable.Name == "x"); + + Assert.AreEqual("N.MyAwaiter", rr.AwaiterType.FullName); + + Assert.IsNotNull(rr.IsCompletedProperty); + Assert.AreEqual("N.MyAwaiter.IsCompleted", rr.IsCompletedProperty.FullName); + + Assert.IsNotNull(rr.OnCompletedMethod); + Assert.AreEqual("N.MyAwaiter.OnCompleted", rr.OnCompletedMethod.FullName); + + Assert.IsNotNull(rr.GetResultMethod); + Assert.AreEqual("N.MyAwaiter.GetResult", rr.GetResultMethod.FullName); + } + + [Test] + public void AwaiterWithNoSuitableGetResult() { + string program = @" +using System; +namespace N { + class MyAwaiter { + public bool IsCompleted { get { return false; } } + public void OnCompleted(Action continuation) {} + public int GetResult(int i) { return 0; } + } + class MyAwaitable { + public static MyAwaiter GetAwaiter(int i) { return null; } + } + static class MyAwaitableExtensions { + public static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; } + } + public class C { + public async void M() { + MyAwaitable x = null; + int i = $await x$; + } + } +}"; + + var rr = Resolve(program); + Assert.IsTrue(rr.IsError); + Assert.AreEqual(SpecialType.UnknownType, rr.Type); + Assert.IsInstanceOf(rr.GetAwaiterInvocation); + var getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation; + Assert.IsFalse(rr.GetAwaiterInvocation.IsError); + Assert.AreEqual(1, getAwaiterInvocation.Arguments.Count); + Assert.AreEqual("N.MyAwaitableExtensions.GetAwaiter", getAwaiterInvocation.Member.FullName); + Assert.AreEqual(1, getAwaiterInvocation.Member.Parameters.Count); + Assert.IsTrue(getAwaiterInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)getAwaiterInvocation.Arguments[0]).Variable.Name == "x"); + + Assert.AreEqual("N.MyAwaiter", rr.AwaiterType.FullName); + + Assert.IsNotNull(rr.IsCompletedProperty); + Assert.AreEqual("N.MyAwaiter.IsCompleted", rr.IsCompletedProperty.FullName); + + Assert.IsNotNull(rr.OnCompletedMethod); + Assert.AreEqual("N.MyAwaiter.OnCompleted", rr.OnCompletedMethod.FullName); + + Assert.IsNull(rr.GetResultMethod); + } + + [Test] + public void AwaiterWithNoIsCompletedProperty() { + string program = @" +using System; +namespace N { + class MyAwaiter { + public bool IsCompleted() { return false; } + public void OnCompleted(Action continuation) {} + public int GetResult(int i) { return 0; } + } + class MyAwaitable { + public static MyAwaiter GetAwaiter(int i) { return null; } + } + static class MyAwaitableExtensions { + public static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; } + } + public class C { + public async void M() { + MyAwaitable x = null; + int i = $await x$; + } + } +}"; + + var rr = Resolve(program); + Assert.IsTrue(rr.IsError); + Assert.AreEqual(SpecialType.UnknownType, rr.Type); + Assert.IsInstanceOf(rr.GetAwaiterInvocation); + var getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation; + Assert.IsFalse(rr.GetAwaiterInvocation.IsError); + Assert.AreEqual(1, getAwaiterInvocation.Arguments.Count); + Assert.AreEqual("N.MyAwaitableExtensions.GetAwaiter", getAwaiterInvocation.Member.FullName); + Assert.AreEqual(1, getAwaiterInvocation.Member.Parameters.Count); + Assert.IsTrue(getAwaiterInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)getAwaiterInvocation.Arguments[0]).Variable.Name == "x"); + + Assert.AreEqual("N.MyAwaiter", rr.AwaiterType.FullName); + + Assert.IsNull(rr.IsCompletedProperty); + + Assert.IsNotNull(rr.OnCompletedMethod); + Assert.AreEqual("N.MyAwaiter.OnCompleted", rr.OnCompletedMethod.FullName); + + Assert.IsNull(rr.GetResultMethod); + } + + [Test] + public void AwaiterWithNoOnCompletedMethodWithSuitableSignature() { + string program = @" +using System; +class MyAwaiter { + public bool IsCompleted { get { return false; } } + public void OnCompleted(Func continuation) {} + public int GetResult() { return 0; } +} +class MyAwaitable { + public MyAwaiter GetAwaiter() { return null; } + public MyAwaiter GetAwaiter(int i) { return null; } +} +public class C { + public async void M() { + MyAwaitable x = null; + int i = $await x$; + } +}"; + + var rr = Resolve(program); + Assert.IsTrue(rr.IsError); + Assert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32)); + Assert.IsInstanceOf(rr.GetAwaiterInvocation); + var getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation; + Assert.IsFalse(rr.GetAwaiterInvocation.IsError); + Assert.AreEqual(0, getAwaiterInvocation.Arguments.Count); + Assert.AreEqual("MyAwaitable.GetAwaiter", getAwaiterInvocation.Member.FullName); + Assert.AreEqual(0, getAwaiterInvocation.Member.Parameters.Count); + + Assert.AreEqual("MyAwaiter", rr.AwaiterType.FullName); + + Assert.IsNotNull(rr.IsCompletedProperty); + Assert.AreEqual("MyAwaiter.IsCompleted", rr.IsCompletedProperty.FullName); + + Assert.IsNull(rr.OnCompletedMethod); + + Assert.IsNotNull(rr.GetResultMethod); + Assert.AreEqual("MyAwaiter.GetResult", rr.GetResultMethod.FullName); + } + + [Test] + public void AwaitDynamic() { + string program = @" +public class C { + public async void M() { + dynamic x = null; + int i = $await x$; + } +}"; + + var rr = Resolve(program); + Assert.IsFalse(rr.IsError); + Assert.AreEqual(SpecialType.Dynamic, rr.Type); + Assert.IsInstanceOf(rr.GetAwaiterInvocation); + var getAwaiterInvocation = (DynamicInvocationResolveResult)rr.GetAwaiterInvocation; + Assert.IsFalse(rr.GetAwaiterInvocation.IsError); + Assert.AreEqual(DynamicInvocationType.Invocation, getAwaiterInvocation.InvocationType); + Assert.AreEqual(0, getAwaiterInvocation.Arguments.Count); + Assert.IsInstanceOf(getAwaiterInvocation.Target); + var target = (DynamicMemberResolveResult)getAwaiterInvocation.Target; + Assert.IsInstanceOf(target.Target); + Assert.AreEqual("GetAwaiter", target.Member); + + Assert.AreEqual(SpecialType.Dynamic, rr.AwaiterType); + + Assert.IsNull(rr.IsCompletedProperty); + Assert.IsNull(rr.OnCompletedMethod); + Assert.IsNull(rr.GetResultMethod); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj index f738c7aa97..f4296dd82b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj @@ -360,6 +360,7 @@ + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.cs index 95c5d0881d..aa5e474033 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.cs @@ -794,6 +794,8 @@ namespace ICSharpCode.NRefactory.TypeSystem ITypeDefinition type = GetTypeDefinition(typeof(ParamsAttribute)); var arr = (ArrayCreateResolveResult)type.Attributes.Single().PositionalArguments.Single(); Assert.AreEqual(5, arr.InitializerElements.Count); + Assert.AreEqual(1, arr.SizeArguments.Count); + Assert.AreEqual(5, arr.SizeArguments[0].ConstantValue); return arr.InitializerElements[index]; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Semantics/ArrayCreateResolveResult.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Semantics/ArrayCreateResolveResult.cs index 9eb24e834b..8bba97cd4f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Semantics/ArrayCreateResolveResult.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Semantics/ArrayCreateResolveResult.cs @@ -43,16 +43,18 @@ namespace ICSharpCode.NRefactory.Semantics public ArrayCreateResolveResult(IType arrayType, IList sizeArguments, IList initializerElements) : base(arrayType) { + if (sizeArguments == null) + throw new ArgumentNullException("sizeArguments"); this.SizeArguments = sizeArguments; this.InitializerElements = initializerElements; } public override IEnumerable GetChildResults() { - if (SizeArguments != null && InitializerElements != null) + if (InitializerElements != null) return SizeArguments.Concat(InitializerElements); else - return SizeArguments ?? InitializerElements ?? EmptyList.Instance; + return SizeArguments; } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Semantics/Conversion.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Semantics/Conversion.cs index fc5889d55f..12acbd0592 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Semantics/Conversion.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Semantics/Conversion.cs @@ -92,7 +92,14 @@ namespace ICSharpCode.NRefactory.Semantics { if (chosenMethod == null) throw new ArgumentNullException("chosenMethod"); - return new MethodGroupConv(chosenMethod, isVirtualMethodLookup); + return new MethodGroupConv(chosenMethod, isVirtualMethodLookup, isValid: true); + } + + public static Conversion InvalidMethodGroupConversion(IMethod chosenMethod, bool isVirtualMethodLookup) + { + if (chosenMethod == null) + throw new ArgumentNullException("chosenMethod"); + return new MethodGroupConv(chosenMethod, isVirtualMethodLookup, isValid: false); } #endregion @@ -311,11 +318,17 @@ namespace ICSharpCode.NRefactory.Semantics { readonly IMethod method; readonly bool isVirtualMethodLookup; + readonly bool isValid; - public MethodGroupConv(IMethod method, bool isVirtualMethodLookup) + public MethodGroupConv(IMethod method, bool isVirtualMethodLookup, bool isValid) { this.method = method; this.isVirtualMethodLookup = isVirtualMethodLookup; + this.isValid = isValid; + } + + public override bool IsValid { + get { return isValid; } } public override bool IsImplicit { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs index 32c15308ec..b4cbf9a2a2 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs @@ -1169,7 +1169,9 @@ namespace ICSharpCode.NRefactory.TypeSystem if (elements[i].IsError) return ErrorResolveResult.UnknownError; } - return new ArrayCreateResolveResult(argType, null, elements); + IType int32 = currentResolvedAssembly.Compilation.FindType(KnownTypeCode.Int32); + ResolveResult[] sizeArgs = { new ConstantResolveResult(int32, elements.Length) }; + return new ArrayCreateResolveResult(argType, sizeArgs, elements); } } else { return ReadElem(argType); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultResolvedField.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultResolvedField.cs index ba26e24cb8..38d7446791 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultResolvedField.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultResolvedField.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using ICSharpCode.NRefactory.Semantics; +using ICSharpCode.NRefactory.Utils; namespace ICSharpCode.NRefactory.TypeSystem.Implementation { @@ -51,12 +52,17 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation get { ResolveResult rr = this.constantValue; if (rr == null) { - IConstantValue unresolvedCV = ((IUnresolvedField)unresolved).ConstantValue; - if (unresolvedCV != null) - rr = unresolvedCV.Resolve(context); - else - rr = ErrorResolveResult.UnknownError; - this.constantValue = rr; + using (var busyLock = BusyManager.Enter(this)) { + if (!busyLock.Success) + return null; + + IConstantValue unresolvedCV = ((IUnresolvedField)unresolved).ConstantValue; + if (unresolvedCV != null) + rr = unresolvedCV.Resolve(context); + else + rr = ErrorResolveResult.UnknownError; + this.constantValue = rr; + } } return rr.ConstantValue; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleInterningProvider.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleInterningProvider.cs index b6af392a9b..b73a21b210 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleInterningProvider.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleInterningProvider.cs @@ -87,12 +87,14 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation if (obj == null) return null; + // ensure objects are frozen when we put them into the dictionary + // note that Freeze may change the hash code of the object + FreezableHelper.Freeze(obj); + ISupportsInterning output; if (supportsInternDict.TryGetValue(obj, out output)) { return output; } else { - // ensure objects are frozen when we put them into the dictionary - FreezableHelper.Freeze(obj); supportsInternDict.Add(obj, obj); return obj; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Utils/CSharpPrimitiveCast.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Utils/CSharpPrimitiveCast.cs index 52ca8c7dd0..cbd633e0a0 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Utils/CSharpPrimitiveCast.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Utils/CSharpPrimitiveCast.cs @@ -32,6 +32,8 @@ namespace ICSharpCode.NRefactory.Utils /// and let the compiler figure out the exact semantics. /// And we have to do everything twice, once in a checked-block, once in an unchecked-block. /// + /// Overflow checking is enabled and an overflow occurred. + /// The cast is invalid, e.g. casting a boolean to an integer. public static object Cast(TypeCode targetType, object input, bool checkForOverflow) { if (input == null)