diff --git a/SharpDevelop.Tests.sln b/SharpDevelop.Tests.sln index 6a3094b7fe..5f0aa86876 100644 --- a/SharpDevelop.Tests.sln +++ b/SharpDevelop.Tests.sln @@ -290,10 +290,10 @@ Global {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.Build.0 = net_4_0_Release|Any CPU - {6222A3A1-83CE-47A3-A4E4-A018F82D44D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6222A3A1-83CE-47A3-A4E4-A018F82D44D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6222A3A1-83CE-47A3-A4E4-A018F82D44D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6222A3A1-83CE-47A3-A4E4-A018F82D44D8}.Release|Any CPU.Build.0 = Release|Any CPU + {6222A3A1-83CE-47A3-A4E4-A018F82D44D8}.Debug|Any CPU.ActiveCfg = Debug|WithNRefactory + {6222A3A1-83CE-47A3-A4E4-A018F82D44D8}.Debug|Any CPU.Build.0 = Debug|WithNRefactory + {6222A3A1-83CE-47A3-A4E4-A018F82D44D8}.Release|Any CPU.ActiveCfg = Release|WithNRefactory + {6222A3A1-83CE-47A3-A4E4-A018F82D44D8}.Release|Any CPU.Build.0 = Release|WithNRefactory {3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU {3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU {3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU @@ -322,10 +322,10 @@ Global {2FF700C2-A38A-48BD-A637-8CAFD4FE6237}.Debug|Any CPU.Build.0 = Debug|Any CPU {2FF700C2-A38A-48BD-A637-8CAFD4FE6237}.Release|Any CPU.ActiveCfg = Release|Any CPU {2FF700C2-A38A-48BD-A637-8CAFD4FE6237}.Release|Any CPU.Build.0 = Release|Any CPU - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|Any CPU.Build.0 = Release|Any CPU + {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.ActiveCfg = Debug|WithNRefactory + {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.Build.0 = Debug|WithNRefactory + {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|Any CPU.ActiveCfg = Release|WithNRefactory + {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|Any CPU.Build.0 = Release|WithNRefactory {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Debug|Any CPU.Build.0 = Debug|Any CPU {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/SharpDevelop.sln b/SharpDevelop.sln index 681b50ed21..6f14419d1f 100644 --- a/SharpDevelop.sln +++ b/SharpDevelop.sln @@ -263,10 +263,10 @@ Global {2FF700C2-A38A-48BD-A637-8CAFD4FE6237}.Debug|Any CPU.Build.0 = Debug|Any CPU {2FF700C2-A38A-48BD-A637-8CAFD4FE6237}.Release|Any CPU.ActiveCfg = Release|Any CPU {2FF700C2-A38A-48BD-A637-8CAFD4FE6237}.Release|Any CPU.Build.0 = Release|Any CPU - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|Any CPU.Build.0 = Release|Any CPU + {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.ActiveCfg = Debug|WithNRefactory + {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.Build.0 = Debug|WithNRefactory + {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|Any CPU.ActiveCfg = Release|WithNRefactory + {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|Any CPU.Build.0 = Release|WithNRefactory {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Debug|Any CPU.Build.0 = Debug|Any CPU {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageMethodElement.cs b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageMethodElement.cs index 3b19dba9b2..9f47b35148 100644 --- a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageMethodElement.cs +++ b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageMethodElement.cs @@ -58,6 +58,7 @@ namespace ICSharpCode.CodeCoverage public string FileID { get; private set; } public string FileName { get; private set; } + public string FileNameExt { get; private set; } public bool IsVisited { get; private set; } public int CyclomaticComplexity { get; private set; } public decimal SequenceCoverage { get; private set; } @@ -86,9 +87,14 @@ namespace ICSharpCode.CodeCoverage this.FileID = GetFileRef(); this.FileName = String.Empty; + this.FileNameExt = String.Empty; if (!String.IsNullOrEmpty(this.FileID)) { if (results != null) { this.FileName = results.GetFileName(this.FileID); + try { + this.FileNameExt = Path.GetExtension(this.FileName).ToLowerInvariant(); + } + catch {} if (cacheFileName != this.FileName) { cacheFileName = this.FileName; cacheDocument = GetSource (cacheFileName); @@ -220,14 +226,19 @@ namespace ICSharpCode.CodeCoverage // -> this method SP with lowest Line/Column void getBodyStartSP() { if (this.SequencePoints.Count != 0) { - foreach (CodeCoverageSequencePoint sp in this.SequencePoints) { - if (sp.FileID != this.FileID) continue; - if (this.BodyStartSP == null || (sp.Line < this.BodyStartSP.Line) || - (sp.Line == this.BodyStartSP.Line && sp.Column < this.BodyStartSP.Column) - ) { - this.BodyStartSP = sp; + if (this.FileNameExt == ".cs") { + foreach (CodeCoverageSequencePoint sp in this.SequencePoints) { + if (sp.FileID != this.FileID) continue; + if (this.BodyStartSP == null || (sp.Line < this.BodyStartSP.Line) || + (sp.Line == this.BodyStartSP.Line && sp.Column < this.BodyStartSP.Column) + ) { + this.BodyStartSP = sp; + } } } + else { + this.BodyStartSP = this.SequencePoints.First(); + } } } @@ -236,29 +247,34 @@ namespace ICSharpCode.CodeCoverage // and lowest Offset (when duplicated bw ccrewrite) void getBodyFinalSP() { if (this.SequencePoints.Count != 0) { - for (int i = this.SequencePoints.Count-1; i > 0; i--) { - var sp = this.SequencePoints[i]; - if (sp.FileID != this.FileID) continue; - if (sp.Content != "}") continue; - if (this.BodyFinalSP == null || (sp.Line > this.BodyFinalSP.Line) || - (sp.Line == this.BodyFinalSP.Line && sp.Column >= this.BodyFinalSP.Column) - ) { - // ccrewrite ContractClass/ContractClassFor - // adds duplicate method end-sequence-point "}" - // - // Take duplicate BodyFinalSP with lower Offset - // Because IL.Offset of second duplicate - // will extend branch coverage of this method - // by coverage of ContractClassFor inserted SequencePoint! - if (this.BodyFinalSP != null && - sp.Line == this.BodyFinalSP.Line && - sp.Column == this.BodyFinalSP.Column && - sp.Offset < this.BodyFinalSP.Offset) { - this.SequencePoints.Remove(this.BodyFinalSP); // remove duplicate + if (this.FileNameExt == ".cs") { + for (int i = this.SequencePoints.Count-1; i > 0; i--) { + var sp = this.SequencePoints[i]; + if (sp.FileID != this.FileID) continue; + if (sp.Content != "}") continue; + if (this.BodyFinalSP == null || (sp.Line > this.BodyFinalSP.Line) || + (sp.Line == this.BodyFinalSP.Line && sp.Column >= this.BodyFinalSP.Column) + ) { + // ccrewrite ContractClass/ContractClassFor + // adds duplicate method end-sequence-point "}" + // + // Take duplicate BodyFinalSP with lower Offset + // Because IL.Offset of second duplicate + // will extend branch coverage of this method + // by coverage of ContractClassFor inserted SequencePoint! + if (this.BodyFinalSP != null && + sp.Line == this.BodyFinalSP.Line && + sp.Column == this.BodyFinalSP.Column && + sp.Offset < this.BodyFinalSP.Offset) { + this.SequencePoints.Remove(this.BodyFinalSP); // remove duplicate + } + this.BodyFinalSP = sp; } - this.BodyFinalSP = sp; } } + else { + this.BodyFinalSP = this.SequencePoints.Last(); + } } } @@ -273,6 +289,9 @@ namespace ICSharpCode.CodeCoverage return 0; } + const string @assert = "Assert"; + const string @contract = "Contract"; + void GetBranchRatio () { this.BranchCoverageRatio = null; @@ -295,31 +314,33 @@ namespace ICSharpCode.CodeCoverage // SequencePoint is visited and belongs to this method? if (sp.VisitCount != 0 && sp.FileID == this.FileID) { - // Don't want branch coverage of ccrewrite(n) - // SequencePoint's with offset before and after method body - if (sp.Offset < BodyStartSP.Offset || - sp.Offset > BodyFinalSP.Offset) { - sp.BranchCoverage = true; - continue; // skip - } + if (this.FileNameExt == ".cs") { + // Only for C# - // 1) Generated "in" code for IEnumerables contains hidden "try/catch/finally" branches that - // one do not want or cannot cover by test-case because is handled earlier at same method. - // ie: NullReferenceException in foreach loop is pre-handled at method entry, ie. by Contract.Require(items!=null) - // 2) Branches within sequence points "{" and "}" are not source branches but compiler generated branches - // ie: static methods start sequence point "{" contains compiler generated branches - // 3) Exclude Contract class (EnsuresOnThrow/Assert/Assume is inside method body) - // 4) Exclude NUnit Assert(.Throws) class - const string assert = "Assert"; - const string contract = "Contract"; - if (sp.Content == "in" || sp.Content == "{" || sp.Content == "}" || - sp.Content.StartsWith(assert + ".", StringComparison.Ordinal) || - sp.Content.StartsWith(assert + " ", StringComparison.Ordinal) || - sp.Content.StartsWith(contract + ".", StringComparison.Ordinal) || - sp.Content.StartsWith(contract + " ", StringComparison.Ordinal) - ) { - sp.BranchCoverage = true; - continue; // skip + // Don't want branch coverage of ccrewrite(n) + // SequencePoint(s) with offset before and after method body + if (sp.Offset < BodyStartSP.Offset || + sp.Offset > BodyFinalSP.Offset) { + sp.BranchCoverage = true; + continue; // skip + } + + // 1) Generated "in" code for IEnumerables contains hidden "try/catch/finally" branches that + // one do not want or cannot cover by test-case because is handled earlier at same method. + // ie: NullReferenceException in foreach loop is pre-handled at method entry, ie. by Contract.Require(items!=null) + // 2) Branches within sequence points "{" and "}" are not source branches but compiler generated branches + // ie: static methods start sequence point "{" contains compiler generated branches + // 3) Exclude Contract class (EnsuresOnThrow/Assert/Assume is inside method body) + // 4) Exclude NUnit Assert(.Throws) class + if (sp.Content == "in" || sp.Content == "{" || sp.Content == "}" || + sp.Content.StartsWith(@assert + ".", StringComparison.Ordinal) || + sp.Content.StartsWith(@assert + " ", StringComparison.Ordinal) || + sp.Content.StartsWith(@contract + ".", StringComparison.Ordinal) || + sp.Content.StartsWith(@contract + " ", StringComparison.Ordinal) + ) { + sp.BranchCoverage = true; + continue; // skip + } } totalBranchCount += sp.BranchExitsCount; diff --git a/src/AddIns/Analysis/UnitTesting/TestRunner/TestResultsReader.cs b/src/AddIns/Analysis/UnitTesting/TestRunner/TestResultsReader.cs index f3bc984cb3..08e94b2d77 100644 --- a/src/AddIns/Analysis/UnitTesting/TestRunner/TestResultsReader.cs +++ b/src/AddIns/Analysis/UnitTesting/TestRunner/TestResultsReader.cs @@ -61,8 +61,10 @@ namespace ICSharpCode.UnitTesting public void Dispose() { - reader.Dispose(); - namedPipe.Dispose(); + if (reader != null) + reader.Dispose(); + if (namedPipe != null) + namedPipe.Dispose(); } public event EventHandler TestFinished; diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin index f2e4adf86b..b70e3a2dcf 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin @@ -179,12 +179,9 @@ - - - @@ -224,11 +221,8 @@ - - - @@ -248,7 +242,6 @@ - @@ -283,7 +276,6 @@ - @@ -305,7 +297,6 @@ - @@ -334,18 +325,20 @@ + + + + - - @@ -361,7 +354,6 @@ - @@ -371,7 +363,6 @@ - @@ -510,7 +501,7 @@ - + diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj index 2762300961..970be27a88 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj @@ -91,9 +91,10 @@ CSharpSemanticHighlighter.cs + - + diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpLanguageBinding.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpLanguageBinding.cs index 411279933f..548fddd585 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpLanguageBinding.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpLanguageBinding.cs @@ -19,11 +19,19 @@ using System; using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Reflection; using System.Threading; +using ICSharpCode.AvalonEdit; using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.NRefactory; +using ICSharpCode.NRefactory.CSharp; +using ICSharpCode.NRefactory.CSharp.Refactoring; +using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop.Editor.CodeCompletion; +using ICSharpCode.SharpDevelop.Project; using CSharpBinding.Completion; using CSharpBinding.FormattingStrategy; using CSharpBinding.Refactoring; @@ -47,47 +55,98 @@ namespace CSharpBinding this.container.AddService(typeof(System.CodeDom.Compiler.CodeDomProvider), new Microsoft.CSharp.CSharpCodeProvider()); } - public override ICodeCompletionBinding CreateCompletionBinding(FileName fileName, TextLocation currentLocation, ICSharpCode.NRefactory.Editor.ITextSource fileContent) + public override ICodeCompletionBinding CreateCompletionBinding(string expressionToComplete, FileName fileName, TextLocation location, ICodeContext context) { if (fileName == null) throw new ArgumentNullException("fileName"); - return new CSharpCompletionBinding(fileName, currentLocation, fileContent); + if (context == null) + throw new ArgumentNullException("context"); + string content = GeneratePartialClassContextStub(fileName, location, context); + const string caretPoint = "$__Caret_Point__$;"; + int caretOffset = content.IndexOf(caretPoint, StringComparison.Ordinal) + expressionToComplete.Length; + SD.Log.DebugFormatted("context used for dot completion: {0}", content.Replace(caretPoint, "$" + expressionToComplete + "|$")); + var doc = new ReadOnlyDocument(content.Replace(caretPoint, expressionToComplete)); + return new CSharpCompletionBinding(fileName, doc.GetLocation(caretOffset), doc.CreateSnapshot()); } - } - - public class CSharpTextEditorExtension : ITextEditorExtension - { - ITextEditor editor; - IssueManager inspectionManager; - IList contextActionProviders; - CodeManipulation codeManipulation; - CaretReferenceHighlightRenderer renderer; - public void Attach(ITextEditor editor) + static string GeneratePartialClassContextStub(FileName fileName, TextLocation location, ICodeContext context) { - this.editor = editor; - inspectionManager = new IssueManager(editor); - codeManipulation = new CodeManipulation(editor); - renderer = new CaretReferenceHighlightRenderer(editor); - - if (!editor.ContextActionProviders.IsReadOnly) { - contextActionProviders = AddInTree.BuildItems("/SharpDevelop/ViewContent/TextEditor/C#/ContextActions", null); - editor.ContextActionProviders.AddRange(contextActionProviders); + var compilation = SD.ParserService.GetCompilationForFile(fileName); + var file = SD.ParserService.GetExistingUnresolvedFile(fileName); + if (compilation == null || file == null) + return ""; + var unresolvedMember = file.GetMember(location); + if (unresolvedMember == null) + return ""; + var member = unresolvedMember.Resolve(new SimpleTypeResolveContext(compilation.MainAssembly)); + if (member == null) + return ""; + var builder = new TypeSystemAstBuilder(); + MethodDeclaration decl; + if (unresolvedMember is IMethod) { + // If it's a method, convert it directly (including parameters + type parameters) + decl = (MethodDeclaration)builder.ConvertEntity(member); + } else { + // Otherwise, create a method anyways, and copy the parameters + decl = new MethodDeclaration(); + if (member is IParameterizedMember) { + foreach (var p in ((IParameterizedMember)member).Parameters) { + decl.Parameters.Add(builder.ConvertParameter(p)); + } + } } + decl.Name = "__DebuggerStub__"; + decl.ReturnType = builder.ConvertType(member.ReturnType); + decl.Modifiers = unresolvedMember.IsStatic ? Modifiers.Static : Modifiers.None; + // Make the method look like an explicit interface implementation so that it doesn't appear in CC + decl.PrivateImplementationType = new SimpleType("__DummyType__"); + decl.Body = GenerateBodyFromContext(builder, context.LocalVariables.ToArray()); + return WrapInType(unresolvedMember.DeclaringTypeDefinition, decl).ToString(); } - - public void Detach() + + static BlockStatement GenerateBodyFromContext(TypeSystemAstBuilder builder, IVariable[] variables) { - codeManipulation.Dispose(); - if (inspectionManager != null) { - inspectionManager.Dispose(); - inspectionManager = null; - } - if (contextActionProviders != null) { - editor.ContextActionProviders.RemoveAll(contextActionProviders.Contains); + var body = new BlockStatement(); + foreach (var v in variables) + body.Statements.Add(new VariableDeclarationStatement(builder.ConvertType(v.Type), v.Name)); + body.Statements.Add(new ExpressionStatement(new IdentifierExpression("$__Caret_Point__$"))); + return body; + } + + static AstNode WrapInType(IUnresolvedTypeDefinition entity, EntityDeclaration decl) + { + if (entity == null) + return decl; + // Wrap decl in TypeDeclaration + decl = new TypeDeclaration { + ClassType = GetClassType(entity), + Modifiers = Modifiers.Partial, + Name = entity.Name, + Members = { decl } + }; + if (entity.DeclaringTypeDefinition != null) { + // Handle nested types + return WrapInType(entity.DeclaringTypeDefinition, decl); + } + if (string.IsNullOrEmpty(entity.Namespace)) + return decl; + return new NamespaceDeclaration(entity.Namespace) { + Members = { + decl + } + }; + } + + static ClassType GetClassType(IUnresolvedTypeDefinition entity) + { + switch (entity.Kind) { + case TypeKind.Interface: + return ClassType.Interface; + case TypeKind.Struct: + return ClassType.Struct; + default: + return ClassType.Class; } - renderer.Dispose(); - this.editor = null; } } } diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpTextEditorExtension.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpTextEditorExtension.cs new file mode 100644 index 0000000000..f308877041 --- /dev/null +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpTextEditorExtension.cs @@ -0,0 +1,253 @@ +// Copyright (c) 2014 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.ComponentModel; +using System.Linq; +using System.Reflection; +using ICSharpCode.AvalonEdit; +using CSharpBinding.FormattingStrategy; +using CSharpBinding.Refactoring; +using ICSharpCode.Core; +using ICSharpCode.SharpDevelop; +using ICSharpCode.SharpDevelop.Editor; +using ICSharpCode.SharpDevelop.Refactoring; +namespace CSharpBinding +{ + public class CSharpTextEditorExtension : ITextEditorExtension + { + ITextEditor editor; + + IssueManager inspectionManager; + + IList contextActionProviders; + + CodeManipulation codeManipulation; + + CaretReferenceHighlightRenderer renderer; + + CodeEditorFormattingOptionsAdapter options; + + TextEditorOptions originalEditorOptions; + + public void Attach(ITextEditor editor) + { + this.editor = editor; + inspectionManager = new IssueManager(editor); + codeManipulation = new CodeManipulation(editor); + renderer = new CaretReferenceHighlightRenderer(editor); + + // Patch editor options (indentation) to project-specific settings + if (!editor.ContextActionProviders.IsReadOnly) { + contextActionProviders = AddInTree.BuildItems("/SharpDevelop/ViewContent/TextEditor/C#/ContextActions", null); + editor.ContextActionProviders.AddRange(contextActionProviders); + } + + // Create instance of options adapter and register it as service + var formattingPolicy = CSharpFormattingPolicies.Instance.GetProjectOptions(SD.ProjectService.FindProjectContainingFile(editor.FileName)); + var textEditor = editor.GetService(); + + if (textEditor != null) { + options = new CodeEditorFormattingOptionsAdapter(textEditor.Options, editor.Options, formattingPolicy.OptionsContainer); + var textViewServices = textEditor.TextArea.TextView.Services; + + // Unregister any previous ITextEditorOptions instance from editor, if existing, register our impl. + textViewServices.RemoveService(typeof(ITextEditorOptions)); + textViewServices.AddService(typeof(ITextEditorOptions), options); + + // Set TextEditor's options to same object + originalEditorOptions = textEditor.Options; + textEditor.Options = options.TextEditorOptions; + } + } + + public void Detach() + { + var textEditor = editor.GetService(); + if (textEditor != null) { + var textView = textEditor.TextArea.TextView; + // Unregister our ITextEditorOptions instance from editor + var optionsService = textView.GetService(); + if ((optionsService != null) && (optionsService == options)) + textView.Services.RemoveService(typeof(ITextEditorOptions)); + // Reset TextEditor options, too? + if ((textEditor.Options != null) && (textEditor.Options == options.TextEditorOptions)) + textEditor.Options = originalEditorOptions; + } + + codeManipulation.Dispose(); + + if (inspectionManager != null) { + inspectionManager.Dispose(); + inspectionManager = null; + } + + if (contextActionProviders != null) { + editor.ContextActionProviders.RemoveAll(contextActionProviders.Contains); + } + + renderer.Dispose(); + options = null; + this.editor = null; + } + } + + class CodeEditorFormattingOptionsAdapter : ITextEditorOptions, INotifyPropertyChanged + { + CSharpFormattingOptionsContainer container; + readonly TextEditorOptions avalonEditOptions; + readonly TextEditorOptions originalAvalonEditOptions; + readonly ITextEditorOptions originalSDOptions; + + public CodeEditorFormattingOptionsAdapter(TextEditorOptions originalAvalonEditOptions, ITextEditorOptions originalSDOptions, CSharpFormattingOptionsContainer container) + { + if (originalAvalonEditOptions == null) + throw new ArgumentNullException("originalAvalonEditOptions"); + if (originalSDOptions == null) + throw new ArgumentNullException("originalSDOptions"); + if (container == null) + throw new ArgumentNullException("container"); + + this.originalAvalonEditOptions = originalAvalonEditOptions; + this.avalonEditOptions = new TextEditorOptions(originalAvalonEditOptions); + this.originalSDOptions = originalSDOptions; + this.container = container; + + // Update overridden options once + UpdateOverriddenProperties(); + + CSharpFormattingPolicies.Instance.FormattingPolicyUpdated += OnFormattingPolicyUpdated; + this.originalAvalonEditOptions.PropertyChanged += OnOrigAvalonOptionsPropertyChanged; + this.originalSDOptions.PropertyChanged += OnSDOptionsPropertyChanged; + } + + void OnFormattingPolicyUpdated(object sender, CSharpBinding.FormattingStrategy.CSharpFormattingPolicyUpdateEventArgs e) + { + // Update editor options from changed policy + UpdateOverriddenProperties(); + + OnPropertyChanged("IndentationSize"); + OnPropertyChanged("IndentationString"); + OnPropertyChanged("ConvertTabsToSpaces"); + } + + void UpdateOverriddenProperties() + { + avalonEditOptions.IndentationSize = container.GetEffectiveIndentationSize() ?? originalSDOptions.IndentationSize; + avalonEditOptions.ConvertTabsToSpaces = container.GetEffectiveConvertTabsToSpaces() ?? originalSDOptions.ConvertTabsToSpaces; + } + + void OnOrigAvalonOptionsPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if ((e.PropertyName != "IndentationSize") && (e.PropertyName != "IndentationString") && (e.PropertyName != "ConvertTabsToSpaces")) { + // Update values in our own TextEditorOptions instance + PropertyInfo propertyInfo = typeof(TextEditorOptions).GetProperty(e.PropertyName); + if (propertyInfo != null) { + propertyInfo.SetValue(avalonEditOptions, propertyInfo.GetValue(originalAvalonEditOptions)); + } + } else { + UpdateOverriddenProperties(); + } + OnPropertyChanged(e.PropertyName); + } + + void OnSDOptionsPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + OnPropertyChanged(e.PropertyName); + } + + public event PropertyChangedEventHandler PropertyChanged; + + void OnPropertyChanged(string propertyName) + { + if (PropertyChanged != null) { + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + public ICSharpCode.AvalonEdit.TextEditorOptions TextEditorOptions + { + get { + return avalonEditOptions; + } + } + + #region Overridden properties + + public int IndentationSize { + get { + // Get value from own TextEditorOptions instance + return avalonEditOptions.IndentationSize; + } + } + + public string IndentationString { + get { + // Get value from own TextEditorOptions instance + return avalonEditOptions.IndentationString; + } + } + + public bool ConvertTabsToSpaces { + get { + // Get value from own TextEditorOptions instance + return avalonEditOptions.ConvertTabsToSpaces; + } + } + + #endregion + + #region Rest of ITextEditorOptions implementation + + public bool AutoInsertBlockEnd { + get { + return originalSDOptions.AutoInsertBlockEnd; + } + } + + public int VerticalRulerColumn { + get { + return originalSDOptions.VerticalRulerColumn; + } + } + + public bool UnderlineErrors { + get { + return originalSDOptions.UnderlineErrors; + } + } + + public string FontFamily { + get { + return originalSDOptions.FontFamily; + } + } + + public double FontSize { + get { + return originalSDOptions.FontSize; + } + } + + #endregion + + } +} + + diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs index 3f3323cfbe..3f71a528d1 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs @@ -24,10 +24,8 @@ using ICSharpCode.Core; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.CSharp.Resolver; using ICSharpCode.NRefactory.Completion; -using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp.Completion; using ICSharpCode.NRefactory.Editor; -using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.CodeCompletion; @@ -99,7 +97,7 @@ namespace CSharpBinding.Completion completionContext.ProjectContent, completionContext.TypeResolveContextAtCaret ); - var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(completionContext.Compilation.GetProject()); + var formattingOptions = CSharpFormattingPolicies.Instance.GetProjectOptions(completionContext.Compilation.GetProject()); cce.FormattingPolicy = formattingOptions.OptionsContainer.GetEffectiveOptions(); cce.EolMarker = DocumentUtilities.GetLineTerminator(completionContext.Document, currentLocation.Line); diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionContext.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionContext.cs index 7d45f6f541..ae654a0d81 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionContext.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionContext.cs @@ -17,17 +17,19 @@ // DEALINGS IN THE SOFTWARE. using System; +using System.Collections.Generic; using System.Diagnostics; +using System.IO; using ICSharpCode.Core; using ICSharpCode.NRefactory; -using ICSharpCode.NRefactory.Editor; -using ICSharpCode.SharpDevelop.Project; -using CSharpBinding.Parser; +using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp.Completion; using ICSharpCode.NRefactory.CSharp.TypeSystem; +using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; +using CSharpBinding.Parser; namespace CSharpBinding.Completion { @@ -35,7 +37,7 @@ namespace CSharpBinding.Completion { public readonly ITextEditor Editor; public readonly IDocument Document; - public readonly CSharpFullParseInformation ParseInformation; + public readonly IList ConditionalSymbols; public readonly ICompilation Compilation; public readonly IProjectContent ProjectContent; public readonly CSharpTypeResolveContext TypeResolveContextAtCaret; @@ -56,7 +58,7 @@ namespace CSharpBinding.Completion if (projectContent == null) return null; - return new CSharpCompletionContext(editor, parseInfo, compilation, projectContent, editor.Document, editor.Caret.Location); + return new CSharpCompletionContext(editor, parseInfo.SyntaxTree.ConditionalSymbols, compilation, projectContent, editor.Document, parseInfo.UnresolvedFile, editor.Caret.Location); } public static CSharpCompletionContext Get(ITextEditor editor, ITextSource fileContent, TextLocation currentLocation, FileName fileName) @@ -64,32 +66,50 @@ namespace CSharpBinding.Completion IDocument document = new ReadOnlyDocument(fileContent); // Don't require the very latest parse information, an older cached version is OK. - var parseInfo = SD.ParserService.Parse(fileName, document) as CSharpFullParseInformation; + var parseInfo = SD.ParserService.GetCachedParseInformation(fileName) as CSharpFullParseInformation; + if (parseInfo == null) { + parseInfo = SD.ParserService.Parse(fileName) as CSharpFullParseInformation; + } if (parseInfo == null) return null; - ICompilation compilation = SD.ParserService.GetCompilationForFile(fileName); - var projectContent = compilation.MainAssembly.UnresolvedAssembly as IProjectContent; + + var project = SD.ProjectService.FindProjectContainingFile(fileName)as CSharpProject; + if (project == null) + return null; + + var solutionSnapshot = SD.ParserService.GetCurrentSolutionSnapshot(); + var projectContent = solutionSnapshot.GetProjectContent(project); if (projectContent == null) return null; - return new CSharpCompletionContext(editor, parseInfo, compilation, projectContent, document, currentLocation); + CSharpParser parser = new CSharpParser(project.CompilerSettings); + parser.GenerateTypeSystemMode = false; + + SyntaxTree cu = parser.Parse(fileContent, Path.GetRandomFileName() + ".cs"); + cu.Freeze(); + + CSharpUnresolvedFile unresolvedFile = cu.ToTypeSystem(); + ICompilation compilation = projectContent.AddOrUpdateFiles(unresolvedFile).CreateCompilation(solutionSnapshot); + + return new CSharpCompletionContext(editor, parseInfo.SyntaxTree.ConditionalSymbols, compilation, projectContent, document, unresolvedFile, currentLocation); } - private CSharpCompletionContext(ITextEditor editor, CSharpFullParseInformation parseInfo, ICompilation compilation, IProjectContent projectContent, IDocument document, TextLocation caretLocation) + private CSharpCompletionContext(ITextEditor editor, IList conditionalSymbols, ICompilation compilation, IProjectContent projectContent, IDocument document, CSharpUnresolvedFile unresolvedFile, TextLocation caretLocation) { Debug.Assert(editor != null); - Debug.Assert(parseInfo != null); + Debug.Assert(unresolvedFile != null); Debug.Assert(compilation != null); Debug.Assert(projectContent != null); Debug.Assert(document != null); this.Editor = editor; this.Document = document; - this.ParseInformation = parseInfo; + this.ConditionalSymbols = conditionalSymbols; this.Compilation = compilation; this.ProjectContent = projectContent; - this.TypeResolveContextAtCaret = parseInfo.UnresolvedFile.GetTypeResolveContext(compilation, caretLocation); - this.CompletionContextProvider = new DefaultCompletionContextProvider(document, parseInfo.UnresolvedFile); + this.TypeResolveContextAtCaret = unresolvedFile.GetTypeResolveContext(compilation, caretLocation); + this.CompletionContextProvider = new DefaultCompletionContextProvider(document, unresolvedFile); + this.CompletionContextProvider.ConditionalSymbols.AddRange(conditionalSymbols); } } } diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs index 8fbfc7e3f7..c3f005e892 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs @@ -148,7 +148,7 @@ namespace CSharpBinding.Completion IEnumerable ICompletionDataFactory.CreatePreProcessorDefinesCompletionData() { - return completionContext.ParseInformation.SyntaxTree.ConditionalSymbols.Select(def => new CompletionData(def)); + return completionContext.ConditionalSymbols.Select(def => new CompletionData(def)); } ICompletionData ICompletionDataFactory.CreateImportCompletionData(IType type, bool useFullName, bool addForTypeCreation) diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpInsightItem.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpInsightItem.cs index 939333a453..7d1eb15a51 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpInsightItem.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpInsightItem.cs @@ -72,7 +72,7 @@ namespace CSharpBinding.Completion ambience.ConversionFlags = ConversionFlags.StandardConversionFlags; var stringBuilder = new StringBuilder(); var formatter = new ParameterHighlightingOutputFormatter(stringBuilder, highlightedParameterIndex); - ambience.ConvertSymbol(Method, formatter, CSharpFormattingOptionsPersistence.GlobalOptions.OptionsContainer.GetEffectiveOptions()); + ambience.ConvertSymbol(Method, formatter, CSharpFormattingPolicies.Instance.GlobalOptions.OptionsContainer.GetEffectiveOptions()); var documentation = XmlDocumentationElement.Get(Method); ambience.ConversionFlags = ConversionFlags.ShowTypeParameterList; diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpMethodInsight.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpMethodInsight.cs index 33b42b37bd..8fb08c9316 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpMethodInsight.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpMethodInsight.cs @@ -50,7 +50,9 @@ namespace CSharpBinding.Completion public void Show() { window = editor.ShowInsightWindow(items); - window.StartOffset = startOffset; + // Set startOffset so that window always appears below the caret line + var startLocation = editor.Document.GetLocation(startOffset); + window.StartOffset = editor.Document.GetOffset(editor.Caret.Line, startLocation.Column); // closing the window at the end of the parameter list is handled by the CaretPositionChanged event window.EndOffset = editor.Document.TextLength; if (initiallySelectedItem != null) diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/OverrideCompletionData.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/OverrideCompletionData.cs index ede72ab53e..f3d5c57eb4 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/OverrideCompletionData.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/OverrideCompletionData.cs @@ -98,7 +98,7 @@ namespace CSharpBinding.Completion var document = context.Editor.Document; StringWriter w = new StringWriter(); - var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(contextAtCaret.Compilation.GetProject()); + var formattingOptions = CSharpFormattingPolicies.Instance.GetProjectOptions(contextAtCaret.Compilation.GetProject()); var segmentDict = SegmentTrackingOutputFormatter.WriteNode( w, entityDeclaration, formattingOptions.OptionsContainer.GetEffectiveOptions(), context.Editor.Options); diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/OverrideEqualsGetHashCodeCompletionData.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/OverrideEqualsGetHashCodeCompletionData.cs index 7b0ae25f0e..78f1ca6e89 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/OverrideEqualsGetHashCodeCompletionData.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/OverrideEqualsGetHashCodeCompletionData.cs @@ -84,7 +84,7 @@ namespace CSharpBinding.Completion var document = context.Editor.Document; StringWriter w = new StringWriter(); - var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(contextAtCaret.Compilation.GetProject()); + var formattingOptions = CSharpFormattingPolicies.Instance.GetProjectOptions(contextAtCaret.Compilation.GetProject()); var segmentDict = SegmentTrackingOutputFormatter.WriteNode( w, entityDeclaration, formattingOptions.OptionsContainer.GetEffectiveOptions(), context.Editor.Options); diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/OverrideToStringCompletionData.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/OverrideToStringCompletionData.cs index 0d75f8f133..f0bcd41674 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/OverrideToStringCompletionData.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/OverrideToStringCompletionData.cs @@ -81,7 +81,7 @@ namespace CSharpBinding.Completion var document = context.Editor.Document; StringWriter w = new StringWriter(); - var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(contextAtCaret.Compilation.GetProject()); + var formattingOptions = CSharpFormattingPolicies.Instance.GetProjectOptions(contextAtCaret.Compilation.GetProject()); var segmentDict = SegmentTrackingOutputFormatter.WriteNode( w, entityDeclaration, formattingOptions.OptionsContainer.GetEffectiveOptions(), context.Editor.Options); diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/PartialCompletionData.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/PartialCompletionData.cs index 7cd6f37a43..d05ff650c0 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/PartialCompletionData.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/PartialCompletionData.cs @@ -64,7 +64,7 @@ namespace CSharpBinding.Completion var document = context.Editor.Document; StringWriter w = new StringWriter(); - var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(contextAtCaret.Compilation.GetProject()); + var formattingOptions = CSharpFormattingPolicies.Instance.GetProjectOptions(contextAtCaret.Compilation.GetProject()); var segmentDict = SegmentTrackingOutputFormatter.WriteNode( w, entityDeclaration, formattingOptions.OptionsContainer.GetEffectiveOptions(), context.Editor.Options); diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormatter.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormatter.cs index 028a43e6a8..65bec18aca 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormatter.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormatter.cs @@ -31,7 +31,9 @@ namespace CSharpBinding.FormattingStrategy /// public static void Format(ITextEditor editor, int offset, int length, CSharpFormattingOptionsContainer optionsContainer) { - var formatter = new CSharpFormatter(optionsContainer.GetEffectiveOptions(), editor.ToEditorOptions()); + TextEditorOptions editorOptions = editor.ToEditorOptions(); + optionsContainer.CustomizeEditorOptions(editorOptions); + var formatter = new CSharpFormatter(optionsContainer.GetEffectiveOptions(), editorOptions); formatter.AddFormattingRegion(new DomRegion(editor.Document.GetLocation(offset), editor.Document.GetLocation(offset + length))); var changes = formatter.AnalyzeFormatting(editor.Document, SyntaxTree.Parse(editor.Document)); changes.ApplyChanges(offset, length); diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsContainer.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsContainer.cs index 0dd30bc82a..103ba60284 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsContainer.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsContainer.cs @@ -34,8 +34,13 @@ namespace CSharpBinding.FormattingStrategy /// internal class CSharpFormattingOptionsContainer : INotifyPropertyChanged { + private const string IndentationSizePropertyName = "IndentationSize"; + private const string ConvertTabsToSpacesPropertyName = "ConvertTabsToSpaces"; + CSharpFormattingOptionsContainer parent; CSharpFormattingOptions cachedOptions; + int? indentationSize; + bool? convertTabsToSpaces; readonly HashSet activeOptions; @@ -106,6 +111,8 @@ namespace CSharpBinding.FormattingStrategy foreach (var activeOption in options.activeOptions) activeOptions.Add(activeOption); cachedOptions = options.cachedOptions.Clone(); + indentationSize = options.indentationSize; + convertTabsToSpaces = options.convertTabsToSpaces; OnPropertyChanged(null); } @@ -127,6 +134,14 @@ namespace CSharpBinding.FormattingStrategy if ((e.PropertyName == "Parent") || (e.PropertyName == null)) { // All properties might have changed -> update everything cachedOptions = CreateCachedOptions(); + } else if (e.PropertyName == IndentationSizePropertyName) { + if (!indentationSize.HasValue) { + indentationSize = GetEffectiveIndentationSize(); + } + } else if (e.PropertyName == ConvertTabsToSpacesPropertyName) { + if (!convertTabsToSpaces.HasValue) { + convertTabsToSpaces = GetEffectiveConvertTabsToSpaces(); + } } else { // Some other property has changed, check if we have our own value for it if (!activeOptions.Contains(e.PropertyName)) { @@ -148,10 +163,18 @@ namespace CSharpBinding.FormattingStrategy public object GetOption(string option) { // Run up the hierarchy until we find a defined value for property - if (activeOptions.Contains(option)) { - PropertyInfo propertyInfo = typeof(CSharpFormattingOptions).GetProperty(option); - if (propertyInfo != null) { - return propertyInfo.GetValue(cachedOptions); + if (option == IndentationSizePropertyName) { + if (indentationSize.HasValue) + return indentationSize.Value; + } else if (option == ConvertTabsToSpacesPropertyName) { + if (convertTabsToSpaces.HasValue) + return convertTabsToSpaces.Value; + } else { + if (activeOptions.Contains(option)) { + PropertyInfo propertyInfo = typeof(CSharpFormattingOptions).GetProperty(option); + if (propertyInfo != null) { + return propertyInfo.GetValue(cachedOptions); + } } } @@ -186,6 +209,68 @@ namespace CSharpBinding.FormattingStrategy return null; } + public int? IndentationSize + { + get { + return indentationSize; + } + set { + indentationSize = value; + OnPropertyChanged(IndentationSizePropertyName); + } + } + + /// + /// Retrieves the value of "IndentationSize" option by looking at current and (if nothing set here) parent + /// containers. + /// + public int? GetEffectiveIndentationSize() + { + // Run up the hierarchy until we find a defined value for property + CSharpFormattingOptionsContainer container = this; + do + { + int? val = container.indentationSize; + if (val.HasValue) { + return val.Value; + } + container = container.parent; + } while (container != null); + + return null; + } + + public bool? ConvertTabsToSpaces + { + get { + return convertTabsToSpaces; + } + set { + convertTabsToSpaces = value; + OnPropertyChanged(ConvertTabsToSpacesPropertyName); + } + } + + /// + /// Retrieves the value of v option by looking at current and (if nothing set here) parent + /// containers. + /// + public bool? GetEffectiveConvertTabsToSpaces() + { + // Run up the hierarchy until we find a defined value for property + CSharpFormattingOptionsContainer container = this; + do + { + bool? val = container.convertTabsToSpaces; + if (val.HasValue) { + return val.Value; + } + container = container.parent; + } while (container != null); + + return null; + } + /// /// Sets an option. /// @@ -195,18 +280,32 @@ namespace CSharpBinding.FormattingStrategy { if (value != null) { // Save value in option values and cached options - activeOptions.Add(option); - PropertyInfo propertyInfo = typeof(CSharpFormattingOptions).GetProperty(option); - if ((propertyInfo != null) && (propertyInfo.PropertyType == value.GetType())) { - propertyInfo.SetValue(cachedOptions, value); + if (option == IndentationSizePropertyName) { + if (value is int) + indentationSize = (int) value; + } else if (option == ConvertTabsToSpacesPropertyName) { + if (value is bool) + convertTabsToSpaces = (bool) value; + } else { + activeOptions.Add(option); + PropertyInfo propertyInfo = typeof(CSharpFormattingOptions).GetProperty(option); + if ((propertyInfo != null) && (propertyInfo.PropertyType == value.GetType())) { + propertyInfo.SetValue(cachedOptions, value); + } } } else { // Reset this option - activeOptions.Remove(option); - // Update formatting options object from parents - PropertyInfo propertyInfo = typeof(CSharpFormattingOptions).GetProperty(option); - if (propertyInfo != null) { - propertyInfo.SetValue(cachedOptions, GetEffectiveOption(option)); + if (option == IndentationSizePropertyName) { + indentationSize = null; + } else if (option == ConvertTabsToSpacesPropertyName) { + convertTabsToSpaces = null; + } else { + activeOptions.Remove(option); + // Update formatting options object from parents + PropertyInfo propertyInfo = typeof(CSharpFormattingOptions).GetProperty(option); + if (propertyInfo != null) { + propertyInfo.SetValue(cachedOptions, GetEffectiveOption(option)); + } } } OnPropertyChanged(option); @@ -219,6 +318,11 @@ namespace CSharpBinding.FormattingStrategy /// Option's type. public Type GetOptionType(string option) { + if (option == IndentationSizePropertyName) + return typeof(int); + if (option == ConvertTabsToSpacesPropertyName) + return typeof(bool); + PropertyInfo propertyInfo = typeof(CSharpFormattingOptions).GetProperty(option); if (propertyInfo != null) { return propertyInfo.PropertyType; @@ -258,6 +362,19 @@ namespace CSharpBinding.FormattingStrategy return outputOptions; } + public void CustomizeEditorOptions(TextEditorOptions editorOptions) + { + int? indentationSize = GetEffectiveIndentationSize(); + if (indentationSize.HasValue) { + editorOptions.IndentSize = indentationSize.Value; + editorOptions.TabSize = indentationSize.Value; + editorOptions.ContinuationIndent = indentationSize.Value; + } + bool? convertTabsToSpaces = GetEffectiveConvertTabsToSpaces(); + if (convertTabsToSpaces.HasValue) + editorOptions.TabsToSpaces = convertTabsToSpaces.Value; + } + public void Load(Properties parentProperties) { if (parentProperties == null) @@ -275,6 +392,9 @@ namespace CSharpBinding.FormattingStrategy } } } + + indentationSize = formatProperties.Get(IndentationSizePropertyName, new int?()); + convertTabsToSpaces = formatProperties.Get(ConvertTabsToSpacesPropertyName, new bool?()); } } @@ -291,6 +411,10 @@ namespace CSharpBinding.FormattingStrategy formatProperties.Set(activeOption, val); } } + if (indentationSize.HasValue) + formatProperties.Set(IndentationSizePropertyName, indentationSize.Value); + if (convertTabsToSpaces.HasValue) + formatProperties.Set(ConvertTabsToSpacesPropertyName, convertTabsToSpaces.Value); parentProperties.SetNestedProperties("CSharpFormatting", formatProperties); } diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsPersistence.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingPolicies.cs similarity index 59% rename from src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsPersistence.cs rename to src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingPolicies.cs index df5b11e2aa..5999f1dd1f 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsPersistence.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingPolicies.cs @@ -18,6 +18,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using ICSharpCode.Core; using ICSharpCode.NRefactory.CSharp; using ICSharpCode.SharpDevelop; @@ -25,43 +26,50 @@ using ICSharpCode.SharpDevelop.Project; namespace CSharpBinding.FormattingStrategy { - public class CSharpFormattingOptionsPersistenceInitCommand : SimpleCommand + public class CSharpFormattingOptionsPoliciesInitCommand : SimpleCommand { public override void Execute(object parameter) { - // Initialize CSharpFormattingOptionsPersistence as early as possible (before solution is opened) - CSharpFormattingOptionsPersistence.Initialize(); + // Initialize CSharpFormattingPolicies as early as possible (before solution is opened) + CSharpFormattingPolicies.Instance.Initialize(); } } /// - /// Persistence helper for C# formatting options. + /// Management class for formatting policies. /// - internal class CSharpFormattingOptionsPersistence + internal class CSharpFormattingPolicies { - static bool initialized; - static Dictionary projectOptions; + static readonly Lazy LazyInstance = + new Lazy(() => new CSharpFormattingPolicies()); - static CSharpFormattingOptionsPersistence() + public static CSharpFormattingPolicies Instance { + get { return LazyInstance.Value; } + } + + public event EventHandler FormattingPolicyUpdated; + + bool initialized; + Dictionary projectOptions; + + public CSharpFormattingPolicies() { - Initialize(); + // Load global settings + GlobalOptions = new CSharpFormattingPolicy( + SD.PropertyService.MainPropertiesContainer, new CSharpFormattingOptionsContainer() { + DefaultText = StringParser.Parse("${res:CSharpBinding.Formatting.GlobalOptionReference}") + }); + GlobalOptions.FormattingPolicyUpdated += OnFormattingPolicyUpdated; + GlobalOptions.Load(); } - public static void Initialize() + public void Initialize() { if (initialized) return; initialized = true; - projectOptions = new Dictionary(); - - // Load global settings - GlobalOptions = new CSharpFormattingOptionsPersistence( - SD.PropertyService.MainPropertiesContainer, new CSharpFormattingOptionsContainer() - { - DefaultText = StringParser.Parse("${res:CSharpBinding.Formatting.GlobalOptionReference}") - }); - GlobalOptions.Load(); + projectOptions = new Dictionary(); // Handlers for solution loading/unloading var projectService = SD.GetService(); @@ -71,8 +79,7 @@ namespace CSharpBinding.FormattingStrategy } } - public static bool AutoFormatting - { + public static bool AutoFormatting { get { return SD.PropertyService.Get("CSharpBinding.Formatting.AutoFormatting", false); } @@ -81,31 +88,32 @@ namespace CSharpBinding.FormattingStrategy } } - public static CSharpFormattingOptionsPersistence GlobalOptions - { + public CSharpFormattingPolicy GlobalOptions { get; private set; } - public static CSharpFormattingOptionsPersistence SolutionOptions - { + public CSharpFormattingPolicy SolutionOptions { get; private set; } - public static CSharpFormattingOptionsPersistence GetProjectOptions(IProject project) + public CSharpFormattingPolicy GetProjectOptions(IProject project) { + if (!initialized) + return GlobalOptions; + var csproject = project as CSharpProject; if (csproject != null) { string key = project.FileName; if (!projectOptions.ContainsKey(key)) { // Lazily create options container for project - var projectFormattingPersistence = new CSharpFormattingOptionsPersistence( + var projectFormattingPersistence = new CSharpFormattingPolicy( csproject.GlobalPreferences, - new CSharpFormattingOptionsContainer((SolutionOptions ?? GlobalOptions).OptionsContainer) - { + new CSharpFormattingOptionsContainer((SolutionOptions ?? GlobalOptions).OptionsContainer) { DefaultText = StringParser.Parse("${res:CSharpBinding.Formatting.ProjectOptionReference}") }); + projectFormattingPersistence.FormattingPolicyUpdated += OnFormattingPolicyUpdated; projectFormattingPersistence.Load(); projectOptions[key] = projectFormattingPersistence; } @@ -116,34 +124,70 @@ namespace CSharpBinding.FormattingStrategy return SolutionOptions ?? GlobalOptions; } - static void SolutionOpened(object sender, SolutionEventArgs e) + void SolutionOpened(object sender, SolutionEventArgs e) { // Load solution settings - SolutionOptions = new CSharpFormattingOptionsPersistence( + SolutionOptions = new CSharpFormattingPolicy( e.Solution.SDSettings, - new CSharpFormattingOptionsContainer(GlobalOptions.OptionsContainer) - { + new CSharpFormattingOptionsContainer(GlobalOptions.OptionsContainer) { DefaultText = StringParser.Parse("${res:CSharpBinding.Formatting.SolutionOptionReference}") }); + SolutionOptions.FormattingPolicyUpdated += OnFormattingPolicyUpdated; SolutionOptions.Load(); } - static void SolutionClosed(object sender, SolutionEventArgs e) + void SolutionClosed(object sender, SolutionEventArgs e) { + SolutionOptions.FormattingPolicyUpdated -= OnFormattingPolicyUpdated; SolutionOptions = null; projectOptions.Clear(); } + void OnFormattingPolicyUpdated(object sender, CSharpFormattingPolicyUpdateEventArgs e) + { + if (FormattingPolicyUpdated != null) { + FormattingPolicyUpdated(sender, e); + } + } + } + + /// + /// Contains event data for formatting policy update events. + /// + internal class CSharpFormattingPolicyUpdateEventArgs : EventArgs + { + public CSharpFormattingPolicyUpdateEventArgs(CSharpFormattingOptionsContainer container) + { + OptionsContainer = container; + } + + /// + /// Returns updated options container. + /// + public CSharpFormattingOptionsContainer OptionsContainer + { + get; + private set; + } + } + + /// + /// Persistence helper for C# formatting options of a certain policy (e.g. global, solution, project). + /// + internal class CSharpFormattingPolicy + { + public event EventHandler FormattingPolicyUpdated; + readonly Properties propertiesContainer; - CSharpFormattingOptionsContainer optionsContainer; + readonly CSharpFormattingOptionsContainer optionsContainer; CSharpFormattingOptionsContainer optionsContainerWorkingCopy; /// - /// Creates a new instance of formatting options persistence helper, using given options to predefine the options container. + /// Creates a new instance of formatting options policy, using given options to predefine the options container. /// /// Properties container to load from and save to. /// Initial (empty) instance of formatting options container. - public CSharpFormattingOptionsPersistence(Properties propertiesContainer, CSharpFormattingOptionsContainer initialContainer) + public CSharpFormattingPolicy(Properties propertiesContainer, CSharpFormattingOptionsContainer initialContainer) { if (initialContainer == null) throw new ArgumentNullException("initialContainer"); @@ -153,7 +197,7 @@ namespace CSharpBinding.FormattingStrategy } /// - /// Returns the option container managed by this helper. + /// Returns the option container for this policy. /// public CSharpFormattingOptionsContainer OptionsContainer { @@ -196,7 +240,15 @@ namespace CSharpBinding.FormattingStrategy // Convert to SD properties optionsContainer.Save(propertiesContainer); + OnFormattingPolicyUpdated(this, optionsContainer); return true; } + + void OnFormattingPolicyUpdated(object sender, CSharpFormattingOptionsContainer container) + { + if (FormattingPolicyUpdated != null) { + FormattingPolicyUpdated(sender, new CSharpFormattingPolicyUpdateEventArgs(container)); + } + } } } diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingStrategy.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingStrategy.cs index 5c365b2f66..33cf62c387 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingStrategy.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingStrategy.cs @@ -48,7 +48,7 @@ namespace CSharpBinding.FormattingStrategy DocumentAccessor acc = new DocumentAccessor(editor.Document, lineNr, lineNr); CSharpIndentationStrategy indentStrategy = new CSharpIndentationStrategy(); - indentStrategy.IndentationString = editor.Options.IndentationString; + indentStrategy.IndentationString = GetIndentationString(editor); indentStrategy.Indent(acc, false); string t = acc.Text; @@ -62,33 +62,67 @@ namespace CSharpBinding.FormattingStrategy { DocumentAccessor acc = new DocumentAccessor(editor.Document, beginLine, endLine); CSharpIndentationStrategy indentStrategy = new CSharpIndentationStrategy(); - indentStrategy.IndentationString = editor.Options.IndentationString; + indentStrategy.IndentationString = GetIndentationString(editor); indentStrategy.Indent(acc, true); } + CSharpFormattingOptionsContainer GetOptionsContainerForEditor(ITextEditor editor) + { + var currentProject = SD.ProjectService.FindProjectContainingFile(editor.FileName); + if (currentProject != null) { + var persistence = CSharpFormattingPolicies.Instance.GetProjectOptions(currentProject); + if (persistence != null) { + return persistence.OptionsContainer; + } + } + + return null; + } + + string GetIndentationString(ITextEditor editor) + { + // Get current indentation option values + int indentationSize = editor.Options.IndentationSize; + bool convertTabsToSpaces = editor.Options.ConvertTabsToSpaces; + var container = GetOptionsContainerForEditor(editor); + if (container != null) { + int? effectiveIndentationSize = container.GetEffectiveIndentationSize(); + if (effectiveIndentationSize.HasValue) + indentationSize = effectiveIndentationSize.Value; + bool? effectiveConvertTabsToSpaces = container.GetEffectiveConvertTabsToSpaces(); + if (effectiveConvertTabsToSpaces.HasValue) + convertTabsToSpaces = effectiveConvertTabsToSpaces.Value; + } + + if (convertTabsToSpaces) + return new string(' ', indentationSize); + else + return "\t"; + } + /* NR indent engine (temporarily?) disabled as per #447 static void IndentSingleLine(CacheIndentEngine engine, IDocument document, IDocumentLine line) { - engine.Update(line.EndOffset); - if (engine.NeedsReindent) { - var indentation = TextUtilities.GetWhitespaceAfter(document, line.Offset); - // replacing the indentation in two steps is necessary to make the caret move accordingly. - document.Replace(indentation.Offset, indentation.Length, ""); - document.Replace(indentation.Offset, 0, engine.ThisLineIndent); - engine.ResetEngineToPosition(line.Offset); - } + engine.Update(line.EndOffset); + if (engine.NeedsReindent) { + var indentation = TextUtilities.GetWhitespaceAfter(document, line.Offset); + // replacing the indentation in two steps is necessary to make the caret move accordingly. + document.Replace(indentation.Offset, indentation.Length, ""); + document.Replace(indentation.Offset, 0, engine.ThisLineIndent); + engine.ResetEngineToPosition(line.Offset); + } } static CacheIndentEngine CreateIndentEngine(IDocument document, TextEditorOptions options) { - IProject currentProject = null; - var projectService = SD.GetService(); - if (projectService != null) { - currentProject = projectService.FindProjectContainingFile(new FileName(document.FileName)); - } - var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(currentProject); - var engine = new CSharpIndentEngine(document, options, formattingOptions.OptionsContainer.GetEffectiveOptions()); - return new CacheIndentEngine(engine); + IProject currentProject = null; + var projectService = SD.GetService(); + if (projectService != null) { + currentProject = projectService.FindProjectContainingFile(new FileName(document.FileName)); + } + var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(currentProject); + var engine = new CSharpIndentEngine(document, options, formattingOptions.OptionsContainer.GetEffectiveOptions()); + return new CacheIndentEngine(engine); } */ #endregion @@ -302,11 +336,11 @@ namespace CSharpBinding.FormattingStrategy { if ((offset > textArea.Document.TextLength) || ((offset + length) > textArea.Document.TextLength)) return false; - if (respectAutoFormattingSetting && !CSharpFormattingOptionsPersistence.AutoFormatting) + if (respectAutoFormattingSetting && !CSharpFormattingPolicies.AutoFormatting) return false; using (textArea.Document.OpenUndoGroup()) { - var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(SD.ProjectService.CurrentProject); + var formattingOptions = CSharpFormattingPolicies.Instance.GetProjectOptions(SD.ProjectService.CurrentProject); try { CSharpFormatterHelper.Format(textArea, offset, length, formattingOptions.OptionsContainer); } catch (Exception) { diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/FormattingOptionBinding.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/FormattingOptionBinding.cs index 9caa50b055..b36677c142 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/FormattingOptionBinding.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/FormattingOptionBinding.cs @@ -22,6 +22,7 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using ICSharpCode.NRefactory.CSharp; +using CSharpBinding.OptionPanels; namespace CSharpBinding.FormattingStrategy { @@ -32,11 +33,8 @@ namespace CSharpBinding.FormattingStrategy { public static readonly DependencyProperty ContainerProperty = DependencyProperty.RegisterAttached("Container", typeof(CSharpFormattingOptionsContainer), - typeof(FormattingOptionBinding), - new FrameworkPropertyMetadata()); - public static readonly DependencyProperty OptionProperty = - DependencyProperty.RegisterAttached("Option", typeof(string), typeof(FormattingOptionBinding), - new FrameworkPropertyMetadata(OnOptionPropertyChanged)); + typeof(FormattingOptionBinding), + new FrameworkPropertyMetadata((o, e) => UpdateOptionBinding(o))); public static CSharpFormattingOptionsContainer GetContainer(Selector element) { @@ -48,21 +46,26 @@ namespace CSharpBinding.FormattingStrategy element.SetValue(ContainerProperty, container); } - public static string GetOption(Selector element) + public static readonly DependencyProperty FormattingOptionProperty = + DependencyProperty.RegisterAttached("FormattingOption", typeof(FormattingOption), + typeof(FormattingOptionBinding), + new FrameworkPropertyMetadata((o, e) => UpdateOptionBinding(o))); + + public static FormattingOption GetFormattingOption(Selector element) { - return (string) element.GetValue(OptionProperty); + return (FormattingOption) element.GetValue(FormattingOptionProperty); } - public static void SetOption(Selector element, string option) + public static void SetFormattingOption(Selector element, FormattingOption container) { - element.SetValue(OptionProperty, option); + element.SetValue(FormattingOptionProperty, container); } - static void OnOptionPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) + static void UpdateOptionBinding(DependencyObject o) { - string option = e.NewValue as string; ComboBox comboBox = o as ComboBox; CSharpFormattingOptionsContainer container = GetContainer(comboBox); + FormattingOption option = GetFormattingOption(comboBox); if ((option != null) && (comboBox != null) && (container != null)) { if (container != null) { if (container.Parent != null) { @@ -72,17 +75,24 @@ namespace CSharpBinding.FormattingStrategy Tag = null }); comboBox.SelectedIndex = 0; + } else if (option.AlwaysAllowDefault) { + // Also add "default" entry, but without changeable text by container + comboBox.Items.Add(new ComboBoxItem { + Content = "(default)", + Tag = null + }); + comboBox.SelectedIndex = 0; } - Type optionType = container.GetOptionType(option); + Type optionType = container.GetOptionType(option.Option); FillComboValues(comboBox, optionType); - UpdateComboBoxValue(container, option, comboBox); + UpdateComboBoxValue(container, option.Option, comboBox); comboBox.SelectionChanged += ComboBox_SelectionChanged; container.PropertyChanged += (sender, eventArgs) => { - if ((eventArgs.PropertyName == null) || (eventArgs.PropertyName == option)) - UpdateComboBoxValue(container, option, comboBox); + if ((eventArgs.PropertyName == null) || (eventArgs.PropertyName == option.Option)) + UpdateComboBoxValue(container, option.Option, comboBox); }; } } @@ -98,13 +108,13 @@ namespace CSharpBinding.FormattingStrategy { ComboBox comboBox = sender as ComboBox; if (comboBox != null) { - string option = GetOption(comboBox); + FormattingOption option = GetFormattingOption(comboBox); CSharpFormattingOptionsContainer container = GetContainer(comboBox); if ((container != null) && (option != null)) { ComboBoxItem selectedItem = comboBox.SelectedItem as ComboBoxItem; if (selectedItem != null) { // Set option to appropriate value - container.SetOption(option, selectedItem.Tag); + container.SetOption(option.Option, selectedItem.Tag); } } } @@ -140,11 +150,10 @@ namespace CSharpBinding.FormattingStrategy static void FillIntComboValues(ComboBox comboBox) { - comboBox.Items.Add(new ComboBoxItem { Content = "0", Tag = 0 }); - comboBox.Items.Add(new ComboBoxItem { Content = "1", Tag = 1 }); - comboBox.Items.Add(new ComboBoxItem { Content = "2", Tag = 2 }); - comboBox.Items.Add(new ComboBoxItem { Content = "3", Tag = 3 }); - comboBox.Items.Add(new ComboBoxItem { Content = "4", Tag = 4 }); + for (int i = 0; i < 11; i++) + { + comboBox.Items.Add(new ComboBoxItem { Content = i.ToString(), Tag = i }); + } } static void FillBraceStyleComboValues(ComboBox comboBox) diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpDesignerGenerator.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpDesignerGenerator.cs index f10b094d8e..5045d6fc8f 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpDesignerGenerator.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpDesignerGenerator.cs @@ -155,7 +155,7 @@ namespace CSharpBinding.FormsDesigner IDocument document = context.GetDocument(fileNameObj); var ctx = SDRefactoringContext.Create(fileNameObj, document); - var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(compilation.GetProject()); + var formattingOptions = CSharpFormattingPolicies.Instance.GetProjectOptions(compilation.GetProject()); script = new DocumentScript(document, formattingOptions.OptionsContainer.GetEffectiveOptions(), new TextEditorOptions()); scripts.Add(fileNameObj, script); return script; diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml index 259702aa7d..4db4b5233e 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml @@ -274,13 +274,13 @@ - + + format:FormattingOptionBinding.FormattingOption="{Binding}" /> + + + + + + + + + + + + + DockPanel.Dock="Top" Margin="0,5,0,0"> diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml.cs index cd2c4cdf70..b1a6bba1ac 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml.cs @@ -29,21 +29,13 @@ using CSharpBinding.FormattingStrategy; namespace CSharpBinding.OptionPanels { - /// - /// Marker interface for group or option container. - /// It doesn't need to have any members. - /// - internal interface IFormattingItemContainer - { - } - /// /// Represents a container item for other container items in formatting editor list /// [ContentProperty("Children")] - internal class FormattingGroupContainer : DependencyObject, IFormattingItemContainer + internal class FormattingGroupContainer : DependencyObject { - readonly ObservableCollection children = new ObservableCollection(); + readonly ObservableCollection children = new ObservableCollection(); public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(FormattingGroupContainer), @@ -54,7 +46,7 @@ namespace CSharpBinding.OptionPanels set { SetValue(TextProperty, value); } } - public ObservableCollection Children + public ObservableCollection Children { get { return children; @@ -66,7 +58,7 @@ namespace CSharpBinding.OptionPanels /// Represents a container for formatting options. /// [ContentProperty("Children")] - internal class FormattingOptionContainer : DependencyObject, IFormattingItemContainer + internal class FormattingOptionContainer : DependencyObject { readonly ObservableCollection children = new ObservableCollection(); @@ -91,11 +83,26 @@ namespace CSharpBinding.OptionPanels set { SetValue(TextProperty, value); } } +// public static readonly DependencyProperty AlwaysAllowDefaultProperty = +// DependencyProperty.Register("AlwaysAllowDefault", typeof(bool), typeof(FormattingOption), +// new FrameworkPropertyMetadata()); +// +// public bool AlwaysAllowDefault { +// get { return (bool)GetValue(AlwaysAllowDefaultProperty); } +// set { SetValue(AlwaysAllowDefaultProperty, value); } +// } + public string Option { get; set; } + + public bool AlwaysAllowDefault + { + get; + set; + } } /// @@ -133,6 +140,15 @@ namespace CSharpBinding.OptionPanels set { SetValue(AllowPresetsProperty, value); } } + public static readonly DependencyProperty OverrideGlobalIndentationProperty = + DependencyProperty.Register("OverrideGlobalIndentation", typeof(bool), typeof(CSharpFormattingEditor), + new FrameworkPropertyMetadata()); + + public bool OverrideGlobalIndentation { + get { return (bool)GetValue(OverrideGlobalIndentationProperty); } + set { SetValue(OverrideGlobalIndentationProperty, value); } + } + static void OnOptionsContainerPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { var editor = o as CSharpFormattingEditor; @@ -197,7 +213,7 @@ namespace CSharpBinding.OptionPanels } } - public ObservableCollection RootChildren + public ObservableCollection RootChildren { get { // rootEntries object is only the root container, its children should be shown directly diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingOptionPanel.xaml b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingOptionPanel.xaml index 4620821994..05e73ee15e 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingOptionPanel.xaml +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingOptionPanel.xaml @@ -19,7 +19,7 @@ diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingOptionPanel.xaml.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingOptionPanel.xaml.cs index e358b6c90c..91cd559fc6 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingOptionPanel.xaml.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingOptionPanel.xaml.cs @@ -40,7 +40,7 @@ namespace CSharpBinding.OptionPanels internal class CSharpGlobalFormattingOptionPanel : CSharpFormattingOptionPanel { public CSharpGlobalFormattingOptionPanel() - : base(CSharpFormattingOptionsPersistence.GlobalOptions, true) + : base(CSharpFormattingPolicies.Instance.GlobalOptions, true, false) { autoFormattingCheckBox.Visibility = Visibility.Visible; } @@ -52,7 +52,7 @@ namespace CSharpBinding.OptionPanels internal class CSharpSolutionFormattingOptionPanel : CSharpFormattingOptionPanel { public CSharpSolutionFormattingOptionPanel() - : base(CSharpFormattingOptionsPersistence.SolutionOptions, true) + : base(CSharpFormattingPolicies.Instance.SolutionOptions, true, true) { autoFormattingCheckBox.Visibility = Visibility.Collapsed; } @@ -63,25 +63,26 @@ namespace CSharpBinding.OptionPanels /// internal partial class CSharpFormattingOptionPanel : OptionPanel { - readonly CSharpFormattingOptionsPersistence persistenceHelper; + readonly CSharpFormattingPolicy formattingPolicy; bool isDirty; - public CSharpFormattingOptionPanel(CSharpFormattingOptionsPersistence persistenceHelper, bool allowPresets) + public CSharpFormattingOptionPanel(CSharpFormattingPolicy persistenceHelper, bool allowPresets, bool overrideGlobalIndentation) { if (persistenceHelper == null) throw new ArgumentNullException("persistenceHelper"); - this.persistenceHelper = persistenceHelper; + this.formattingPolicy = persistenceHelper; this.isDirty = false; InitializeComponent(); formattingEditor.AllowPresets = allowPresets; + formattingEditor.OverrideGlobalIndentation = overrideGlobalIndentation; } public override void LoadOptions() { base.LoadOptions(); - formattingEditor.OptionsContainer = persistenceHelper.StartEditing(); + formattingEditor.OptionsContainer = formattingPolicy.StartEditing(); formattingEditor.OptionsContainer.PropertyChanged += ContainerPropertyChanged; } @@ -94,7 +95,7 @@ namespace CSharpBinding.OptionPanels { // Only save container, if some option really has changed formattingEditor.OptionsContainer.PropertyChanged -= ContainerPropertyChanged; - return (!isDirty || persistenceHelper.Save()) && base.SaveOptions(); + return (!isDirty || formattingPolicy.Save()) && base.SaveOptions(); } } } \ No newline at end of file diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpProjectFormattingOptions.xaml.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpProjectFormattingOptions.xaml.cs index d3ca858d81..e12bdeaa8d 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpProjectFormattingOptions.xaml.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpProjectFormattingOptions.xaml.cs @@ -35,7 +35,7 @@ namespace CSharpBinding.OptionPanels /// internal partial class CSharpProjectFormattingOptionPanel : ProjectOptionPanel { - CSharpFormattingOptionsPersistence persistenceHelper; + CSharpFormattingPolicy formattingPolicy; public CSharpProjectFormattingOptionPanel() { @@ -45,18 +45,19 @@ namespace CSharpBinding.OptionPanels protected override void Load(ICSharpCode.SharpDevelop.Project.MSBuildBasedProject project, string configuration, string platform) { base.Load(project, configuration, platform); - if (persistenceHelper != null) { - persistenceHelper.OptionsContainer.PropertyChanged -= ContainerPropertyChanged; + if (formattingPolicy != null) { + formattingPolicy.OptionsContainer.PropertyChanged -= ContainerPropertyChanged; } - persistenceHelper = CSharpFormattingOptionsPersistence.GetProjectOptions(project); - formattingEditor.OptionsContainer = persistenceHelper.OptionsContainer; + formattingPolicy = CSharpFormattingPolicies.Instance.GetProjectOptions(project); + formattingEditor.OptionsContainer = formattingPolicy.OptionsContainer; formattingEditor.AllowPresets = true; - persistenceHelper.OptionsContainer.PropertyChanged += ContainerPropertyChanged; + formattingEditor.OverrideGlobalIndentation = true; + formattingPolicy.OptionsContainer.PropertyChanged += ContainerPropertyChanged; } protected override bool Save(ICSharpCode.SharpDevelop.Project.MSBuildBasedProject project, string configuration, string platform) { - bool success = (persistenceHelper != null) && persistenceHelper.Save(); + bool success = (formattingPolicy != null) && formattingPolicy.Save(); return base.Save(project, configuration, platform) && success; } diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs index afcd34aff9..fbd05adfc5 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs @@ -24,6 +24,7 @@ using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; +using ICSharpCode.NRefactory.Analysis; using CSharpBinding.Parser; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Highlighting; @@ -51,27 +52,46 @@ namespace CSharpBinding /// public class CSharpSymbolSearch : ISymbolSearch { - IProject project; - ICompilation compilation; - FindReferences fr = new FindReferences(); - IList searchScopes; - IList[] interestingFileNames; - int workAmount; - double workAmountInverse; + readonly IProject project; + readonly ICompilation compilation; + readonly FindReferences fr = new FindReferences(); + readonly IList searchScopes; + readonly Dictionary> searchScopesPerFile; + readonly int workAmount; + readonly double workAmountInverse; public CSharpSymbolSearch(IProject project, ISymbol entity) { this.project = project; - searchScopes = fr.GetSearchScopes(entity); compilation = SD.ParserService.GetCompilation(project); - interestingFileNames = new IList[searchScopes.Count]; + var relatedSymbols = GetRelatedSymbols(entity); + if ((relatedSymbols != null) && relatedSymbols.Any()) { + searchScopes = relatedSymbols.SelectMany(e => fr.GetSearchScopes(e)).ToList(); + } else { + searchScopes = fr.GetSearchScopes(entity); + } + + searchScopesPerFile = new Dictionary>(); for (int i = 0; i < searchScopes.Count; i++) { - interestingFileNames[i] = fr.GetInterestingFiles(searchScopes[i], compilation).Select(f => f.FileName).ToList(); - workAmount += interestingFileNames[i].Count; + var thisSearchScope = searchScopes[i]; + var interestingFiles = fr.GetInterestingFiles(thisSearchScope, compilation).Select(f => f.FileName); + foreach (var file in interestingFiles) { + if (!searchScopesPerFile.ContainsKey(file)) + searchScopesPerFile[file] = new List(); + searchScopesPerFile[file].Add(thisSearchScope); + workAmount++; + } } workAmountInverse = 1.0 / workAmount; } + IEnumerable GetRelatedSymbols(ISymbol entity) + { + TypeGraph typeGraph = new TypeGraph(new [] { compilation.MainAssembly }); + var symbolCollector = new SymbolCollector(); + return symbolCollector.GetRelatedSymbols(typeGraph, entity); + } + public double WorkAmount { get { return workAmount; } } @@ -83,38 +103,36 @@ namespace CSharpBinding var cancellationToken = args.ProgressMonitor.CancellationToken; return Task.Run( () => { - for (int i = 0; i < searchScopes.Count; i++) { - IFindReferenceSearchScope searchScope = searchScopes[i]; - object progressLock = new object(); - Parallel.ForEach( - interestingFileNames[i], - new ParallelOptions { - MaxDegreeOfParallelism = Environment.ProcessorCount, - CancellationToken = cancellationToken - }, - delegate (string fileName) { - try { - FindReferencesInFile(args, searchScope, FileName.Create(fileName), callback, cancellationToken); - } catch (OperationCanceledException) { - throw; - } catch (Exception ex) { - throw new ApplicationException("Error searching in file '" + fileName + "'", ex); - } - lock (progressLock) - args.ProgressMonitor.Progress += workAmountInverse; - }); - } + object progressLock = new object(); + Parallel.ForEach( + searchScopesPerFile.Keys, + new ParallelOptions { + MaxDegreeOfParallelism = Environment.ProcessorCount, + CancellationToken = cancellationToken + }, + delegate (string fileName) { + try { + FindReferencesInFile(args, searchScopesPerFile[fileName], FileName.Create(fileName), callback, cancellationToken); + } catch (OperationCanceledException) { + throw; + } catch (Exception ex) { + throw new ApplicationException("Error searching in file '" + fileName + "'", ex); + } + lock (progressLock) + args.ProgressMonitor.Progress += workAmountInverse; + }); }, cancellationToken ); } - void FindReferencesInFile(SymbolSearchArgs args, IFindReferenceSearchScope searchScope, FileName fileName, Action callback, CancellationToken cancellationToken) + void FindReferencesInFile(SymbolSearchArgs args, IList searchScopeList, FileName fileName, Action callback, CancellationToken cancellationToken) { ITextSource textSource = args.ParseableFileContentFinder.Create(fileName); if (textSource == null) return; - if (searchScope.SearchTerm != null) { - if (textSource.IndexOf(searchScope.SearchTerm, 0, textSource.TextLength, StringComparison.Ordinal) < 0) + if (searchScopeList != null) { + if (!searchScopeList.DistinctBy(scope => scope.SearchTerm ?? String.Empty).Any( + scope => (scope.SearchTerm == null) || (textSource.IndexOf(scope.SearchTerm, 0, textSource.TextLength, StringComparison.Ordinal) >= 0))) return; } @@ -134,7 +152,7 @@ namespace CSharpBinding } fr.FindReferencesInFile( - searchScope, unresolvedFile, parseInfo.SyntaxTree, compilation, + searchScopeList, unresolvedFile, parseInfo.SyntaxTree, compilation, delegate (AstNode node, ResolveResult result) { if (document == null) { document = new ReadOnlyDocument(textSource, fileName); @@ -154,8 +172,18 @@ namespace CSharpBinding if (highlighter != null) { highlighter.Dispose(); } - if (results.Count > 0) - callback(new SearchedFile(fileName, results)); + if (results.Count > 0) { + // Remove overlapping results + List fixedResults = new List(); + int lastEndOffset = 0; + foreach (var result in results.OrderBy(m => m.StartOffset)) { + if (result.StartOffset >= lastEndOffset) { + fixedResults.Add(result); + lastEndOffset = result.EndOffset; + } + } + callback(new SearchedFile(fileName, fixedResults)); + } } public Task RenameAsync(SymbolRenameArgs args, Action callback, Action errorCallback) @@ -166,32 +194,30 @@ namespace CSharpBinding return Task.Run( () => { bool isNameValid = Mono.CSharp.Tokenizer.IsValidIdentifier(args.NewName); - for (int i = 0; i < searchScopes.Count; i++) { - IFindReferenceSearchScope searchScope = searchScopes[i]; - object progressLock = new object(); - Parallel.ForEach( - interestingFileNames[i], - new ParallelOptions { - MaxDegreeOfParallelism = Environment.ProcessorCount, - CancellationToken = cancellationToken - }, - delegate (string fileName) { - RenameReferencesInFile(args, searchScope, FileName.Create(fileName), callback, errorCallback, isNameValid, cancellationToken); - lock (progressLock) - args.ProgressMonitor.Progress += workAmountInverse; - }); - } + object progressLock = new object(); + Parallel.ForEach( + searchScopesPerFile.Keys, + new ParallelOptions { + MaxDegreeOfParallelism = Environment.ProcessorCount, + CancellationToken = cancellationToken + }, + delegate (string fileName) { + RenameReferencesInFile(args, searchScopesPerFile[fileName], FileName.Create(fileName), callback, errorCallback, isNameValid, cancellationToken); + lock (progressLock) + args.ProgressMonitor.Progress += workAmountInverse; + }); }, cancellationToken ); } - void RenameReferencesInFile(SymbolRenameArgs args, IFindReferenceSearchScope searchScope, FileName fileName, Action callback, Action errorCallback, bool isNameValid, CancellationToken cancellationToken) + void RenameReferencesInFile(SymbolRenameArgs args, IList searchScopeList, FileName fileName, Action callback, Action errorCallback, bool isNameValid, CancellationToken cancellationToken) { ITextSource textSource = args.ParseableFileContentFinder.Create(fileName); if (textSource == null) return; - if (searchScope.SearchTerm != null) { - if (textSource.IndexOf(searchScope.SearchTerm, 0, textSource.TextLength, StringComparison.Ordinal) < 0) + if (searchScopeList != null) { + if (!searchScopeList.DistinctBy(scope => scope.SearchTerm ?? String.Empty).Any( + scope => (scope.SearchTerm == null) || (textSource.IndexOf(scope.SearchTerm, 0, textSource.TextLength, StringComparison.Ordinal) >= 0))) return; } @@ -213,7 +239,7 @@ namespace CSharpBinding CSharpAstResolver resolver = new CSharpAstResolver(compilation, parseInfo.SyntaxTree, unresolvedFile); fr.RenameReferencesInFile( - new[] { searchScope }, args.NewName, resolver, + searchScopeList, args.NewName, resolver, delegate (RenameCallbackArguments callbackArgs) { var node = callbackArgs.NodeToReplace; string newCode = callbackArgs.NewNode.ToString(); @@ -249,10 +275,16 @@ namespace CSharpBinding } IDocument changedDocument = new TextDocument(document); var oldVersion = changedDocument.Version; + List fixedResults = new List(); + int lastStartOffset = changedDocument.TextLength + 1; foreach (var result in results.OrderByDescending(m => m.StartOffset)) { - changedDocument.Replace(result.StartOffset, result.Length, result.NewCode); + if (result.EndOffset <= lastStartOffset) { + changedDocument.Replace(result.StartOffset, result.Length, result.NewCode); + fixedResults.Add(result); + lastStartOffset = result.StartOffset; + } } - callback(new PatchedFile(fileName, results, oldVersion, changedDocument.Version)); + callback(new PatchedFile(fileName, fixedResults, oldVersion, changedDocument.Version)); } } } diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/CSharpCodeGenerator.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/CSharpCodeGenerator.cs index a341e62b93..9902fef703 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/CSharpCodeGenerator.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/CSharpCodeGenerator.cs @@ -86,7 +86,10 @@ namespace CSharpBinding.Refactoring var node = context.RootNode.GetNodeAt(last.Region.Begin); var resolver = context.GetResolverStateAfter(node); var builder = new TypeSystemAstBuilder(resolver); - var delegateDecl = builder.ConvertEntity(eventDefinition.ReturnType.GetDefinition()) as DelegateDeclaration; + var invokeMethod = eventDefinition.ReturnType.GetDelegateInvokeMethod(); + if (invokeMethod == null) return; + var importedMethod = resolver.Compilation.Import(invokeMethod); + var delegateDecl = builder.ConvertEntity(importedMethod) as MethodDeclaration; if (delegateDecl == null) return; var throwStmt = new ThrowStatement(new ObjectCreateExpression(context.CreateShortType("System", "NotImplementedException"))); var decl = new MethodDeclaration() { @@ -96,7 +99,7 @@ namespace CSharpBinding.Refactoring throwStmt } }; - var param = delegateDecl.Parameters.Select(p => p.Clone()).OfType().ToArray(); + var param = delegateDecl.Parameters.Select(p => p.Clone()).ToArray(); decl.Parameters.AddRange(param); using (Script script = context.StartScript()) { diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/InsertCtorDialog.xaml.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/InsertCtorDialog.xaml.cs index 2ff47fa0b7..973dbd97c7 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/InsertCtorDialog.xaml.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/InsertCtorDialog.xaml.cs @@ -171,7 +171,7 @@ namespace CSharpBinding.Refactoring using (StringWriter textWriter = new StringWriter(pList)) { // Output parameter list as string - var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(refactoringContext.Compilation.GetProject()); + var formattingOptions = CSharpFormattingPolicies.Instance.GetProjectOptions(refactoringContext.Compilation.GetProject()); CSharpOutputVisitor outputVisitor = new CSharpOutputVisitor(textWriter, formattingOptions.OptionsContainer.GetEffectiveOptions()); for (int i = 0; i < parameters.Count; i++) { if (i > 0) diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/MoveTypeToFileContextAction.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/MoveTypeToFileContextAction.cs index 6e42276226..014ea3a7cc 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/MoveTypeToFileContextAction.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/MoveTypeToFileContextAction.cs @@ -109,7 +109,7 @@ namespace CSharpBinding.Refactoring || ch is UsingAliasDeclaration || ch is ExternAliasDeclaration); StringBuilder newCode = new StringBuilder(header); - var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(compilation.GetProject()); + var formattingOptions = CSharpFormattingPolicies.Instance.GetProjectOptions(compilation.GetProject()); CSharpOutputVisitor visitor = new CSharpOutputVisitor(new StringWriter(newCode), formattingOptions.OptionsContainer.GetEffectiveOptions()); foreach (var topLevelUsing in topLevelUsings) diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SDRefactoringContext.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SDRefactoringContext.cs index 134f7fc14a..1fa3af1f23 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SDRefactoringContext.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SDRefactoringContext.cs @@ -119,13 +119,16 @@ namespace CSharpBinding.Refactoring public Script StartScript() { - var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(resolver.Compilation.GetProject()); + var formattingOptions = CSharpFormattingPolicies.Instance.GetProjectOptions(resolver.Compilation.GetProject()); if (editor != null) return new EditorScript(editor, this, formattingOptions.OptionsContainer.GetEffectiveOptions()); else if (document == null || document is ReadOnlyDocument) throw new InvalidOperationException("Cannot start a script in a read-only context"); - else - return new DocumentScript(document, formattingOptions.OptionsContainer.GetEffectiveOptions(), this.TextEditorOptions); + else { + var textEditorOptions = this.TextEditorOptions; + formattingOptions.OptionsContainer.CustomizeEditorOptions(textEditorOptions); + return new DocumentScript(document, formattingOptions.OptionsContainer.GetEffectiveOptions(), textEditorOptions); + } } public IDocument Document { diff --git a/src/AddIns/Debugger/Debugger.AddIn/Breakpoints/BreakpointEditorPopup.xaml.cs b/src/AddIns/Debugger/Debugger.AddIn/Breakpoints/BreakpointEditorPopup.xaml.cs index d8d95b4b35..f22ae4e3ed 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Breakpoints/BreakpointEditorPopup.xaml.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Breakpoints/BreakpointEditorPopup.xaml.cs @@ -41,7 +41,8 @@ namespace Debugger.AddIn.Breakpoints { InitializeComponent(); this.DataContext = target; - condition.DebugContext = new DebuggerCompletionContext(target.FileName, target.Location); + condition.ContextFileName = target.FileName; + condition.ContextTextLocation = target.Location; condition.FontFamily = new FontFamily(SD.EditorControlService.GlobalOptions.FontFamily); condition.FontSize = SD.EditorControlService.GlobalOptions.FontSize; if (target.Condition == null) diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/AutoCompleteTextBox.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/AutoCompleteTextBox.cs index 8088d9771b..aca8f0c0b6 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/AutoCompleteTextBox.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/AutoCompleteTextBox.cs @@ -64,7 +64,8 @@ namespace Debugger.AddIn.Pads.Controls set { SetValue(IsEditableProperty, value); } } - public DebuggerCompletionContext DebugContext { get; set; } + public FileName ContextFileName { get; set; } + public TextLocation ContextTextLocation { get; set; } static void TextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { @@ -127,20 +128,15 @@ namespace Debugger.AddIn.Pads.Controls void editor_TextArea_TextEntered(object sender, TextCompositionEventArgs e) { if (e.Text == ".") { - DebuggerCompletionContext context = null; StackFrame frame = WindowsDebugger.CurrentStackFrame; - if (frame == null) { - if (DebugContext != null) { - context = DebugContext; - } - } else { - context = new DebuggerCompletionContext(frame); + if (frame != null) { + ContextFileName = new FileName(frame.NextStatement.Filename); + ContextTextLocation = new TextLocation(frame.NextStatement.StartLine, frame.NextStatement.StartColumn); } - if (context == null) return; - var binding = DebuggerDotCompletion.PrepareDotCompletion(editor.Text.Substring(0, editor.CaretOffset), context); + if (ContextFileName == null) return; + var binding = DebuggerDotCompletion.PrepareDotCompletion(editor.Text.Substring(0, editor.CaretOffset), ContextFileName, ContextTextLocation, SD.ParserService.ResolveContext(ContextFileName, ContextTextLocation)); if (binding == null) return; binding.HandleKeyPressed(editorAdapter, '.'); - SD.ParserService.ParseFileAsync(context.FileName).FireAndForget(); } else { // TODO : implement automated error checking CSharpParser.ParseExpression does not report useful error messages. // Error[] errors; diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/ConsolePad.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/ConsolePad.cs index 31c122f002..c88df18834 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/ConsolePad.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/ConsolePad.cs @@ -86,10 +86,11 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads void ShowDotCompletion(StackFrame frame, string currentText) { - var binding = DebuggerDotCompletion.PrepareDotCompletion(currentText, new DebuggerCompletionContext(frame)); + var fileName = new ICSharpCode.Core.FileName(frame.NextStatement.Filename); + var textLocation = new TextLocation(frame.NextStatement.StartLine, frame.NextStatement.StartColumn); + var binding = DebuggerDotCompletion.PrepareDotCompletion(currentText, fileName, textLocation, SD.ParserService.ResolveContext(fileName, textLocation)); if (binding == null) return; binding.HandleKeyPressed(console.TextEditor, '.'); - SD.ParserService.ParseFileAsync(new ICSharpCode.Core.FileName(frame.NextStatement.Filename)).FireAndForget(); } protected override ToolBar BuildToolBar() diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/DebuggerDotCompletion.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/DebuggerDotCompletion.cs index 4518c832ae..854abc5cca 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/DebuggerDotCompletion.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/DebuggerDotCompletion.cs @@ -41,162 +41,12 @@ namespace Debugger.AddIn.Pads.Controls return !errors.Any(); } - public static ICodeCompletionBinding PrepareDotCompletion(string expressionToComplete, DebuggerCompletionContext context) + public static ICodeCompletionBinding PrepareDotCompletion(string expressionToComplete, FileName fileName, TextLocation location, ICodeContext context) { - var lang = SD.LanguageService.GetLanguageByFileName(context.FileName); + var lang = SD.LanguageService.GetLanguageByFileName(fileName); if (lang == null) return null; - string content = GeneratePartialClassContextStub(context); - const string caretPoint = "$__Caret_Point__$;"; - int caretOffset = content.IndexOf(caretPoint, StringComparison.Ordinal) + expressionToComplete.Length; - SD.Log.DebugFormatted("context used for dot completion: {0}", content.Replace(caretPoint, "$" + expressionToComplete + "|$")); - var doc = new ReadOnlyDocument(content.Replace(caretPoint, expressionToComplete)); - return lang.CreateCompletionBinding(context.FileName, doc.GetLocation(caretOffset), doc.CreateSnapshot()); - } - - static string GeneratePartialClassContextStub(DebuggerCompletionContext context) - { - var compilation = SD.ParserService.GetCompilationForFile(context.FileName); - var file = SD.ParserService.GetExistingUnresolvedFile(context.FileName); - if (compilation == null || file == null) - return ""; - var unresolvedMember = file.GetMember(context.Location); - if (unresolvedMember == null) - return ""; - var member = unresolvedMember.Resolve(new SimpleTypeResolveContext(compilation.MainAssembly)); - if (member == null) - return ""; - var builder = new TypeSystemAstBuilder(); - MethodDeclaration decl; - if (unresolvedMember is IMethod) { - // If it's a method, convert it directly (including parameters + type parameters) - decl = (MethodDeclaration)builder.ConvertEntity(member); - } else { - // Otherwise, create a method anyways, and copy the parameters - decl = new MethodDeclaration(); - if (member is IParameterizedMember) { - foreach (var p in ((IParameterizedMember)member).Parameters) { - decl.Parameters.Add(builder.ConvertParameter(p)); - } - } - } - decl.Name = "__DebuggerStub__"; - decl.ReturnType = builder.ConvertType(member.ReturnType); - decl.Modifiers = unresolvedMember.IsStatic ? Modifiers.Static : Modifiers.None; - // Make the method look like an explicit interface implementation so that it doesn't appear in CC - decl.PrivateImplementationType = new SimpleType("__DummyType__"); - decl.Body = GenerateBodyFromContext(builder, context); - return WrapInType(unresolvedMember.DeclaringTypeDefinition, decl).ToString(); - } - - static BlockStatement GenerateBodyFromContext(TypeSystemAstBuilder builder, DebuggerCompletionContext context) - { - var body = new BlockStatement(); - foreach (var v in context.Variables) - body.Statements.Add(new VariableDeclarationStatement(builder.ConvertType(v.Type), v.Name)); - body.Statements.Add(new ExpressionStatement(new IdentifierExpression("$__Caret_Point__$"))); - return body; - } - - static AstNode WrapInType(IUnresolvedTypeDefinition entity, EntityDeclaration decl) - { - if (entity == null) - return decl; - // Wrap decl in TypeDeclaration - decl = new TypeDeclaration { - ClassType = GetClassType(entity), - Modifiers = Modifiers.Partial, - Name = entity.Name, - Members = { decl } - }; - if (entity.DeclaringTypeDefinition != null) { - // Handle nested types - return WrapInType(entity.DeclaringTypeDefinition, decl); - } - if (string.IsNullOrEmpty(entity.Namespace)) - return decl; - return new NamespaceDeclaration(entity.Namespace) { - Members = { - decl - } - }; - } - - static ClassType GetClassType(IUnresolvedTypeDefinition entity) - { - switch (entity.Kind) { - case TypeKind.Interface: - return ClassType.Interface; - case TypeKind.Struct: - return ClassType.Struct; - default: - return ClassType.Class; - } - } - } - - public class LocalVariable - { - readonly IType type; - - public IType Type { - get { - return type; - } - } - - readonly string name; - - public string Name { - get { - return name; - } - } - - public LocalVariable(IType type, string name) - { - this.type = type; - this.name = name; - } - } - - public class DebuggerCompletionContext - { - readonly FileName fileName; - TextLocation location; - readonly LocalVariable[] variables; - - public DebuggerCompletionContext(StackFrame frame) - { - fileName = new FileName(frame.NextStatement.Filename); - location = new TextLocation(frame.NextStatement.StartLine, frame.NextStatement.StartColumn); - variables = frame.GetLocalVariables().Select(v => new LocalVariable(v.Type, v.Name)).ToArray(); - } - - public DebuggerCompletionContext(FileName fileName, TextLocation location) - { - this.fileName = fileName; - this.location = location; - this.variables = SD.ParserService.ResolveContext(fileName, location) - .LocalVariables.Select(v => new LocalVariable(v.Type, v.Name)).ToArray(); - } - - public FileName FileName { - get { - return fileName; - } - } - - public TextLocation Location { - get { - return location; - } - } - - public LocalVariable[] Variables { - get { - return variables; - } + return lang.CreateCompletionBinding(expressionToComplete, fileName, location, context); } } } diff --git a/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs b/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs index 87aad31e06..719292fc05 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs @@ -104,9 +104,11 @@ namespace ICSharpCode.SharpDevelop.Services return; int start = index; // find start of current line - while (--start > 0 && fullText[start - 1] != '\n'); + while (start > 0 && fullText[start - 1] != '\n') + start--; // find end of current line - while (++index < fullText.Length && fullText[index] != '\n'); + while (index < fullText.Length && fullText[index] != '\n') + index++; string textLine = fullText.Substring(start, index - start); diff --git a/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs b/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs index 59192cf6c4..5bc4f6f773 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs @@ -633,6 +633,8 @@ namespace ICSharpCode.SharpDevelop.Services return; if (CurrentStackFrame == null) return; + if (!e.InDocument) + return; var resolveResult = SD.ParserService.Resolve(e.Editor, e.LogicalPosition, CurrentStackFrame.AppDomain.Compilation); if (resolveResult == null) return; diff --git a/src/AddIns/Debugger/Debugger.Core/NDebugger.cs b/src/AddIns/Debugger/Debugger.Core/NDebugger.cs index e2cc15a5a6..ed7c9e13b0 100644 --- a/src/AddIns/Debugger/Debugger.Core/NDebugger.cs +++ b/src/AddIns/Debugger/Debugger.Core/NDebugger.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; using System.Threading; using Debugger.Interop; @@ -265,7 +266,7 @@ namespace Debugger public void Detach() { // Detach all processes. - foreach(Process process in this.Processes) { + foreach(Process process in this.Processes.ToArray()) { if (process == null || process.HasExited) continue; process.Detach(); diff --git a/src/AddIns/Debugger/Debugger.Core/Process.cs b/src/AddIns/Debugger/Debugger.Core/Process.cs index 6ebdeee737..da2cc09f06 100644 --- a/src/AddIns/Debugger/Debugger.Core/Process.cs +++ b/src/AddIns/Debugger/Debugger.Core/Process.cs @@ -527,8 +527,16 @@ namespace Debugger System.Threading.Thread.Sleep(0); // Stop&terminate - both must be called - corProcess.Stop(uint.MaxValue); - corProcess.Terminate(0); + try { + corProcess.Stop(uint.MaxValue); + corProcess.Terminate(0); + } catch (COMException ex) { + if (ex.ErrorCode == unchecked((int)0x80131301)) { + // COMException (0x80131301): Process was terminated. + } else { + throw; + } + } this.TerminateCommandIssued = true; // Do not mark the process as exited diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorAdapter.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorAdapter.cs index 0873442d6d..e747ab6177 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorAdapter.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorAdapter.cs @@ -38,12 +38,14 @@ namespace ICSharpCode.AvalonEdit.AddIn sealed class CodeEditorAdapter : CodeCompletionEditorAdapter { readonly CodeEditor codeEditor; + ITextEditorOptions options; public CodeEditorAdapter(CodeEditor codeEditor, CodeEditorView textEditor) : base(textEditor) { if (codeEditor == null) throw new ArgumentNullException("codeEditor"); this.codeEditor = codeEditor; + options = CodeEditorOptions.Instance; } public override FileName FileName { @@ -78,9 +80,14 @@ namespace ICSharpCode.AvalonEdit.AddIn internal void DetachExtensions() { if (extensions != null) { - foreach (var extension in extensions) - extension.Detach(); + // Detach extensions in reverse order + for (int i = extensions.Count - 1; i >= 0; i--) { + extensions[i].Detach(); + } } + + // Switch to global options, if no specific options service is registered + options = this.GetService() ?? CodeEditorOptions.Instance; } @@ -90,6 +97,13 @@ namespace ICSharpCode.AvalonEdit.AddIn foreach (var extension in extensions) extension.Attach(this); } + + // If we have any registered ITextEditorOptions service now, use it, otherwise global options + options = this.GetService() ?? CodeEditorOptions.Instance; + } + + public override ITextEditorOptions Options { + get { return options; } } sealed class OptionControlledIndentationStrategy : IndentationStrategyAdapter diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActions/GoToEntityAction.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActions/GoToEntityAction.cs index 8903371ca3..82bbbc556f 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActions/GoToEntityAction.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActions/GoToEntityAction.cs @@ -23,6 +23,7 @@ using System.Threading.Tasks; using ICSharpCode.AvalonEdit.CodeCompletion; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop; +using ICSharpCode.SharpDevelop.Editor.CodeCompletion; using ICSharpCode.SharpDevelop.Editor.ContextActions; using ICSharpCode.SharpDevelop.Refactoring; diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.cs index 4960bf507b..bedc044ae4 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.cs @@ -26,6 +26,7 @@ using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.NRefactory.TypeSystem.Implementation; using ICSharpCode.SharpDevelop; +using ICSharpCode.SharpDevelop.Editor.CodeCompletion; using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; diff --git a/src/AddIns/DisplayBindings/HexEditor/Project/Src/Editor.cs b/src/AddIns/DisplayBindings/HexEditor/Project/Src/Editor.cs index c88ff715ba..fab5025825 100644 --- a/src/AddIns/DisplayBindings/HexEditor/Project/Src/Editor.cs +++ b/src/AddIns/DisplayBindings/HexEditor/Project/Src/Editor.cs @@ -1413,6 +1413,14 @@ namespace HexEditor this.Delete(); } break; + // Ctrl-Y is pressed -> redo + case 89: + Redo(); + break; + // Ctrl-Z is pressed -> undo + case 90: + Undo(); + break; } break; } diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs index 12d74a23aa..de246b0a27 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs @@ -20,6 +20,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.Text; using System.Threading; using ICSharpCode.Core; using ICSharpCode.NRefactory; @@ -82,7 +83,32 @@ namespace ICSharpCode.ILSpyAddIn public ResolveResult ResolveSnippet(ParseInformation parseInfo, TextLocation location, string codeSnippet, ICompilation compilation, CancellationToken cancellationToken) { - return null; + var decompiledParseInfo = parseInfo as ILSpyFullParseInformation; + if (decompiledParseInfo == null) + throw new ArgumentException("ParseInfo does not have SyntaxTree"); + CSharpAstResolver contextResolver = new CSharpAstResolver(compilation, decompiledParseInfo.SyntaxTree, null); + var node = decompiledParseInfo.SyntaxTree.GetNodeAt(location); + CSharpResolver context; + if (node != null) + context = contextResolver.GetResolverStateAfter(node, cancellationToken); + else + context = new CSharpResolver(compilation); + CSharpParser parser = new CSharpParser(); + var expr = parser.ParseExpression(codeSnippet); + if (parser.HasErrors) + return new ErrorResolveResult(SpecialType.UnknownType, PrintErrorsAsString(parser.Errors), TextLocation.Empty); + CSharpAstResolver snippetResolver = new CSharpAstResolver(context, expr); + return snippetResolver.Resolve(expr, cancellationToken); + } + + string PrintErrorsAsString(IEnumerable errors) + { + StringBuilder builder = new StringBuilder(); + + foreach (var error in errors) + builder.AppendLine(error.Message); + + return builder.ToString(); } public void FindLocalReferences(ParseInformation parseInfo, ITextSource fileContent, IVariable variable, ICompilation compilation, Action callback, CancellationToken cancellationToken) diff --git a/src/AddIns/DisplayBindings/IconEditor/PickFormatDialog.Designer.cs b/src/AddIns/DisplayBindings/IconEditor/PickFormatDialog.Designer.cs index c0b83322fb..4815c9c6c2 100644 --- a/src/AddIns/DisplayBindings/IconEditor/PickFormatDialog.Designer.cs +++ b/src/AddIns/DisplayBindings/IconEditor/PickFormatDialog.Designer.cs @@ -133,7 +133,6 @@ namespace ICSharpCode.IconEditor "Monochrome", "4 bit", "8 bit", - "16 bit", "24 bit", "32 bit"}); this.colorDepthComboBox.Location = new System.Drawing.Point(93, 73); diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs index 48fee4dbe8..85d3229f24 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs @@ -377,28 +377,35 @@ namespace ICSharpCode.WpfDesign.Designer placementOp = PlacementOperation.Start(Context.Services.Selection.SelectedItems, PlacementType.Move); } + switch (e.Key) { + case Key.Left: + dx += Keyboard.IsKeyDown(Key.LeftShift) ? -10 : -1; + break; + case Key.Up: + dy += Keyboard.IsKeyDown(Key.LeftShift) ? -10 : -1; + break; + case Key.Right: + dx += Keyboard.IsKeyDown(Key.LeftShift) ? 10 : 1; + break; + case Key.Down: + dy += Keyboard.IsKeyDown(Key.LeftShift) ? 10 : 1; + break; + } - dx = (e.Key == Key.Left) ? Keyboard.IsKeyDown(Key.LeftShift) ? -10 : -1 : 0; - dy = (e.Key == Key.Up) ? Keyboard.IsKeyDown(Key.LeftShift) ? -10 : -1 : 0; - dx = (e.Key == Key.Right) ? Keyboard.IsKeyDown(Key.LeftShift) ? 10 : 1 : (dx != 0 ? dx : 0); - dy = (e.Key == Key.Down) ? Keyboard.IsKeyDown(Key.LeftShift) ? 10 : 1 : (dy != 0 ? dy : 0); - double left, top; foreach (PlacementInformation info in placementOp.PlacedItems) { - //Let canvas position preceed bounds definition since there can be a discrepancy between them. - left = IsPropertySet(info.Item.View,Canvas.LeftProperty)?(double)info.Item.Properties.GetAttachedProperty(Canvas.LeftProperty).ValueOnInstance: info.OriginalBounds.Left; - - top = IsPropertySet(info.Item.View, Canvas.TopProperty) ? (double)info.Item.Properties.GetAttachedProperty(Canvas.TopProperty).ValueOnInstance : info.OriginalBounds.Top; + var bounds = info.OriginalBounds; + if (!Keyboard.IsKeyDown(Key.LeftCtrl)) { - info.Bounds = new Rect(left + dx, - top + dy, - info.OriginalBounds.Width, - info.OriginalBounds.Height); + info.Bounds = new Rect(bounds.Left + dx, + bounds.Top + dy, + bounds.Width, + bounds.Height); } else { - info.Bounds = new Rect(left, - top, - info.OriginalBounds.Width + dx, - info.OriginalBounds.Height + dy); + info.Bounds = new Rect(bounds.Left, + bounds.Top, + bounds.Width + dx, + bounds.Height + dy); } placementOp.CurrentContainerBehavior.SetPosition(info); } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/CanvasPlacementSupport.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/CanvasPlacementSupport.cs index 206796fda3..bc776c99ca 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/CanvasPlacementSupport.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/CanvasPlacementSupport.cs @@ -58,6 +58,32 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions extendedView = (FrameworkElement)this.ExtendedItem.View; } + public override Rect GetPosition(PlacementOperation operation, DesignItem item) + { + UIElement child = item.View; + + if (child == null) + return Rect.Empty; + + double x, y; + + if (IsPropertySet(child, Canvas.LeftProperty) || !IsPropertySet(child, Canvas.RightProperty)) { + x = GetCanvasProperty(child, Canvas.LeftProperty); + } else { + x = extendedComponent.ActualWidth - GetCanvasProperty(child, Canvas.RightProperty) - child.RenderSize.Width; + } + + + if (IsPropertySet(child, Canvas.TopProperty) || !IsPropertySet(child, Canvas.BottomProperty)) { + y = GetCanvasProperty(child, Canvas.TopProperty); + } else { + y = extendedComponent.ActualHeight - GetCanvasProperty(child, Canvas.BottomProperty) - child.RenderSize.Height; + } + + var p = new Point(x, y); + return new Rect(p, child.RenderSize); + } + public override void SetPosition(PlacementInformation info) { base.SetPosition(info); @@ -66,28 +92,26 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions UIElement child = info.Item.View; Rect newPosition = info.Bounds; - if (IsPropertySet(child, Canvas.RightProperty)) - { + if (IsPropertySet(child, Canvas.LeftProperty) || !IsPropertySet(child, Canvas.RightProperty)) { + if (newPosition.Left != GetCanvasProperty(child, Canvas.LeftProperty)) { + info.Item.Properties.GetAttachedProperty(Canvas.LeftProperty).SetValue(newPosition.Left); + } + } else { var newR = extendedComponent.ActualWidth - newPosition.Right; if (newR != GetCanvasProperty(child, Canvas.RightProperty)) info.Item.Properties.GetAttachedProperty(Canvas.RightProperty).SetValue(newR); } - else if (newPosition.Left != GetCanvasProperty(child, Canvas.LeftProperty)) - { - info.Item.Properties.GetAttachedProperty(Canvas.LeftProperty).SetValue(newPosition.Left); - } - if (IsPropertySet(child, Canvas.BottomProperty)) - { + if (IsPropertySet(child, Canvas.TopProperty) || !IsPropertySet(child, Canvas.BottomProperty)) { + if (newPosition.Top != GetCanvasProperty(child, Canvas.TopProperty)) { + info.Item.Properties.GetAttachedProperty(Canvas.TopProperty).SetValue(newPosition.Top); + } + } else { var newB = extendedComponent.ActualHeight - newPosition.Bottom; if (newB != GetCanvasProperty(child, Canvas.BottomProperty)) info.Item.Properties.GetAttachedProperty(Canvas.BottomProperty).SetValue(newB); } - else if (newPosition.Top != GetCanvasProperty(child, Canvas.TopProperty)) - { - info.Item.Properties.GetAttachedProperty(Canvas.TopProperty).SetValue(newPosition.Top); - } if (info.Item == Services.Selection.PrimarySelection) { diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs index a113913de2..90520ca808 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs @@ -121,7 +121,6 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions } else { bounds.Height = Math.Max(0, bounds.Height + delta); } - bounds.Height = Math.Max(0, bounds.Height - delta); info.Bounds = bounds; } else { foreach (var item in operation.PlacedItems) { @@ -145,7 +144,6 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions } else { bounds.Width = Math.Max(0, bounds.Width + delta); } - bounds.Width = Math.Max(0, bounds.Width - delta); info.Bounds = bounds; } else { foreach (var item in operation.PlacedItems) { @@ -189,7 +187,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions yield return designItem; if (designItem.ContentProperty.Value != null) { yield return designItem.ContentProperty.Value; - designItem = designItem.ContentProperty.Value; + designItem = ExtendedItem; //set designitem back to current control after yield } } } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/StackPanelPlacementSupport.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/StackPanelPlacementSupport.cs index 1656e5c0ea..3180cbb3a4 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/StackPanelPlacementSupport.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/StackPanelPlacementSupport.cs @@ -89,11 +89,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions public override void EnterContainer(PlacementOperation operation) { base.EnterContainer(operation); - foreach (var info in operation.PlacedItems) { - info.Item.Properties[FrameworkElement.MarginProperty].Reset(); - info.Item.Properties[FrameworkElement.HorizontalAlignmentProperty].Reset(); - info.Item.Properties[FrameworkElement.VerticalAlignmentProperty].Reset(); - } + _rectangle.Visibility = Visibility.Visible; } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlEditOperations.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlEditOperations.cs index 7f414eb460..e50b2798c2 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlEditOperations.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlEditOperations.cs @@ -131,7 +131,7 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml AddInParent(parent, pastedItems); pasted = true; } - } else if (pastedItems.Count == 1 && parent.ContentProperty.Value == null && parent.ContentProperty.ValueOnInstance == null && DefaultPlacementBehavior.CanContentControlAdd((ContentControl)parent.View)) { + } else if (pastedItems.Count == 1 && parent.ContentProperty.Value == null && parent.ContentProperty.ValueOnInstance == null && parent.View is ContentControl && DefaultPlacementBehavior.CanContentControlAdd((ContentControl)parent.View)) { AddInParent(parent, pastedItems); pasted = true; } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/ModelTests.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/ModelTests.cs index a32806a5e9..1419521e82 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/ModelTests.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/ModelTests.cs @@ -639,6 +639,34 @@ namespace ICSharpCode.WpfDesign.Tests.Designer AddBindingWithStaticResourceWhereResourceOnSameElement(true); } + [Test] + public void AddStaticResourceWhereResourceOnSameElement() + { + DesignItem button = CreateCanvasContext(""; + + AssertCanvasDesignerOutput(expectedXaml, button.Context); + AssertLog(""); + } + [Test] public void AddBrushAsResource() { @@ -668,6 +696,11 @@ namespace ICSharpCode.WpfDesign.Tests.Designer } public void AddNativeTypeAsResource(object component, string expectedXamlValue) + { + AddTypeAsResource(component, expectedXamlValue, "Controls0:", new string[] { "xmlns:Controls0=\"clr-namespace:System;assembly=mscorlib\""} ); + } + + public void AddTypeAsResource(object component, string expectedXamlValue, string typePrefix, String[] additionalXmlns) { DesignItem textBlock = CreateCanvasContext(""); DesignItem canvas = textBlock.Parent; @@ -687,11 +720,11 @@ namespace ICSharpCode.WpfDesign.Tests.Designer string typeName = component.GetType().Name; string expectedXaml = "\n" + - " " + expectedXamlValue + "\n" + + " <" + typePrefix + typeName + " x:Key=\"res1\">" + expectedXamlValue + "\n" + "\n" + ""; - AssertCanvasDesignerOutput(expectedXaml, textBlock.Context, "xmlns:Controls0=\"clr-namespace:System;assembly=mscorlib\""); + AssertCanvasDesignerOutput(expectedXaml, textBlock.Context, additionalXmlns); AssertLog(""); } @@ -736,6 +769,18 @@ namespace ICSharpCode.WpfDesign.Tests.Designer const int i = 123; AddNativeTypeAsResource(i, "123"); } + + [Test] + public void AddWpfEnumAsResource() + { + AddTypeAsResource(VerticalAlignment.Center, "Center", "", new string[0]); + } + + [Test] + public void AddCustomEnumAsResource() + { + AddTypeAsResource(MyEnum.One, "One", "t:", new string[0]); + } } public class MyMultiConverter : IMultiValueConverter @@ -760,4 +805,9 @@ namespace ICSharpCode.WpfDesign.Tests.Designer set { stringProp = value; } } } + + public enum MyEnum + { + One, Two + } } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/MarkupExtensionPrinter.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/MarkupExtensionPrinter.cs index d7b1b1949e..dd23b6eef2 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/MarkupExtensionPrinter.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/MarkupExtensionPrinter.cs @@ -38,36 +38,7 @@ namespace ICSharpCode.WpfDesign.XamlDom return false; } - foreach (var property in obj.Properties.Where((prop) => prop.IsSet)) - { - var value = property.PropertyValue; - if (value is XamlTextValue) - continue; - else - { - XamlObject xamlObject = value as XamlObject; - if (xamlObject == null || !xamlObject.IsMarkupExtension) - return false; - else { - var staticResource = xamlObject.Instance as System.Windows.StaticResourceExtension; - if (staticResource != null && - staticResource.ResourceKey != null) { - XamlObject parent = GetNonMarkupExtensionParent(xamlObject); - - if (parent != null) { - var parentLocalResource = parent.ServiceProvider.Resolver.FindLocalResource(staticResource.ResourceKey); - - // If resource with the specified key is declared locally on the same object as the StaticResource is being used the markup extension - // must be printed as element to find the resource, otherwise it will search from parent-parent and find none or another resource. - if (parentLocalResource != null) - return false; - } - } - } - } - } - - return true; + return CanPrint(obj, false, GetNonMarkupExtensionParent(obj)); } /// @@ -115,6 +86,28 @@ namespace ICSharpCode.WpfDesign.XamlDom return sb.ToString(); } + private static bool CanPrint(XamlObject obj, bool isNested, XamlObject nonMarkupExtensionParent) + { + if ((isNested || obj.ParentObject == nonMarkupExtensionParent) && IsStaticResourceThatReferencesLocalResource(obj, nonMarkupExtensionParent)) { + return false; + } + + foreach (var property in obj.Properties.Where((prop) => prop.IsSet)) { + var value = property.PropertyValue; + if (value is XamlTextValue) + continue; + else { + var xamlObject = value as XamlObject; + if (xamlObject == null || !xamlObject.IsMarkupExtension) + return false; + else + return CanPrint(xamlObject, true, nonMarkupExtensionParent); + } + } + + return true; + } + private static XamlObject GetNonMarkupExtensionParent(XamlObject markupExtensionObject) { System.Diagnostics.Debug.Assert(markupExtensionObject.IsMarkupExtension); @@ -125,5 +118,21 @@ namespace ICSharpCode.WpfDesign.XamlDom } return obj; } + + private static bool IsStaticResourceThatReferencesLocalResource(XamlObject obj, XamlObject nonMarkupExtensionParent) + { + var staticResource = obj.Instance as System.Windows.StaticResourceExtension; + if (staticResource != null && staticResource.ResourceKey != null && nonMarkupExtensionParent != null) { + + var parentLocalResource = nonMarkupExtensionParent.ServiceProvider.Resolver.FindLocalResource(staticResource.ResourceKey); + + // If resource with the specified key is declared locally on the same object as the StaticResource is being used the markup extension + // must be printed as element to find the resource, otherwise it will search from parent-parent and find none or another resource. + if (parentLocalResource != null) + return true; + } + + return false; + } } } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlDocument.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlDocument.cs index 48ee85ec63..b517eea9f0 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlDocument.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlDocument.cs @@ -275,7 +275,7 @@ namespace ICSharpCode.WpfDesign.XamlDom bool IsNativeType(object instance) { - return instance.GetType().Assembly == typeof(String).Assembly; + return instance.GetType().Assembly == typeof(String).Assembly || instance.GetType().IsEnum; } } } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs index 7006c57cf7..003b9ef987 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs @@ -726,6 +726,7 @@ namespace ICSharpCode.WpfDesign.XamlDom XamlParser parser = new XamlParser(); parser.settings = settings; + parser.errorSink = (IXamlErrorSink)settings.ServiceProvider.GetService(typeof(IXamlErrorSink)); parser.document = root.OwnerDocument; var xamlObject = parser.ParseObject(element as XmlElement); if (xamlObject != null) diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementInformation.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementInformation.cs index 34832763b3..4bae5b1140 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementInformation.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementInformation.cs @@ -28,9 +28,9 @@ namespace ICSharpCode.WpfDesign { /// /// The designer rounds bounds to this number of digits to avoid floating point errors. - /// Value: 1 + /// Value: 0 /// - public const int BoundsPrecision = 1; + public const int BoundsPrecision = 0; Rect originalBounds, bounds; readonly DesignItem item; diff --git a/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.Designer.cs b/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.Designer.cs index 1970bae87d..fc94603d6f 100644 --- a/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.Designer.cs +++ b/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.Designer.cs @@ -38,7 +38,7 @@ namespace ICSharpCode.FiletypeRegisterer } base.Dispose(disposing); } - + /// /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might @@ -53,24 +53,25 @@ namespace ICSharpCode.FiletypeRegisterer // captionLabel // this.captionLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Right))); this.captionLabel.Location = new System.Drawing.Point(3, 0); this.captionLabel.Name = "captionLabel"; this.captionLabel.Size = new System.Drawing.Size(328, 23); this.captionLabel.TabIndex = 0; this.captionLabel.Text = "${res:ICSharpCode.SharpDevelop.Gui.Dialogs.OptionPanels.RegisterFiletypesPanel.Ca" + - "ptionLabel}"; + "ptionLabel}"; // // fileTypesListBox // this.fileTypesListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.fileTypesListBox.IntegralHeight = false; this.fileTypesListBox.Location = new System.Drawing.Point(3, 26); this.fileTypesListBox.Name = "fileTypesListBox"; this.fileTypesListBox.Size = new System.Drawing.Size(328, 299); this.fileTypesListBox.TabIndex = 1; + this.fileTypesListBox.MouseClick += new System.Windows.Forms.MouseEventHandler(this.fileTypesListBox_MouseClick); // // RegisterFiletypesPanel // @@ -79,6 +80,7 @@ namespace ICSharpCode.FiletypeRegisterer this.Name = "RegisterFiletypesPanel"; this.Size = new System.Drawing.Size(334, 328); this.ResumeLayout(false); + } private System.Windows.Forms.CheckedListBox fileTypesListBox; private System.Windows.Forms.Label captionLabel; diff --git a/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.cs b/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.cs index 2af5952278..0a40e941a1 100644 --- a/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.cs +++ b/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.cs @@ -80,5 +80,12 @@ namespace ICSharpCode.FiletypeRegisterer } return true; } + + void fileTypesListBox_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e) + { + if (fileTypesListBox.IndexFromPoint(e.X, e.Y) == ListBox.NoMatches) { + fileTypesListBox.SelectedIndex = -1; + } + } } } diff --git a/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/InstallPackageCmdlet.cs b/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/InstallPackageCmdlet.cs index ac57cae245..93dab21b5e 100644 --- a/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/InstallPackageCmdlet.cs +++ b/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/InstallPackageCmdlet.cs @@ -66,7 +66,9 @@ namespace ICSharpCode.PackageManagement.Cmdlets { ThrowErrorIfProjectNotOpen(); using (IConsoleHostFileConflictResolver resolver = CreateFileConflictResolver()) { - InstallPackage(); + using (IDisposable logger = ConsoleHost.CreateLogger(this)) { + InstallPackage(); + } } } diff --git a/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/PackageManagementCmdlet.cs b/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/PackageManagementCmdlet.cs index 8681445d15..32eba1779e 100644 --- a/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/PackageManagementCmdlet.cs +++ b/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/PackageManagementCmdlet.cs @@ -25,7 +25,7 @@ using NuGet; namespace ICSharpCode.PackageManagement.Cmdlets { - public abstract class PackageManagementCmdlet : PSCmdlet, ITerminatingCmdlet, IPackageScriptSession, IPackageScriptRunner + public abstract class PackageManagementCmdlet : PSCmdlet, ITerminatingCmdlet, IPackageScriptSession, IPackageScriptRunner, ICmdletLogger { IPackageManagementConsoleHost consoleHost; ICmdletTerminatingError terminatingError; @@ -114,5 +114,10 @@ namespace ICSharpCode.PackageManagement.Cmdlets script.Run(this); } } + + void ICmdletLogger.WriteLine(string message) + { + Host.UI.WriteLine(message); + } } } diff --git a/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/UninstallPackageCmdlet.cs b/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/UninstallPackageCmdlet.cs index 513cfc8be7..1584992b0e 100644 --- a/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/UninstallPackageCmdlet.cs +++ b/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/UninstallPackageCmdlet.cs @@ -59,7 +59,9 @@ namespace ICSharpCode.PackageManagement.Cmdlets protected override void ProcessRecord() { ThrowErrorIfProjectNotOpen(); - UninstallPackage(); + using (IDisposable logger = ConsoleHost.CreateLogger(this)) { + UninstallPackage(); + } } void UninstallPackage() diff --git a/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/UpdatePackageCmdlet.cs b/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/UpdatePackageCmdlet.cs index 91aeb5abc6..4c920e79ef 100644 --- a/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/UpdatePackageCmdlet.cs +++ b/src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/UpdatePackageCmdlet.cs @@ -73,7 +73,9 @@ namespace ICSharpCode.PackageManagement.Cmdlets { ThrowErrorIfProjectNotOpen(); using (IConsoleHostFileConflictResolver resolver = CreateFileConflictResolver()) { - RunUpdate(); + using (IDisposable logger = ConsoleHost.CreateLogger(this)) { + RunUpdate(); + } } } diff --git a/src/AddIns/Misc/PackageManagement/Cmdlets/Test/Src/InstallPackageCmdletTests.cs b/src/AddIns/Misc/PackageManagement/Cmdlets/Test/Src/InstallPackageCmdletTests.cs index dfacfdab29..8dbbe66d67 100644 --- a/src/AddIns/Misc/PackageManagement/Cmdlets/Test/Src/InstallPackageCmdletTests.cs +++ b/src/AddIns/Misc/PackageManagement/Cmdlets/Test/Src/InstallPackageCmdletTests.cs @@ -321,5 +321,19 @@ namespace PackageManagement.Cmdlets.Tests operationAwareRepository.AssertOperationWasStartedAndDisposed(RepositoryOperationNames.Install, "Test"); } + + [Test] + public void ProcessRecord_PackageIdSpecified_ConsoleHostLoggerIsDisposed() + { + CreateCmdletWithoutActiveProject(); + AddDefaultProjectToConsoleHost(); + AddPackageSourceToConsoleHost(); + SetIdParameter("Test"); + + RunCmdlet(); + + fakeConsoleHost.AssertLoggerIsDisposed(); + Assert.AreEqual(cmdlet, fakeConsoleHost.CmdletLoggerUsedToCreateLogger); + } } } diff --git a/src/AddIns/Misc/PackageManagement/Cmdlets/Test/Src/UninstallPackageCmdletTests.cs b/src/AddIns/Misc/PackageManagement/Cmdlets/Test/Src/UninstallPackageCmdletTests.cs index 840d132397..2ff8092318 100644 --- a/src/AddIns/Misc/PackageManagement/Cmdlets/Test/Src/UninstallPackageCmdletTests.cs +++ b/src/AddIns/Misc/PackageManagement/Cmdlets/Test/Src/UninstallPackageCmdletTests.cs @@ -237,8 +237,22 @@ namespace PackageManagement.Cmdlets.Tests RunCmdlet(); IPackageScriptRunner scriptRunner = uninstallPackageAction.PackageScriptRunner; - + Assert.AreEqual(cmdlet, scriptRunner); } + + [Test] + public void ProcessRecord_PackageIdSpecified_ConsoleHostLoggerIsDisposed() + { + CreateCmdletWithoutActiveProject(); + AddDefaultProjectToConsoleHost(); + AddPackageSourceToConsoleHost(); + SetIdParameter("Test"); + + RunCmdlet(); + + fakeConsoleHost.AssertLoggerIsDisposed(); + Assert.AreEqual(cmdlet, fakeConsoleHost.CmdletLoggerUsedToCreateLogger); + } } } diff --git a/src/AddIns/Misc/PackageManagement/Cmdlets/Test/Src/UpdatePackageCmdletTests.cs b/src/AddIns/Misc/PackageManagement/Cmdlets/Test/Src/UpdatePackageCmdletTests.cs index 59cdc7d7fc..e683100c35 100644 --- a/src/AddIns/Misc/PackageManagement/Cmdlets/Test/Src/UpdatePackageCmdletTests.cs +++ b/src/AddIns/Misc/PackageManagement/Cmdlets/Test/Src/UpdatePackageCmdletTests.cs @@ -832,5 +832,19 @@ namespace PackageManagement.Cmdlets.Tests operationAwareRepository.AssertOperationWasStartedAndDisposed(RepositoryOperationNames.Update, "Test2"); } + + [Test] + public void ProcessRecord_PackageIdSpecified_ConsoleHostLoggerIsDisposed() + { + CreateCmdletWithoutActiveProject(); + AddDefaultProjectToConsoleHost(); + AddPackageSourceToConsoleHost(); + SetIdParameter("Test"); + + RunCmdlet(); + + fakeConsoleHost.AssertLoggerIsDisposed(); + Assert.AreEqual(cmdlet, fakeConsoleHost.CmdletLoggerUsedToCreateLogger); + } } } diff --git a/src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj b/src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj index cdb4f112ec..7875954521 100644 --- a/src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj +++ b/src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj @@ -58,6 +58,7 @@ 3.5 + 4.0 @@ -243,6 +244,7 @@ + @@ -250,6 +252,7 @@ + diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs b/src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs index bc37ce523f..0c1980b65c 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs @@ -18,6 +18,8 @@ using System; using System.Collections.Generic; +using System.Linq; + using NuGet; namespace ICSharpCode.PackageManagement.Design @@ -36,6 +38,8 @@ namespace ICSharpCode.PackageManagement.Design public Dictionary>> Sections = new Dictionary>>(); + public const string ConfigSectionName = "config"; + public FakeSettings() { Sections.Add(RegisteredPackageSourceSettings.PackageSourcesSectionName, PackageSources); @@ -200,7 +204,11 @@ namespace ICSharpCode.PackageManagement.Design public string GetValue(string section, string key, bool isPath) { - throw new NotImplementedException(); + if (Sections.ContainsKey(section)) { + var matchedSection = Sections[section]; + return matchedSection.FirstOrDefault(item => item.Key == key).Value; + } + return null; } public IList> GetValues(string section, bool isPath) @@ -212,5 +220,12 @@ namespace ICSharpCode.PackageManagement.Design { throw new NotImplementedException(); } + + public void SetRepositoryPathSetting(string fullPath) + { + var items = new List> (); + items.Add (new KeyValuePair("repositoryPath", fullPath)); + Sections.Add(ConfigSectionName, items); + } } } diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementOptions.cs b/src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementOptions.cs index 655d9be0d1..4ae99a301d 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementOptions.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementOptions.cs @@ -95,5 +95,10 @@ namespace ICSharpCode.PackageManagement { properties.SetList(RecentPackagesPropertyName, recentPackages); } + + public string GetCustomPackagesDirectory() + { + return registeredPackageSourceSettings.Settings.GetRepositoryPath(); + } } } diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/RegisteredPackageSourceSettings.cs b/src/AddIns/Misc/PackageManagement/Project/Src/RegisteredPackageSourceSettings.cs index 2a6aae2c30..829c1bef8d 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/RegisteredPackageSourceSettings.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/RegisteredPackageSourceSettings.cs @@ -204,5 +204,9 @@ namespace ICSharpCode.PackageManagement packageSources = null; } } + + public ISettings Settings { + get { return settings; } + } } } diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/RestorePackagesCommand.cs b/src/AddIns/Misc/PackageManagement/Project/Src/RestorePackagesCommand.cs index 76a175950d..5020d26206 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/RestorePackagesCommand.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/RestorePackagesCommand.cs @@ -18,6 +18,9 @@ using System; using System.IO; +using System.Linq; +using System.Threading.Tasks; + using ICSharpCode.Core; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Gui; @@ -71,7 +74,33 @@ namespace ICSharpCode.PackageManagement var runner = new ProcessRunner(); runner.WorkingDirectory = Path.GetDirectoryName(solution.FileName); - runner.RunInOutputPadAsync(outputMessagesView.OutputCategory, commandLine.Command, commandLine.Arguments).FireAndForget(); + runner.RunInOutputPadAsync(outputMessagesView.OutputCategory, commandLine.Command, commandLine.Arguments) + .ContinueWith(task => OnNuGetPackageRestoreComplete(task)); + } + + void OnNuGetPackageRestoreComplete(Task task) + { + if (task.Exception != null) { + LoggingService.Debug(task.Exception.ToString()); + outputMessagesView.AppendLine(task.Exception.Message); + } else { + ForceGenerationOfRepositoriesConfigFile(); + } + } + + /// + /// Create a Package Manager for each project to force a new repositories.config file + /// to be generated with references to all projects that have NuGet packages. + /// + void ForceGenerationOfRepositoriesConfigFile() + { + try { + var repository = PackageManagementServices.RegisteredPackageRepositories.CreateAggregateRepository(); + var projects = solution.GetProjects(repository).ToList(); + } catch (Exception ex) { + LoggingService.Debug(ex.ToString()); + outputMessagesView.AppendLine(ex.Message); + } } } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/IndexList.cs b/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/ICmdletLogger.cs similarity index 80% rename from src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/IndexList.cs rename to src/AddIns/Misc/PackageManagement/Project/Src/Scripting/ICmdletLogger.cs index 6903e29e97..f557d7c7be 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/IndexList.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/ICmdletLogger.cs @@ -17,17 +17,15 @@ // DEALINGS IN THE SOFTWARE. using System; -using System.Collections.Generic; -using ICSharpCode.Reporting.DataSource.Comparer; +using System.Management.Automation; -namespace ICSharpCode.Reporting.DataManager.Listhandling +namespace ICSharpCode.PackageManagement.Scripting { - /// - /// Description of IndexList. - /// - public class IndexList :List + public interface ICmdletLogger { - - public int CurrentPosition {get;set;} + void WriteError(ErrorRecord error); + void WriteLine(string message); + void WriteVerbose(string message); + void WriteWarning(string message); } } diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/IPackageManagementConsoleHost.cs b/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/IPackageManagementConsoleHost.cs index 0695932eeb..d4d4c3f7ca 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/IPackageManagementConsoleHost.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/IPackageManagementConsoleHost.cs @@ -42,6 +42,7 @@ namespace ICSharpCode.PackageManagement.Scripting void SetDefaultRunspace(); IConsoleHostFileConflictResolver CreateFileConflictResolver(FileConflictAction fileConflictAction); + IDisposable CreateLogger(ICmdletLogger logger); IPackageManagementProject GetProject(string packageSource, string projectName); IPackageManagementProject GetProject(IPackageRepository sourceRepository, string projectName); diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageManagementConsoleHost.cs b/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageManagementConsoleHost.cs index 6fec26b929..5742c26bf7 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageManagementConsoleHost.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageManagementConsoleHost.cs @@ -295,5 +295,10 @@ namespace ICSharpCode.PackageManagement.Scripting { return new ConsoleHostFileConflictResolver(packageEvents, fileConflictAction); } + + public IDisposable CreateLogger(ICmdletLogger logger) + { + return new PackageManagementConsoleHostLogger(logger, packageEvents); + } } } diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageManagementConsoleHostLogger.cs b/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageManagementConsoleHostLogger.cs new file mode 100644 index 0000000000..dc07b3357b --- /dev/null +++ b/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageManagementConsoleHostLogger.cs @@ -0,0 +1,75 @@ +// Copyright (c) 2014 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.Management.Automation; +using NuGet; + +namespace ICSharpCode.PackageManagement.Scripting +{ + public class PackageManagementConsoleHostLogger : IDisposable + { + ICmdletLogger logger; + IPackageManagementEvents packageEvents; + + public PackageManagementConsoleHostLogger(ICmdletLogger logger, IPackageManagementEvents packageEvents) + { + this.logger = logger; + this.packageEvents = packageEvents; + + packageEvents.PackageOperationMessageLogged += PackageOperationMessageLogged; + } + + void PackageOperationMessageLogged(object sender, PackageOperationMessageLoggedEventArgs e) + { + Log(e.Message.Level, e.Message.ToString()); + } + + void Log(MessageLevel level, string message) + { + switch (level) { + case MessageLevel.Debug: + logger.WriteVerbose(message); + break; + case MessageLevel.Warning: + logger.WriteWarning(message); + break; + case MessageLevel.Error: + logger.WriteError(CreateErrorRecord(message)); + break; + default: + logger.WriteLine(message); + break; + } + } + + ErrorRecord CreateErrorRecord(string message) + { + return new ErrorRecord( + new ApplicationException(message), + "PackageManagementError", + ErrorCategory.NotSpecified, + null); + } + + public void Dispose() + { + packageEvents.PackageOperationMessageLogged -= PackageOperationMessageLogged; + } + } +} diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PowerShellMissingConsoleHost.cs b/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PowerShellMissingConsoleHost.cs index 45beafca8d..050dca3086 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PowerShellMissingConsoleHost.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PowerShellMissingConsoleHost.cs @@ -100,5 +100,10 @@ namespace ICSharpCode.PackageManagement.Scripting { return null; } + + public IDisposable CreateLogger(ICmdletLogger logger) + { + return null; + } } } diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopPackageManagerFactory.cs b/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopPackageManagerFactory.cs index dc79c7c396..92d31f3a12 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopPackageManagerFactory.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopPackageManagerFactory.cs @@ -32,7 +32,7 @@ namespace ICSharpCode.PackageManagement : this( new SharpDevelopPackageRepositoryFactory(), new SharpDevelopProjectSystemFactory(), - new PackageManagementOptions()) + PackageManagementServices.Options) { } diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/SolutionPackageRepositoryPath.cs b/src/AddIns/Misc/PackageManagement/Project/Src/SolutionPackageRepositoryPath.cs index 9be3cb7e0b..b188e91669 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/SolutionPackageRepositoryPath.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/SolutionPackageRepositoryPath.cs @@ -25,12 +25,11 @@ namespace ICSharpCode.PackageManagement { public class SolutionPackageRepositoryPath { - string packagesRelativeDirectory; ISolution solution; DefaultPackagePathResolver pathResolver; public SolutionPackageRepositoryPath(IProject project) - : this(project, new PackageManagementOptions()) + : this(project, PackageManagementServices.Options) { } @@ -41,14 +40,18 @@ namespace ICSharpCode.PackageManagement public SolutionPackageRepositoryPath(ISolution solution, PackageManagementOptions options) { - packagesRelativeDirectory = options.PackagesDirectory; this.solution = solution; - GetSolutionPackageRepositoryPath(); + PackageRepositoryPath = GetSolutionPackageRepositoryPath(options); } - void GetSolutionPackageRepositoryPath() + string GetSolutionPackageRepositoryPath(PackageManagementOptions options) { - PackageRepositoryPath = Path.Combine(solution.Directory, packagesRelativeDirectory); + string customPath = options.GetCustomPackagesDirectory (); + if (!String.IsNullOrEmpty (customPath)) { + return customPath; + } + + return Path.Combine (solution.Directory, options.PackagesDirectory); } public string PackageRepositoryPath { get; private set; } diff --git a/src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj b/src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj index fb3cc11e72..0a2c80e407 100644 --- a/src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj +++ b/src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj @@ -108,6 +108,7 @@ + @@ -194,6 +195,7 @@ + diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/GroupComparer.cs b/src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakeCmdletLogger.cs similarity index 64% rename from src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/GroupComparer.cs rename to src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakeCmdletLogger.cs index fa54526ae8..bf87c211c9 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/GroupComparer.cs +++ b/src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakeCmdletLogger.cs @@ -17,23 +17,39 @@ // DEALINGS IN THE SOFTWARE. using System; -using System.Collections.ObjectModel; -using ICSharpCode.Reporting.BaseClasses; -using ICSharpCode.Reporting.DataManager.Listhandling; +using System.Management.Automation; +using ICSharpCode.PackageManagement.Scripting; -namespace ICSharpCode.Reporting.DataSource.Comparer +namespace PackageManagement.Tests.Helpers { - /// - /// Description of GroupComparer. - /// - public class GroupComparer :SortComparer + public class FakeCmdletLogger : ICmdletLogger { + public ErrorRecord ErrorRecordLogged; - public GroupComparer (Collection owner, int listIndex, object[] values):base(owner,listIndex,values) + public void WriteError(ErrorRecord error) { - IndexList = new IndexList(); + ErrorRecordLogged = error; } - public IndexList IndexList {get;private set;} + public string LineLogged; + + public void WriteLine(string message) + { + LineLogged = message; + } + + public string VerboseMessageLogged; + + public void WriteVerbose(string message) + { + VerboseMessageLogged = message; + } + + public string WarningMessageLogged; + + public void WriteWarning(string message) + { + WarningMessageLogged = message; + } } } diff --git a/src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageManagementConsoleHost.cs b/src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageManagementConsoleHost.cs index caad95b80b..db0f583351 100644 --- a/src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageManagementConsoleHost.cs +++ b/src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageManagementConsoleHost.cs @@ -169,5 +169,21 @@ namespace PackageManagement.Tests.Helpers { FakeFileConflictResolver.AssertWasCalled(resolver => resolver.Dispose()); } + + public IDisposable FakeConsoleHostLogger = + MockRepository.GenerateStub(); + + public void AssertLoggerIsDisposed() + { + FakeConsoleHostLogger.AssertWasCalled(logger => logger.Dispose()); + } + + public ICmdletLogger CmdletLoggerUsedToCreateLogger; + + public IDisposable CreateLogger(ICmdletLogger logger) + { + CmdletLoggerUsedToCreateLogger = logger; + return FakeConsoleHostLogger; + } } } diff --git a/src/AddIns/Misc/PackageManagement/Test/Src/Scripting/PackageManagementConsoleHostLoggerTests.cs b/src/AddIns/Misc/PackageManagement/Test/Src/Scripting/PackageManagementConsoleHostLoggerTests.cs new file mode 100644 index 0000000000..d1e6ad884f --- /dev/null +++ b/src/AddIns/Misc/PackageManagement/Test/Src/Scripting/PackageManagementConsoleHostLoggerTests.cs @@ -0,0 +1,85 @@ +// Copyright (c) 2014 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.Management.Automation; +using ICSharpCode.PackageManagement; +using ICSharpCode.PackageManagement.Scripting; +using NuGet; +using NUnit.Framework; +using PackageManagement.Tests.Helpers; + +namespace PackageManagement.Tests.Scripting +{ + [TestFixture] + public class PackageManagementConsoleHostLoggerTests + { + FakeCmdletLogger cmdletLogger; + PackageManagementConsoleHostLogger consoleHostLogger; + PackageManagementEvents packageEvents; + + void CreateConsoleHostLogger() + { + cmdletLogger = new FakeCmdletLogger(); + packageEvents = new PackageManagementEvents(); + consoleHostLogger = new PackageManagementConsoleHostLogger(cmdletLogger, packageEvents); + } + + [Test] + public void OnPackageOperationMessageLogged_DebugMessage_WrittenAsVerboseMessageToCmdlet() + { + CreateConsoleHostLogger(); + + packageEvents.OnPackageOperationMessageLogged(MessageLevel.Debug, "test"); + + Assert.AreEqual("test", cmdletLogger.VerboseMessageLogged); + } + + [Test] + public void OnPackageOperationMessageLogged_WarningMessage_WrittenAsWarningMessageToCmdlet() + { + CreateConsoleHostLogger(); + + packageEvents.OnPackageOperationMessageLogged(MessageLevel.Warning, "test"); + + Assert.AreEqual("test", cmdletLogger.WarningMessageLogged); + } + + [Test] + public void OnPackageOperationMessageLogged_InfoMessage_WrittenAsLineToCmdlet() + { + CreateConsoleHostLogger(); + + packageEvents.OnPackageOperationMessageLogged(MessageLevel.Info, "test"); + + Assert.AreEqual("test", cmdletLogger.LineLogged); + } + + [Test] + public void OnPackageOperationMessageLogged_ErrorMessage_WrittenAsErrorRecordCmdlet() + { + CreateConsoleHostLogger(); + + packageEvents.OnPackageOperationMessageLogged(MessageLevel.Error, "test"); + + Assert.IsNotNull(cmdletLogger.ErrorRecordLogged); + Assert.AreEqual("test", cmdletLogger.ErrorRecordLogged.Exception.Message); + Assert.AreEqual(ErrorCategory.NotSpecified, cmdletLogger.ErrorRecordLogged.CategoryInfo.Category); + } + } +} diff --git a/src/AddIns/Misc/PackageManagement/Test/Src/SolutionPackageRepositoryPathTests.cs b/src/AddIns/Misc/PackageManagement/Test/Src/SolutionPackageRepositoryPathTests.cs index 6623b8e461..5e55e9cef6 100644 --- a/src/AddIns/Misc/PackageManagement/Test/Src/SolutionPackageRepositoryPathTests.cs +++ b/src/AddIns/Misc/PackageManagement/Test/Src/SolutionPackageRepositoryPathTests.cs @@ -32,8 +32,9 @@ namespace PackageManagement.Tests { SolutionPackageRepositoryPath repositoryPath; IProject testProject; - PackageManagementOptions options; + TestablePackageManagementOptions options; ISolution solution; + FakeSettings settings; void CreateSolutionPackageRepositoryPath() { @@ -61,6 +62,12 @@ namespace PackageManagement.Tests void CreateOptions() { options = new TestablePackageManagementOptions(); + settings = options.FakeSettings; + } + + void SolutionNuGetConfigFileHasCustomPackagesPath(string fullPath) + { + settings.SetRepositoryPathSetting(fullPath); } [Test] @@ -109,5 +116,20 @@ namespace PackageManagement.Tests Assert.AreEqual(expectedInstallPath, installPath); } + + [Test] + public void PackageRepositoryPath_SolutionHasNuGetFileThatOverridesDefaultPackagesRepositoryPath_OverriddenPathReturned() + { + CreateOptions(); + CreateSolution(@"d:\projects\MySolution\MySolution.sln"); + options.PackagesDirectory = "Packages"; + SolutionNuGetConfigFileHasCustomPackagesPath(@"d:\Team\MyPackages"); + CreateSolutionPackageRepositoryPath(solution); + string expectedPath = @"d:\Team\MyPackages"; + + string path = repositoryPath.PackageRepositoryPath; + + Assert.AreEqual(expectedPath, path); + } } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseLineItem.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseLineItem.cs index db2dd66f2d..4203d0e578 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseLineItem.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseLineItem.cs @@ -22,9 +22,8 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems Point toPoint; LineCap startLineCap; LineCap endLineCap; - DashCap dashLineCap; + - public BaseLineItem() { this.Size = new Size(50,10); @@ -42,8 +41,6 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems } - -// [System.ComponentModel.EditorBrowsableAttribute()] protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { e.Graphics.SmoothingMode = SmoothingMode.HighQuality; @@ -113,16 +110,5 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems Invalidate(); } } - - -// [Category("Appearance")] -// public DashCap DashLineCap { -// get { return dashLineCap; } -// set { -// dashLineCap = value; -// Invalidate(); -// } -// } - } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseRectangleItem.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseRectangleItem.cs index b7be7d2627..c7581fa93b 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseRectangleItem.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseRectangleItem.cs @@ -146,17 +146,17 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems public static GraphicsPath Create(Rectangle rect, int radius, RectangleCorners c) { return Create(rect.X, rect.Y, rect.Width, rect.Height, radius, c); } +// +// public static GraphicsPath Create(int x, int y, int width, int height, int radius) +// { return Create(x, y, width, height, radius, RectangleCorners.All); } - public static GraphicsPath Create(int x, int y, int width, int height, int radius) - { return Create(x, y, width, height, radius, RectangleCorners.All); } +// public static GraphicsPath Create(Rectangle rect, int radius) +// { return Create(rect.X, rect.Y, rect.Width, rect.Height, radius); } +// +// public static GraphicsPath Create(int x, int y, int width, int height) +// { return Create(x, y, width, height, 5); } - public static GraphicsPath Create(Rectangle rect, int radius) - { return Create(rect.X, rect.Y, rect.Width, rect.Height, radius); } - - public static GraphicsPath Create(int x, int y, int width, int height) - { return Create(x, y, width, height, 5); } - - public static GraphicsPath Create(Rectangle rect) - { return Create(rect.X, rect.Y, rect.Width, rect.Height); } +// public static GraphicsPath Create(Rectangle rect) +// { return Create(rect.X, rect.Y, rect.Width, rect.Height); } } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseTextItem.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseTextItem.cs index a68d6e640a..e77e78f57c 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseTextItem.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseTextItem.cs @@ -10,6 +10,7 @@ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; +using System.Windows; using ICSharpCode.Reporting.BaseClasses; using ICSharpCode.Reporting.Globals; using ICSharpCode.Reporting.Addin.Designer; @@ -31,18 +32,18 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems StringFormat stringFormat; StringTrimming stringTrimming; ContentAlignment contentAlignment; - + TextAlignment textAlignment; public BaseTextItem(){ DefaultSize = GlobalValues.PreferedSize; Size = GlobalValues.PreferedSize; BackColor = Color.White; contentAlignment = ContentAlignment.TopLeft; + textAlignment = TextAlignment.Left; TypeDescriptor.AddProvider(new TextItemTypeProvider(), typeof(BaseTextItem)); } -// [EditorBrowsableAttribute()] protected override void OnPaint(System.Windows.Forms.PaintEventArgs e){ base.OnPaint(e); Draw(e.Graphics); @@ -64,7 +65,8 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems designTrimmimg = stringTrimming; } - stringFormat = TextDrawer.BuildStringFormat(designTrimmimg, contentAlignment); +// stringFormat = TextDrawer.BuildStringFormat(designTrimmimg, contentAlignment); + stringFormat = TextDrawer.BuildStringFormat(designTrimmimg, textAlignment); using (var textBrush = new SolidBrush(ForeColor)) { TextDrawer.DrawString(graphics, Text, Font, textBrush, ClientRectangle, stringFormat); } @@ -119,10 +121,9 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems } - [Category("Appearance")] [EditorAttribute(typeof(ContentAlignmentEditor), - typeof(UITypeEditor) )] + typeof(UITypeEditor) )] public ContentAlignment ContentAlignment { get { return contentAlignment; } set { @@ -132,18 +133,15 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems } + [Category("Appearance")] + public TextAlignment TextAlignment { + get { return textAlignment;} + set {textAlignment = value; + Invalidate();} + } + #endregion -// #region RighToLeft -// -// [Category("Appearance")] -// public System.Windows.Forms.RightToLeft RTL -// { -// get { return base.RightToLeft; } -// set { base.RightToLeft = value; } -// } -// -// #endregion #region DataType @@ -158,10 +156,10 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems #region Expression [Browsable(true), - Category("Expression"), - Description("Enter a valid Expression")] + Category("Expression"), + Description("Enter a valid Expression")] [EditorAttribute(typeof(ExpressionEditor), - typeof(UITypeEditor) )] + typeof(UITypeEditor) )] public string Expression {get;set;} #endregion diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs index ceaf1ce82e..caa01485ba 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs @@ -47,9 +47,7 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding { if (file.IsDirty) { var reportModel = ReportModelFactory.Create(); - - var reportFactory = new CreateFormSheetFromModel(); - var xml = reportFactory.ToXml(reportModel); + var xml = CreateFormSheetFromModel.ToXml(reportModel); var doc = new XmlDocument(); doc.LoadXml(xml.ToString()); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/InternalReportLoader.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/InternalReportLoader.cs index ec947b3737..88471d1ca0 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/InternalReportLoader.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/InternalReportLoader.cs @@ -19,6 +19,7 @@ using System; using System.ComponentModel; using System.ComponentModel.Design.Serialization; +using System.Globalization; using System.IO; using System.Windows.Forms; @@ -72,9 +73,9 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding { string message; if (generator.ViewContent.PrimaryFile.IsDirty) { - message = String.Format("Create Report <{0}> ...",Path.GetFileName(this.generator.ViewContent.PrimaryFile.FileName)); + message = String.Format(CultureInfo.CurrentCulture,"Create Report <{0}> ...",Path.GetFileName(generator.ViewContent.PrimaryFile.FileName)); } else { - message = String.Format("Load Report <{0}> ...",Path.GetFileName(this.generator.ViewContent.PrimaryFile.FileName)); + message = String.Format(CultureInfo.CurrentCulture,"Load Report <{0}> ...",Path.GetFileName(generator.ViewContent.PrimaryFile.FileName)); } SD.StatusBar.SetMessage(message); } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Factory/CreateFormSheetFromModel.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Factory/CreateFormSheetFromModel.cs index 7756fe69e4..9c666f09b4 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Factory/CreateFormSheetFromModel.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Factory/CreateFormSheetFromModel.cs @@ -19,11 +19,10 @@ namespace ICSharpCode.Reporting.Addin.Factory /// /// Description of CreateFormSheetReport. /// - class CreateFormSheetFromModel + static class CreateFormSheetFromModel { - - public StringWriter ToXml(IReportModel reportModel) { + public static StringWriter ToXml(IReportModel reportModel) { int locY = reportModel.ReportSettings.TopMargin; foreach (var section in reportModel.SectionCollection) @@ -39,7 +38,7 @@ namespace ICSharpCode.Reporting.Addin.Factory return xml; } - StringWriter ToXmlInternal(IReportModel model) + static StringWriter ToXmlInternal(IReportModel model) { var writer = new StringWriterWithEncoding(System.Text.Encoding.UTF8); var xml = XmlHelper.CreatePropperWriter(writer); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Services/HelpService.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Services/HelpService.cs index 35347f533b..089ca9c53d 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Services/HelpService.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Services/HelpService.cs @@ -60,14 +60,14 @@ namespace ICSharpCode.Reporting.Addin.Services { HelpProvider.ShowHelpByKeyword(helpKeyword); } - public void ShowGeneralHelp() - { - ShowHelpFromKeyword(generalKeyword); - } - public void ShowHelp() - { -// HelpProvider.ShowHelp(f1Keyword); - } +// public void ShowGeneralHelp() +// { +// ShowHelpFromKeyword(generalKeyword); +// } +// static public void ShowHelp() +// { +//// HelpProvider.ShowHelp(f1Keyword); +// } public void ShowHelpFromUrl(string helpUrl) { diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Services/ToolboxService.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Services/ToolboxService.cs index ed2cf5dc54..f8313da331 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Services/ToolboxService.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Services/ToolboxService.cs @@ -188,7 +188,7 @@ namespace ICSharpCode.Reporting.Addin.Services // needed for Toolbox drag & drop if (serializedObject is System.Windows.Forms.IDataObject) { if (((System.Windows.Forms.IDataObject)serializedObject).GetDataPresent(typeof(ToolboxItem))) { - ToolboxItem item = (ToolboxItem) ((System.Windows.Forms.IDataObject)serializedObject).GetData(typeof(ToolboxItem)); + var item = (ToolboxItem) ((System.Windows.Forms.IDataObject)serializedObject).GetData(typeof(ToolboxItem)); // if (host != null) { // ArrayList list = (ArrayList)toolboxByHost[host]; // if (list != null && list.Contains(item)) { diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/AbstractItemTypeProvider.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/AbstractItemTypeProvider.cs index 28665d5d2c..1a3175bfd2 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/AbstractItemTypeProvider.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/AbstractItemTypeProvider.cs @@ -22,9 +22,9 @@ namespace ICSharpCode.Reporting.Addin.TypeProvider { } - public AbstractItemTypeProvider(TypeDescriptionProvider parent): base(parent) - { - } +// public AbstractItemTypeProvider(TypeDescriptionProvider parent): base(parent) +// { +// } public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/TypeProviderHelper.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/TypeProviderHelper.cs index e8195390bb..9fa4b908d5 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/TypeProviderHelper.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/TypeProviderHelper.cs @@ -99,6 +99,9 @@ namespace ICSharpCode.Reporting.Addin.TypeProvider prop = props.Find("ContentAlignment",true); allProperties.Add(prop); + prop = props.Find("TextAlignment",true); + allProperties.Add(prop); + prop = props.Find("CanGrow",true); allProperties.Add(prop); @@ -107,9 +110,6 @@ namespace ICSharpCode.Reporting.Addin.TypeProvider prop = props.Find("DataType",true); allProperties.Add(prop); - -// prop = props.Find("RTL",true); -// allProperties.Add(prop); } public static void AddGraphicProperties (List allProperties, diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/XML/ReportDefinitionParser.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/XML/ReportDefinitionParser.cs index 1a4fdb4787..209e6f5951 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/XML/ReportDefinitionParser.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/XML/ReportDefinitionParser.cs @@ -22,6 +22,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Reflection; using System.Xml; +using System.Xml.XPath; using ICSharpCode.Reporting.Xml; @@ -102,8 +103,7 @@ namespace ICSharpCode.Reporting.Addin.XML Type t=parent.GetType(); // children of a class must always be properties - foreach(XmlNode child in node.ChildNodes) - { + foreach(XmlNode child in node.ChildNodes){ if (child is XmlElement) { string pname=child.LocalName; @@ -220,7 +220,7 @@ namespace ICSharpCode.Reporting.Addin.XML } } - void SetPropertyToString(object obj, PropertyInfo pi, string value) + static void SetPropertyToString(object obj, PropertyInfo pi, string value) { // it's string, so use a type converter. TypeConverter tc=TypeDescriptor.GetConverter(pi.PropertyType); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj index 1c743c111d..707962a862 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj @@ -91,13 +91,8 @@ + - - - - - - @@ -196,7 +191,6 @@ - diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/ArrangeStrategy.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/ArrangeStrategy.cs index fa56c5c805..c954a572cf 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/ArrangeStrategy.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/ArrangeStrategy.cs @@ -58,7 +58,6 @@ namespace ICSharpCode.Reporting.Arrange { var containerRectangle = container.DisplayRectangle; Rectangle elementRectangle = Rectangle.Empty; - foreach (var element in container.ExportedItems) { var con = element as IExportContainer; if (con != null) { @@ -76,9 +75,7 @@ namespace ICSharpCode.Reporting.Arrange containerRectangle = new Rectangle(containerRectangle.Left, containerRectangle.Top , containerRectangle.Width, - element.Location.Y + elementRectangle.Size.Height + 5); - -// containerRectangle = Rectangle.Union(containerRectangle,elementRectangle); + element.Location.Y + elementRectangle.Size.Height + 5); } } return containerRectangle.Size; diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/TextDrawer.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/TextDrawer.cs index 4a43d14f4b..ccd2668d51 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/TextDrawer.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/TextDrawer.cs @@ -9,20 +9,15 @@ using System; using System.Drawing; using System.Drawing.Text; +using System.Windows; namespace ICSharpCode.Reporting.BaseClasses { /// /// Description of TextDrawer. /// - public sealed class TextDrawer + public static class TextDrawer { - - private TextDrawer() - { - } - - public static void DrawString(Graphics graphics,string text, Font font,Brush brush, RectangleF rectangle, @@ -38,41 +33,40 @@ namespace ICSharpCode.Reporting.BaseClasses rectangle, format); } + - - public static void DrawString (Graphics graphics,string text) - - { - if (graphics == null) { - throw new ArgumentNullException("graphics"); + public static StringFormat BuildStringFormat(StringTrimming stringTrimming,TextAlignment alignment){ + StringFormat format = StringFormat.GenericTypographic; + format.Trimming = stringTrimming; + format.FormatFlags = StringFormatFlags.LineLimit; + switch (alignment) { + case TextAlignment.Left:{ + format.Alignment = StringAlignment.Near; + format.LineAlignment = StringAlignment.Near; + return format; + } + case TextAlignment.Center:{ + format.Alignment = StringAlignment.Center; + format.LineAlignment = StringAlignment.Near; + return format; + } + + case TextAlignment.Right:{ + format.Alignment = StringAlignment.Far; + format.LineAlignment = StringAlignment.Near; + return format; + } + + case TextAlignment.Justify:{ + format.Alignment = StringAlignment.Center; + format.LineAlignment = StringAlignment.Near; + return format; + } } -// if (decorator == null) { -// throw new ArgumentNullException("decorator"); -// } - -// StringFormat stringFormat = BuildStringFormat(decorator.StringTrimming,decorator.ContentAlignment); -// -// if (decorator.RightToLeft ==System.Windows.Forms.RightToLeft.Yes) { -// stringFormat.FormatFlags = stringFormat.FormatFlags | StringFormatFlags.DirectionRightToLeft; -// } - - var formattedString = text; -// if (! String.IsNullOrEmpty(decorator.FormatString)) { -// formattedString = StandardFormatter.FormatOutput(text,decorator.FormatString,decorator.DataType,String.Empty); -// } - - graphics.TextRenderingHint = TextRenderingHint.AntiAlias; - -// graphics.DrawString (formattedString,decorator.Font, -// new SolidBrush(decorator.ForeColor), -// new Rectangle(decorator.Location.X, -// decorator.Location.Y, -// decorator.Size.Width, -// decorator.Size.Height), -// stringFormat); + return format; } - + /* public static StringFormat BuildStringFormat(StringTrimming stringTrimming,ContentAlignment alignment) { StringFormat format = StringFormat.GenericTypographic; @@ -139,5 +133,6 @@ namespace ICSharpCode.Reporting.BaseClasses format.LineAlignment = StringAlignment.Far; return format; } + */ } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Collections.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Collections.cs index 5bc4688209..366f85a6fc 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Collections.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Collections.cs @@ -52,9 +52,6 @@ namespace ICSharpCode.Reporting public class GroupColumnCollection: SortColumnCollection { - public GroupColumnCollection() - { - } public new AbstractColumn Find (string columnName) { @@ -67,12 +64,7 @@ namespace ICSharpCode.Reporting } - public class ParameterCollection: Collection{ - - public ParameterCollection() - { - } - + public class ParameterCollection: Collection{ public BasicParameter Find (string parameterName) { @@ -85,7 +77,7 @@ namespace ICSharpCode.Reporting public static CultureInfo Culture { - get { return System.Globalization.CultureInfo.CurrentCulture; } + get { return CultureInfo.CurrentCulture; } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/DataCollection.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/DataCollection.cs similarity index 98% rename from src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/DataCollection.cs rename to src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/DataCollection.cs index 2e1338acc7..b069aeb09d 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/DataCollection.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/DataCollection.cs @@ -24,8 +24,9 @@ using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Reflection; +using ICSharpCode.Reporting.DataSource; -namespace ICSharpCode.Reporting.DataSource +namespace ICSharpCode.Reporting.DataManager { /// /// Description of DataCollection. diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs index eed7ca2ad0..f5008d188d 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs @@ -44,7 +44,6 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling { readonly DataCollection baseList; readonly ReportSettings reportSettings; -// readonly Type elementType; readonly PropertyDescriptorCollection listProperties; @@ -61,24 +60,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling this.listProperties = this.baseList.GetItemProperties(null); OrderGroup = OrderGroup.AsIs; } - - - [Obsolete("use public CollectionDataSource(IEnumerable list, ReportSettings reportSettings")] - public CollectionDataSource(IEnumerable list, Type elementType, ReportSettings reportSettings) - { - if (list == null) - throw new ArgumentNullException("list"); - if (reportSettings == null) - throw new ArgumentNullException("reportSettings"); - - baseList = CreateBaseList(list); - CurrentList = baseList; - this.reportSettings = reportSettings; - this.listProperties = this.baseList.GetItemProperties(null); - OrderGroup = OrderGroup.AsIs; - } - - + public Collection AvailableFields { get { @@ -176,7 +158,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling public void Fill (List collection, object current) { Current = current; - foreach (var element in collection) { + foreach (var element in collection) { var container = element as ReportContainer; if (container != null) { FillFromList(container.Items); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/BaseComparer.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/BaseComparer.cs deleted file mode 100644 index 4547ac2c7b..0000000000 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/BaseComparer.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) 2014 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.ObjectModel; -using ICSharpCode.Reporting.BaseClasses; - -namespace ICSharpCode.Reporting.DataSource.Comparer -{ - /// - /// Description of BaseComparer. - /// - public class BaseComparer : IComparable { - - private int listIndex; - private object[] objectArray; - - /// - /// Default constructor - initializes all fields to default values - /// - - public BaseComparer(Collection columnCollection , int listIndex, object[] values) { - this.ColumnCollection = columnCollection; - this.listIndex = listIndex; - this.objectArray = values; - } - - /// - /// Interface method from IComparable - /// - /// - /// Interface method from IComparable - /// - /// - /// a - public virtual int CompareTo(object obj) { - return 0; - } - - /// - /// Ausgeben der Werte als Pseudo-CSV - /// - public override string ToString() - { - System.Text.StringBuilder builder = new System.Text.StringBuilder(); - builder.AppendFormat("{0};", this.listIndex); - foreach (object value in objectArray) - { - if (value == null || value == DBNull.Value) - { - builder.AppendFormat(""); - } - else if (value.GetType() == typeof(string)) - { - builder.AppendFormat("\"{0}\"", (string)value); - } - else if (value is IFormattable) - { - builder.AppendFormat("{0}", ((IFormattable)value).ToString("g", System.Globalization.CultureInfo.InvariantCulture)); - } - else - { - builder.AppendFormat("[{0}]", value.ToString()); - } - builder.Append(';'); - } - return builder.ToString(); - } - - - public int ListIndex { - get { - return listIndex; - } - } - - public object[] ObjectArray { - get { - return objectArray; - } - } - - - public Collection ColumnCollection {get;private set;} - - } -} diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/SortComparer.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/SortComparer.cs deleted file mode 100644 index 1e17a96e0e..0000000000 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/SortComparer.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) 2014 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.ObjectModel; -using System.ComponentModel; -using System.Globalization; - -using ICSharpCode.Reporting.BaseClasses; -using ICSharpCode.Reporting.Items; - -namespace ICSharpCode.Reporting.DataSource.Comparer -{ - /// - /// Description of SortComparer. - /// - public class SortComparer : BaseComparer { - - public SortComparer(Collection owner, int listIndex, object[] values):base(owner,listIndex,values) - { - } - - - internal int CompareTo(SortComparer value) - { - // we shouldn't get to this point - if (value == null) - throw new ArgumentNullException("value"); - - if (value.ObjectArray.Length != base.ObjectArray.Length) - throw new InvalidOperationException(); - - int compare = 0; - - for (int index = 0; index < base.ObjectArray.Length; index++) - { - object leftValue = base.ObjectArray[index]; - - object rightValue = value.ObjectArray[index]; - - // Indizes sind hier deckungsgleich - - SortColumn sortColumn = (SortColumn)base.ColumnCollection[index]; - - bool descending = (sortColumn.SortDirection == ListSortDirection.Descending); - - // null means equl - if (leftValue == null || leftValue == System.DBNull.Value) - { - if (rightValue != null && rightValue != System.DBNull.Value) - { - return (descending) ? 1 : -1; - } - - // Beide Null - continue; - } - - if (rightValue == null || rightValue == System.DBNull.Value) - { - return (descending) ? -1 : 1; - } - - - if (leftValue.GetType() != rightValue.GetType()){ - string s = String.Format(CultureInfo.CurrentCulture, - "{0} {1} {2}",this.GetType().ToString(), - leftValue.GetType().ToString(), - rightValue.GetType().ToString()); - - throw new ArgumentException(s); - } - if (leftValue.GetType() == typeof(string)) - { - compare = String.Compare((string)leftValue, (string)rightValue, - !sortColumn.CaseSensitive, CultureInfo.CurrentCulture); - } - else - { - compare = ((IComparable)leftValue).CompareTo(rightValue); - } - - // Sind ungleich, tauschen je nach Richtung - if (compare != 0) - { - return (descending) ? -compare : compare; - } - } - - // Gleich Werte, dann Index bercksichtigen - return this.ListIndex.CompareTo(value.ListIndex); - } - public override int CompareTo(object obj) { - base.CompareTo(obj); - return this.CompareTo((SortComparer)obj); - } - - - } -} diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/ExtendedPropertyDescriptor.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/ExtendedPropertyDescriptor.cs index 3a97b541df..2a5c4cd6ae 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/ExtendedPropertyDescriptor.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/ExtendedPropertyDescriptor.cs @@ -20,6 +20,7 @@ using System; using System.Collections; using System.ComponentModel; using System.Reflection; +using ICSharpCode.Reporting.DataManager; namespace ICSharpCode.Reporting.DataSource { @@ -30,7 +31,7 @@ namespace ICSharpCode.Reporting.DataSource { Type componentType; - Type propertyType; + readonly Type propertyType; PropertyInfo prop; public ExtendedPropertyDescriptor (string name, Type componentType, Type propertyType) diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/ExtendedTypeDescriptor.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/ExtendedTypeDescriptor.cs index 0b41f0c2da..0611f8ac7a 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/ExtendedTypeDescriptor.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/ExtendedTypeDescriptor.cs @@ -28,9 +28,9 @@ namespace ICSharpCode.Reporting.DataSource /// class ExtendedTypeDescriptor { - private static Hashtable collections = new Hashtable(); + static Hashtable collections = new Hashtable(); - private static bool IsAllowedProperty(string name) + static bool IsAllowedProperty(string name) { return true; // alle erlaubt } @@ -57,7 +57,7 @@ namespace ICSharpCode.Reporting.DataSource } } - PropertyDescriptor[] descriptors = new PropertyDescriptor[l]; + var descriptors = new PropertyDescriptor[l]; int j = 0; foreach(PropertyInfo pinfo in allProps) @@ -67,7 +67,7 @@ namespace ICSharpCode.Reporting.DataSource descriptors[j++] = new ExtendedPropertyDescriptor(pinfo.Name, memberType, pinfo.PropertyType); } } - PropertyDescriptorCollection result = new PropertyDescriptorCollection(descriptors); + var result = new PropertyDescriptorCollection(descriptors); collections.Add(memberType, result); return result; } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/PropertyMemberAccessore.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/PropertyMemberAccessore.cs index 2a96339eaa..d7536ec5c7 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/PropertyMemberAccessore.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/PropertyMemberAccessore.cs @@ -33,7 +33,7 @@ namespace ICSharpCode.Reporting.DataSource public class PropertyMemberAccessor : IMemberAccessor { - private readonly PropertyInfo _prop; + readonly PropertyInfo _prop; public PropertyMemberAccessor(PropertyInfo prop) { diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/AbstractVisitor.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/AbstractVisitor.cs index c9f0e1c603..ef250c1da7 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/AbstractVisitor.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/AbstractVisitor.cs @@ -85,12 +85,12 @@ namespace ICSharpCode.Reporting.Exporter.Visitors protected Collection Pages {get; private set;} - protected bool IsContainer (IExportColumn column) { + static protected bool IsContainer (IExportColumn column) { return (column is ExportContainer)|| (column is GraphicsContainer); } - protected bool IsGraphicsContainer (IExportColumn column) { + static protected bool IsGraphicsContainer (IExportColumn column) { return column is GraphicsContainer; } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/DebugVisitor.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/DebugVisitor.cs index 6c6bc2620e..6ecd359096 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/DebugVisitor.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/DebugVisitor.cs @@ -48,8 +48,6 @@ namespace ICSharpCode.Reporting.Exporter.Visitors public override void Visit(ExportLine exportGraphics) { -// base.Visit(exportGraphics); - Console.WriteLine("Line from {0} size {1}",exportGraphics.Location,exportGraphics.Size.Width); } } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionRunner.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionRunner.cs index 3f41d86d62..6d1c637aed 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionRunner.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionRunner.cs @@ -34,21 +34,16 @@ namespace ICSharpCode.Reporting.Expressions // http://blog.miraclespain.com/archive/2009/Oct-07.html // readonly Collection pages; - readonly ReportSettings reportSettings; readonly CollectionDataSource dataSource; - public ExpressionRunner(Collection pages,ReportSettings reportSettings,CollectionDataSource dataSource) - { + public ExpressionRunner(Collection pages,ReportSettings reportSettings,CollectionDataSource dataSource){ this.pages = pages; this.dataSource = dataSource; - this.reportSettings = reportSettings; Visitor = new ExpressionVisitor(reportSettings); } - public void Run() - { -// Visitor = new ExpressionVisitor (reportSettings); + public void Run(){ if (dataSource != null) { if (dataSource.SortedList != null) { Visitor.SetCurrentDataSource(dataSource.SortedList); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ExportColumnFactory.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ExportColumnFactory.cs index c22696ac0a..30b4f34422 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ExportColumnFactory.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ExportColumnFactory.cs @@ -17,22 +17,16 @@ // DEALINGS IN THE SOFTWARE. using System; -using ICSharpCode.Reporting.BaseClasses; using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Interfaces.Export; -using ICSharpCode.Reporting.Items; -using ICSharpCode.Reporting.PageBuilder.ExportColumns; namespace ICSharpCode.Reporting.Factories { /// /// Description of ExportColumnFactory. /// - internal class ExportColumnFactory + class ExportColumnFactory { - public ExportColumnFactory() - { - } public static IExportColumn CreateItem (IPrintableObject item) { var export = item.CreateExportColumn(); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportCreatorFactory.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportCreatorFactory.cs index e1fed55013..6ce850bbb8 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportCreatorFactory.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportCreatorFactory.cs @@ -19,7 +19,6 @@ using System; using ICSharpCode.Reporting.Globals; using ICSharpCode.Reporting.Interfaces; -using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.PageBuilder; namespace ICSharpCode.Reporting.Factories diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportModelFactory.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportModelFactory.cs index d958e5948a..b6fa62ec5e 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportModelFactory.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportModelFactory.cs @@ -21,8 +21,9 @@ namespace ICSharpCode.Reporting.Factories public static ReportModel Create() { var reportModel = new ReportModel(); - foreach (var sec in Enum.GetValues(typeof(GlobalEnums.ReportSection))) { - reportModel.SectionCollection.Add (SectionFactory.Create(sec.ToString())); + + foreach (var section in Enum.GetValues(typeof(GlobalEnums.ReportSection))) { + reportModel.SectionCollection.Add (SectionFactory.Create(section.ToString())); } foreach (var section in reportModel.SectionCollection) { diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/CreateGraphics.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/CreateGraphics.cs index 78005c76f5..27e0b902c9 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/CreateGraphics.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/CreateGraphics.cs @@ -24,13 +24,13 @@ namespace ICSharpCode.Reporting.Globals /// /// Description of CreateGraphics. /// - internal class CreateGraphics + static class CreateGraphics { public static Graphics FromSize (Size size){ - if (size == null) { + if (size == Size.Empty) { throw new ArgumentNullException("size"); } - Bitmap bitmap = new Bitmap(size.Width,size.Height); + var bitmap = new Bitmap(size.Width,size.Height); var graphics = Graphics.FromImage(bitmap); return graphics; } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs index cecd76a3ec..accba07f91 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs @@ -25,7 +25,7 @@ namespace ICSharpCode.Reporting.Globals /// public sealed class GlobalEnums { - GlobalEnums() { + private GlobalEnums() { } public enum ReportSection { diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/MeasurementService.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/MeasurementService.cs index 6b5f61572a..0d96f7c133 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/MeasurementService.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/MeasurementService.cs @@ -28,7 +28,6 @@ namespace ICSharpCode.Reporting.Globals static class MeasurementService { - public static Size Measure (IExportText item,Graphics graphics) { if (!item.CanGrow) { return item.Size; diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/StandardFormatter.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/StandardFormatter.cs index 9e684ac60a..a55304f600 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/StandardFormatter.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/StandardFormatter.cs @@ -53,7 +53,7 @@ namespace ICSharpCode.Reporting.Globals // private static string FormatItem (string valueToFormat,string format, // TypeCode typeCode,string nullValue) - private static string FormatItem (string valueToFormat,string format, + static string FormatItem (string valueToFormat,string format, TypeCode typeCode) { string retValue = String.Empty; @@ -90,7 +90,7 @@ namespace ICSharpCode.Reporting.Globals } - private static string FormatBool (string toFormat) + static string FormatBool (string toFormat) { if (CheckValue(toFormat)) { bool b = bool.Parse (toFormat); @@ -99,7 +99,8 @@ namespace ICSharpCode.Reporting.Globals return toFormat; } - private static string FormatIntegers(string toFormat, string format) + + static string FormatIntegers(string toFormat, string format) { string str = String.Empty; if (CheckValue (toFormat)) { @@ -113,7 +114,7 @@ namespace ICSharpCode.Reporting.Globals } - private static string FormatDecimal(string toFormat, string format) + static string FormatDecimal(string toFormat, string format) { string str = String.Empty; if (CheckValue (toFormat)) { @@ -135,7 +136,7 @@ namespace ICSharpCode.Reporting.Globals // http://stackoverflow.com/questions/4710455/i-need-code-to-validate-any-time-in-c-sharp-in-hhmmss-format - private static string FormatDate(string toFormat, string format) + static string FormatDate(string toFormat, string format) { DateTime date; if (DateTime.TryParse(toFormat, out date)) @@ -157,7 +158,7 @@ namespace ICSharpCode.Reporting.Globals } - private static bool CheckValue (string toFormat) + static bool CheckValue (string toFormat) { if (String.IsNullOrEmpty(toFormat)) { return false; diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/TypeHelper.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/TypeHelper.cs index 644ffab2aa..7931164b3e 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/TypeHelper.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/TypeHelper.cs @@ -18,18 +18,18 @@ using System; using System.Data; +using System.Globalization; namespace ICSharpCode.Reporting.Globals { /// /// Description of TypeHelper. /// - class TypeHelper + static class TypeHelper { public static DbType DbTypeFromStringRepresenation(string type) { - switch (type.ToLower()) - { + switch (type.ToLower(CultureInfo.CurrentCulture)){ case "int": return DbType.Int16; case "int16": diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Interfaces/Data/IDataSource.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Interfaces/Data/IDataSource.cs index 66f6486356..a932305662 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Interfaces/Data/IDataSource.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Interfaces/Data/IDataSource.cs @@ -17,7 +17,6 @@ // DEALINGS IN THE SOFTWARE. using System; -using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseRowItem.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseRowItem.cs index 2bce8e3201..d589485bed 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseRowItem.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseRowItem.cs @@ -41,7 +41,5 @@ namespace ICSharpCode.Reporting.Items }; return er; } - - } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseTextItem.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseTextItem.cs index b9e0068025..242c524eed 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseTextItem.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseTextItem.cs @@ -18,6 +18,7 @@ using System; using System.Drawing; +using System.Windows; using ICSharpCode.Reporting.Globals; using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Interfaces.Export; @@ -33,6 +34,7 @@ namespace ICSharpCode.Reporting.Items Font Font {get;set;} string Text {get;set;} ContentAlignment ContentAlignment {get;set;} + TextAlignment TextAlignment {get;set;} string FormatString {get;set;} string DataType {get;set;} @@ -44,7 +46,8 @@ namespace ICSharpCode.Reporting.Items Name = "BaseTextItem"; Font = GlobalValues.DefaultFont; } - + + public Font Font {get;set;} @@ -52,8 +55,12 @@ namespace ICSharpCode.Reporting.Items public string FormatString {get;set;} + [Obsolete ("Use TextAlignment")] public ContentAlignment ContentAlignment {get;set;} + public TextAlignment TextAlignment {get;set;} + + string dataType; public string DataType @@ -83,6 +90,7 @@ namespace ICSharpCode.Reporting.Items ex.Text = Text; ex.FormatString = FormatString; ex.ContentAlignment = ContentAlignment; + ex.TextAlignment = TextAlignment; ex.DataType = DataType; ex.CanGrow = CanGrow; ex.DrawBorder = DrawBorder; diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/GroupColumn.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/GroupColumn.cs index 3c913fadf7..1519f0f673 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/GroupColumn.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/GroupColumn.cs @@ -33,7 +33,7 @@ namespace ICSharpCode.Reporting.Items public GroupColumn(string columnName,int groupLevel, ListSortDirection sortDirection):base(columnName,sortDirection) { - if (GroupLevel < 0) { + if (groupLevel < 0) { throw new ArgumentException("groupLevel"); } this.GroupLevel = groupLevel; diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/ExportColumns/ExportText.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/ExportColumns/ExportText.cs index 2304ba1e4c..1b9d89c9f5 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/ExportColumns/ExportText.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/ExportColumns/ExportText.cs @@ -18,6 +18,7 @@ using System; using System.Drawing; +using System.Windows; using ICSharpCode.Reporting.Arrange; using ICSharpCode.Reporting.Exporter; using ICSharpCode.Reporting.Exporter.Visitors; @@ -34,6 +35,7 @@ namespace ICSharpCode.Reporting.PageBuilder.ExportColumns Font Font {get;set;} string Text {get;set;} ContentAlignment ContentAlignment {get;set;} + TextAlignment TextAlignment {get;set;} string DataType {get;set;} string FormatString {get;set;} } @@ -57,8 +59,11 @@ namespace ICSharpCode.Reporting.PageBuilder.ExportColumns public string FormatString {get;set;} + [Obsolete ("Use TextAlignment")] public ContentAlignment ContentAlignment {get;set;} + public TextAlignment TextAlignment {get;set;} + public string DataType {get;set;} public override ICSharpCode.Reporting.Arrange.IMeasurementStrategy MeasurementStrategy() diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfExporter.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfExporter.cs index 73ae9df3d6..1ee1b452f5 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfExporter.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfExporter.cs @@ -40,9 +40,8 @@ namespace ICSharpCode.Reporting.Pdf public void Run (string fileName,bool show) { - string file; if (String.IsNullOrEmpty(fileName)) { - file = Pages[0].PageInfo.ReportName + ".pdf"; + fileName = Pages[0].PageInfo.ReportName + ".pdf"; } pdfDocument = new PdfDocument(); ConvertPagesToPdf(); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfHelper.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfHelper.cs index 9bf54f516b..16671cdc1a 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfHelper.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfHelper.cs @@ -35,6 +35,7 @@ namespace ICSharpCode.Reporting.Pdf { var font = PdfHelper.CreatePdfFont(exportColumn); var rect = new Rectangle(columnLocation,exportColumn.DesiredSize).ToXRect(); + textFormatter.Alignment = XParagraphAlignment(exportColumn); textFormatter.DrawString(exportColumn.Text, font, CreateBrush(exportColumn.ForeColor), @@ -90,7 +91,21 @@ namespace ICSharpCode.Reporting.Pdf public static XLineCap LineCap (IExportGraphics column) { return XLineCap.Round; - + } + + + public static XParagraphAlignment XParagraphAlignment (ExportText exportColumn) { + switch (exportColumn.TextAlignment) { + case System.Windows.TextAlignment.Left: + return PdfSharp.Drawing.Layout.XParagraphAlignment.Left; + case System.Windows.TextAlignment.Center: + return PdfSharp.Drawing.Layout.XParagraphAlignment.Center; + case System.Windows.TextAlignment.Right: + return PdfSharp.Drawing.Layout.XParagraphAlignment.Center; + case System.Windows.TextAlignment.Justify: + return PdfSharp.Drawing.Layout.XParagraphAlignment.Justify; + } + return PdfSharp.Drawing.Layout.XParagraphAlignment.Left; } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/ReportingFactory.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/ReportingFactory.cs index 7a41d44e24..cb2861e0fe 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/ReportingFactory.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/ReportingFactory.cs @@ -35,8 +35,6 @@ namespace ICSharpCode.Reporting public class ReportingFactory { - - public IReportCreator ReportCreator (Stream stream,IEnumerable list) { ReportModel = LoadReportModel (stream); @@ -53,14 +51,14 @@ namespace ICSharpCode.Reporting } - public IReportCreator ReportCreator (ReportModel reportModel) { + public IReportCreator ReportCreator (IReportModel reportModel) { ReportModel = reportModel; var builder = new FormPageBuilder(ReportModel); return builder; } - internal ReportModel LoadReportModel (Stream stream) + internal IReportModel LoadReportModel (Stream stream) { var doc = new XmlDocument(); doc.Load(stream); @@ -69,7 +67,7 @@ namespace ICSharpCode.Reporting } - static ReportModel LoadModel(XmlDocument doc) + static IReportModel LoadModel(XmlDocument doc) { var loader = new ModelLoader(); object root = loader.Load(doc.DocumentElement); @@ -78,6 +76,6 @@ namespace ICSharpCode.Reporting } - public ReportModel ReportModel {get;private set;} + public IReportModel ReportModel {get;private set;} } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs index ce9af88a6f..13524e669d 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs @@ -40,7 +40,6 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor static class FixedDocumentCreator { - public static FixedPage CreateFixedPage(ExportPage exportPage) { var fixedPage = new FixedPage(); fixedPage.Width = exportPage.Size.ToWpf().Width; @@ -63,14 +62,8 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor public static FormattedText CreateFormattedText(ExportText exportText) { - FlowDirection flowDirection; - var culture = CultureInfo.CurrentCulture; - if (culture.TextInfo.IsRightToLeft) { - flowDirection = FlowDirection.RightToLeft; - } else { - flowDirection = FlowDirection.LeftToRight; - } + var flowDirection = culture.TextInfo.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; var emSize = ExtensionMethodes.ToPoints((int)exportText.Font.SizeInPoints +1); @@ -81,10 +74,17 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor emSize, new SolidColorBrush(exportText.ForeColor.ToWpf()), null, TextFormattingMode.Display); - formattedText.MaxTextWidth = ExtensionMethodes.ToPoints(exportText.DesiredSize.Width); + formattedText.MaxTextWidth = exportText.DesiredSize.Width ; + formattedText.TextAlignment = exportText.TextAlignment; + + if (!exportText.CanGrow) { + formattedText.MaxTextHeight = exportText.Size.Height; + } else { + formattedText.MaxTextHeight = ExtensionMethodes.ToPoints(exportText.DesiredSize.Height ); + } ApplyPrintStyles(formattedText,exportText); - + return formattedText; } @@ -151,53 +151,61 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor FixedPage.SetTop(element,exportColumn.Location.Y); } - - static void SetContentAlignment(TextBlock textBlock,ExportText exportText) - { - //Vertical alignment not working - + /* + public static Point CalculateAlignmentOffset (FormattedText formattedText, ExportText exportText) { + var offset = new Point(0,0); + double y = 0; + double x = 0; + var textLenDif = exportText.Size.Width - formattedText.Width; + var textHeightDif = exportText.Size.Height - formattedText.Height; + switch (exportText.ContentAlignment) { + // Top case System.Drawing.ContentAlignment.TopLeft: - textBlock.VerticalAlignment = VerticalAlignment.Top; - textBlock.TextAlignment = TextAlignment.Left; break; + case System.Drawing.ContentAlignment.TopCenter: - textBlock.VerticalAlignment = VerticalAlignment.Top; - textBlock.TextAlignment = TextAlignment.Center; + x = textLenDif / 2; break; + case System.Drawing.ContentAlignment.TopRight: - textBlock.VerticalAlignment = VerticalAlignment.Top; - textBlock.TextAlignment = TextAlignment.Right; + x = textLenDif; break; + // Middle case System.Drawing.ContentAlignment.MiddleLeft: - textBlock.VerticalAlignment = VerticalAlignment.Center; - textBlock.TextAlignment = TextAlignment.Left; + y = textHeightDif / 2; break; + case System.Drawing.ContentAlignment.MiddleCenter: - textBlock.VerticalAlignment = VerticalAlignment.Center; - textBlock.TextAlignment = TextAlignment.Center; + y = textHeightDif / 2; + x = textLenDif / 2; break; + case System.Drawing.ContentAlignment.MiddleRight: - textBlock.VerticalAlignment = VerticalAlignment.Center; - textBlock.TextAlignment = TextAlignment.Right; + x = textLenDif;; + y = textHeightDif / 2; break; + //Bottom case System.Drawing.ContentAlignment.BottomLeft: - textBlock.VerticalAlignment = VerticalAlignment.Bottom; - textBlock.TextAlignment = TextAlignment.Left; + x = 0; + y = textHeightDif; break; + case System.Drawing.ContentAlignment.BottomCenter: - textBlock.VerticalAlignment = VerticalAlignment.Bottom; - textBlock.TextAlignment = TextAlignment.Center; + x = textLenDif / 2; + y = textHeightDif; break; + case System.Drawing.ContentAlignment.BottomRight: - textBlock.VerticalAlignment = VerticalAlignment.Bottom; - textBlock.TextAlignment = TextAlignment.Right; + x = textLenDif; + y = textHeightDif; break; } + return new Point(x,y); } - + */ public static Pen CreateWpfPen(IReportObject exportColumn){ if (exportColumn == null) @@ -217,13 +225,13 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor } - public static Brush ConvertBrush(System.Drawing.Color color){ + public static Brush ConvertBrush(System.Drawing.Color color) + { var b = new BrushConverter(); - if (b.IsValid(color.Name)){ + if (b.IsValid(color.Name)) { return b.ConvertFromString(color.Name) as SolidColorBrush; - } else{ - return b.ConvertFromString("Black") as SolidColorBrush; } + return b.ConvertFromString("Black") as SolidColorBrush; } @@ -270,6 +278,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor return penLineCap; } + public static DashStyle DashStyle (IExportGraphics exportGraphics) { var dashStyle = DashStyles.Solid; diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs index 5624ba60fd..5d5c2935ff 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs @@ -60,7 +60,6 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor Canvas RenderSectionContainer (ExportContainer container) { - var canvas = FixedDocumentCreator.CreateContainer(container); foreach (var element in container.ExportedItems) { if (IsContainer(element)) { @@ -119,16 +118,19 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor public override void Visit(ExportText exportColumn){ - var ft = FixedDocumentCreator.CreateFormattedText((ExportText)exportColumn); - var visual = new DrawingVisual(); + var formattedText = FixedDocumentCreator.CreateFormattedText((ExportText)exportColumn); + var location = new Point(exportColumn.Location.X,exportColumn.Location.Y); - using (var dc = visual.RenderOpen()){ + + var visual = new DrawingVisual(); + using (var drawingContext = visual.RenderOpen()){ if (ShouldSetBackcolor(exportColumn)) { - dc.DrawRectangle(FixedDocumentCreator.ConvertBrush(exportColumn.BackColor), + var r = new Rect(location,new Size(exportColumn.Size.Width,exportColumn.Size.Height)); + drawingContext.DrawRectangle(FixedDocumentCreator.ConvertBrush(exportColumn.BackColor), null, new Rect(location,new Size(exportColumn.Size.Width,exportColumn.Size.Height))); } - dc.DrawText(ft,location); + drawingContext.DrawText(formattedText,location); } var dragingElement = new DrawingElement(visual); UIElement = dragingElement; @@ -181,7 +183,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor } - DrawingElement CircleVisual(GraphicsContainer circle){ + static DrawingElement CircleVisual(GraphicsContainer circle){ var pen = FixedDocumentCreator.CreateWpfPen(circle); var rad = CalcRadius(circle.Size); @@ -197,7 +199,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor } - Border CreateBorder(IExportColumn exportColumn) + static Border CreateBorder(IExportColumn exportColumn) { var border = new Border(); border.BorderThickness = Thickness(exportColumn); @@ -209,7 +211,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor } - Thickness Thickness(IExportColumn exportColumn) + static Thickness Thickness(IExportColumn exportColumn) { double bT; bT = !IsGraphicsContainer(exportColumn) ? 1 : Convert.ToDouble(((GraphicsContainer)exportColumn).Thickness); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/ModelLoader.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/ModelLoader.cs index 43dbac7575..7eab27cca7 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/ModelLoader.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/ModelLoader.cs @@ -27,8 +27,6 @@ namespace ICSharpCode.Reporting.Xml public class ModelLoader: MycroParser { public ModelLoader() { - Console.WriteLine("ICSharpCode.Reporting.Xml.ModelLoader"); - Console.WriteLine(); } protected override Type GetTypeByName(string ns, string name) { diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/MycroParser.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/MycroParser.cs index 521f46f15a..5a3e5946ee 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/MycroParser.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/MycroParser.cs @@ -44,9 +44,9 @@ namespace ICSharpCode.Reporting.Xml public abstract class MycroParser { public MycroParser() { - Console.WriteLine("Mycroparser"); - Console.WriteLine(); } + + public object Load(XmlElement element) { return ProcessNode(element, null); @@ -196,7 +196,7 @@ namespace ICSharpCode.Reporting.Xml } } - void ProcessAttributes(XmlNode node, object ret, Type type) + static void ProcessAttributes(XmlNode node, object ret, Type type) { // process attributes foreach(XmlAttribute attr in node.Attributes) diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Model/Report_FromListFixture.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Model/Report_FromListFixture.cs index aa8101e507..45ba8599a2 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Model/Report_FromListFixture.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Model/Report_FromListFixture.cs @@ -20,6 +20,7 @@ using System; using System.Drawing; using System.Reflection; +using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Items; using NUnit.Framework; @@ -28,7 +29,7 @@ namespace ICSharpCode.Reporting.Test.Model [TestFixture] public class Report_FromListFixture { - private ReportModel model; + IReportModel model; [Test] public void ReportHeaderContainsOneItem () { diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Model/Report_TwoItemsFixture.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Model/Report_TwoItemsFixture.cs index 75d01c457a..5b03ecd7a3 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Model/Report_TwoItemsFixture.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Model/Report_TwoItemsFixture.cs @@ -20,6 +20,7 @@ using System; using System.Drawing; using System.Reflection; +using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Items; using NUnit.Framework; @@ -29,7 +30,7 @@ namespace ICSharpCode.Reporting.Test.Model public class ReportTwoItemsFixture { - private ReportModel model; + IReportModel model; [Test] public void LoadModelWithItems() diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/PageBuilder/SectionConverterFixture.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/PageBuilder/SectionConverterFixture.cs index 42dba39876..af4afbcd0a 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/PageBuilder/SectionConverterFixture.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/PageBuilder/SectionConverterFixture.cs @@ -95,7 +95,7 @@ namespace ICSharpCode.Reporting.Test.PageBuilder container.Items.Add(item1); container.Items.Add(item2); - Bitmap bitmap = new Bitmap(700,1000); + var bitmap = new Bitmap(700,1000); graphics = Graphics.FromImage(bitmap); } } diff --git a/src/AddIns/VersionControl/GitAddIn/Src/Git.cs b/src/AddIns/VersionControl/GitAddIn/Src/Git.cs index c5f3f10694..a7480c487f 100644 --- a/src/AddIns/VersionControl/GitAddIn/Src/Git.cs +++ b/src/AddIns/VersionControl/GitAddIn/Src/Git.cs @@ -94,7 +94,8 @@ namespace ICSharpCode.GitAddIn /// public static string FindGit() { - string[] paths = Environment.GetEnvironmentVariable("PATH").Split(';'); + string pathVariable = Environment.GetEnvironmentVariable("PATH") ?? string.Empty; + string[] paths = pathVariable.Split(new char[]{';'}, StringSplitOptions.RemoveEmptyEntries); foreach (string path in paths) { try { string exe = Path.Combine(path, "git.exe"); diff --git a/src/AddIns/VersionControl/SubversionAddIn/Src/Commands/AutostartCommands.cs b/src/AddIns/VersionControl/SubversionAddIn/Src/Commands/AutostartCommands.cs index 639719169e..20e32b2a72 100644 --- a/src/AddIns/VersionControl/SubversionAddIn/Src/Commands/AutostartCommands.cs +++ b/src/AddIns/VersionControl/SubversionAddIn/Src/Commands/AutostartCommands.cs @@ -389,6 +389,10 @@ namespace ICSharpCode.Svn.Commands if (!AddInOptions.AutomaticallyRenameFiles) return; string fullSource = Path.GetFullPath(e.SourceFile); if (!CanBeVersionControlledFile(fullSource)) return; + if (!FileHelpers.CheckRenameOrReplacePossible(e)) { + e.Cancel = true; + return; + } try { using (SvnClientWrapper client = new SvnClientWrapper()) { SvnMessageView.HandleNotifications(client); diff --git a/src/Libraries/AvalonEdit/.gitignore b/src/Libraries/AvalonEdit/.gitignore new file mode 100644 index 0000000000..6f644d1bd1 --- /dev/null +++ b/src/Libraries/AvalonEdit/.gitignore @@ -0,0 +1,7 @@ +# ignore all obj and bin folders (even in subdirectories) +obj/ +bin/ +/Documentation/Help +/packages/AvalonEdit +/packages/AvalonEdit.Sample +/packages/NUnit.2.6.3 diff --git a/src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.shfbproj b/src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.shfbproj index 12b2d71731..c32b45524e 100644 --- a/src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.shfbproj +++ b/src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.shfbproj @@ -39,20 +39,20 @@ - - - + + - + {@HelpFormatOutputPaths} - - - - - - - + + - - - - - - + + + + + + {@CachedFrameworkCommentList} {@CommentFileList} - - - - - - - - - - + + + + + + + + + + + + + + {@TokenFiles} - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -146,6 +156,12 @@ Additionally, the class HighlightingColorizer provides integration of the highli Guid en-US AboveNamespaces + OnlyWarningsAndErrors + HtmlHelp1, Website + False + True + False + False diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/ChangeTrackingTest.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/ChangeTrackingTest.cs index 9a4cf7e121..fc0295ea2c 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/ChangeTrackingTest.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/ChangeTrackingTest.cs @@ -18,7 +18,9 @@ using System; using System.Linq; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif using NUnit.Framework; namespace ICSharpCode.AvalonEdit.Document diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/TextAnchorTest.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/TextAnchorTest.cs index 5b129c2fa6..1e481dc54b 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/TextAnchorTest.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/TextAnchorTest.cs @@ -18,7 +18,9 @@ using System; using System.Collections.Generic; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif using NUnit.Framework; namespace ICSharpCode.AvalonEdit.Document diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/TextSegmentTreeTest.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/TextSegmentTreeTest.cs index 64b1e5c858..d893583b26 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/TextSegmentTreeTest.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/TextSegmentTreeTest.cs @@ -18,7 +18,9 @@ using System; using System.Collections.Generic; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif using NUnit.Framework; namespace ICSharpCode.AvalonEdit.Document diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/TextUtilitiesTests.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/TextUtilitiesTests.cs index a7d93e74ec..ab9abffe97 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/TextUtilitiesTests.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Document/TextUtilitiesTests.cs @@ -17,7 +17,9 @@ // DEALINGS IN THE SOFTWARE. using System; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif using NUnit.Framework; namespace ICSharpCode.AvalonEdit.Document diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Editing/ChangeDocumentTests.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Editing/ChangeDocumentTests.cs index bc80726841..bc0176ad7d 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Editing/ChangeDocumentTests.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Editing/ChangeDocumentTests.cs @@ -19,7 +19,9 @@ using System; using System.Text; using ICSharpCode.AvalonEdit.Document; +#if NREFACTORY using ICSharpCode.NRefactory; +#endif using NUnit.Framework; namespace ICSharpCode.AvalonEdit.Editing diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Highlighting/HighlightedLineMergeTests.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Highlighting/HighlightedLineMergeTests.cs index 5a1384fe38..b6c1eface6 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Highlighting/HighlightedLineMergeTests.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Highlighting/HighlightedLineMergeTests.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using System.Linq; +using ICSharpCode.AvalonEdit.Document; using ICSharpCode.NRefactory.Editor; using NUnit.Framework; @@ -27,7 +28,7 @@ namespace ICSharpCode.AvalonEdit.Highlighting [TestFixture] public class HighlightedLineMergeTests { - IDocument document = new ReadOnlyDocument(new string(' ', 20)); + IDocument document = new TextDocument(new string(' ', 20)); [Test] public void SimpleMerge1() diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/ICSharpCode.AvalonEdit.Tests.csproj b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/ICSharpCode.AvalonEdit.Tests.csproj index 5452e4b38f..acae917905 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/ICSharpCode.AvalonEdit.Tests.csproj +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/ICSharpCode.AvalonEdit.Tests.csproj @@ -3,13 +3,12 @@ {6222A3A1-83CE-47A3-A4E4-A018F82D44D8} Debug - AnyCPU + Net40 Library ICSharpCode.AvalonEdit ICSharpCode.AvalonEdit.Tests - v4.5 + v4.0 Properties - "C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\Misc\SourceAnalysis\Settings.SourceAnalysis" True ..\ICSharpCode.AvalonEdit\ICSharpCode.AvalonEdit.snk False @@ -18,44 +17,54 @@ False 4 False - ..\..\..\..\bin\UnitTests\ + bin\$(Configuration)\ OnBuildSuccess False obj\$(Configuration)\ + False + Auto + 4194304 + AnyCPU + 4096 + + + v3.5 + + + v4.0 + DOTNET4 + + + v4.5 + NREFACTORY true Full False True - DEBUG;TRACE obj\ + + false None True False - TRACE - - - False - Auto - 4194304 - AnyCPU - 4096 - False + obj\ + - - ..\..\..\AddIns\Misc\AddInManager\RequiredLibraries\ICSharpCode.SharpZipLib.dll - + + {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} + ICSharpCode.NRefactory + ..\..\..\Tools\NUnit\nunit.framework.dll - True 3.0 @@ -103,10 +112,6 @@ - - {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} - ICSharpCode.NRefactory - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1} ICSharpCode.AvalonEdit @@ -115,4 +120,7 @@ + + + \ No newline at end of file diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/MultipleUIThreads.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/MultipleUIThreads.cs index d78a71af82..8cd9a24135 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/MultipleUIThreads.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/MultipleUIThreads.cs @@ -34,6 +34,7 @@ namespace ICSharpCode.AvalonEdit try { var window = new Window(); window.Content = new TextEditor(); + window.ShowActivated = false; window.Show(); } catch (Exception ex) { error = ex; diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Properties/AssemblyInfo.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Properties/AssemblyInfo.cs index ff921bfb13..99842d5a6e 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Properties/AssemblyInfo.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Properties/AssemblyInfo.cs @@ -51,3 +51,5 @@ using NUnit.Framework; // Run unit tests on STA thread. [assembly: RequiresSTA] + +namespace ICSharpCode.NRefactory.Editor {} \ No newline at end of file diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Search/FindTests.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Search/FindTests.cs index 68ce3b4659..958baffa36 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Search/FindTests.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Search/FindTests.cs @@ -19,7 +19,9 @@ using System; using System.Linq; using ICSharpCode.AvalonEdit.Document; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif using NUnit.Framework; namespace ICSharpCode.AvalonEdit.Search diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Utils/CaretNavigationTests.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Utils/CaretNavigationTests.cs index bedcfa822e..ebc9c5a445 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Utils/CaretNavigationTests.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Utils/CaretNavigationTests.cs @@ -19,7 +19,9 @@ using System; using System.Windows.Documents; using ICSharpCode.AvalonEdit.Document; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif using NUnit.Framework; namespace ICSharpCode.AvalonEdit.Utils diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionList.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionList.cs index 4b00ea64c0..bc1a88fefd 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionList.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionList.cs @@ -380,11 +380,15 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion static bool CamelCaseMatch(string text, string query) { + // We take the first letter of the text regardless of whether or not it's upper case so we match + // against camelCase text as well as PascalCase text ("cct" matches "camelCaseText") + var theFirstLetterOfEachWord = text.Take(1).Concat(text.Skip(1).Where(char.IsUpper)); + int i = 0; - foreach (char upper in text.Where(c => char.IsUpper(c))) { + foreach (var letter in theFirstLetterOfEachWord) { if (i > query.Length - 1) return true; // return true here for CamelCase partial match ("CQ" matches "CodeQualityAnalysis") - if (char.ToUpper(query[i], CultureInfo.InvariantCulture) != upper) + if (char.ToUpperInvariant(query[i]) != char.ToUpperInvariant(letter)) return false; i++; } diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/ICompletionData.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/ICompletionData.cs index e4ada66aea..6d7daf78a4 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/ICompletionData.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/ICompletionData.cs @@ -19,7 +19,11 @@ using System; using System.Windows.Media; using ICSharpCode.AvalonEdit.Editing; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#else +using ICSharpCode.AvalonEdit.Document; +#endif namespace ICSharpCode.AvalonEdit.CodeCompletion { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentChangeEventArgs.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentChangeEventArgs.cs index 86968ce9f1..df248941cf 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentChangeEventArgs.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentChangeEventArgs.cs @@ -17,7 +17,7 @@ // DEALINGS IN THE SOFTWARE. using System; -using ICSharpCode.AvalonEdit.Utils; +using ICSharpCode.AvalonEdit.Document; using ICSharpCode.NRefactory.Editor; namespace ICSharpCode.AvalonEdit.Document diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentLine.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentLine.cs index 9bf957ed42..68e6be95f1 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentLine.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentLine.cs @@ -19,7 +19,9 @@ using System; using System.Diagnostics; using System.Globalization; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Document { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentTextWriter.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentTextWriter.cs index ea376d6bd2..af058ecbb1 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentTextWriter.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentTextWriter.cs @@ -19,7 +19,9 @@ using System; using System.IO; using System.Text; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Document { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/IDocument.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/IDocument.cs new file mode 100644 index 0000000000..0b7e0c988d --- /dev/null +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/IDocument.cs @@ -0,0 +1,343 @@ +// Copyright (c) 2014 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; + +namespace ICSharpCode.AvalonEdit.Document +{ + #if !NREFACTORY + /// + /// A document representing a source code file for refactoring. + /// Line and column counting starts at 1. + /// Offset counting starts at 0. + /// + public interface IDocument : ITextSource, IServiceProvider + { + #if NREFACTORY + /// + /// Creates an immutable snapshot of this document. + /// + IDocument CreateDocumentSnapshot(); + #endif + + /// + /// Gets/Sets the text of the whole document.. + /// + new string Text { get; set; } // hides ITextSource.Text to add the setter + + /// + /// This event is called directly before a change is applied to the document. + /// + /// + /// It is invalid to modify the document within this event handler. + /// Aborting the change (by throwing an exception) is likely to cause corruption of data structures + /// that listen to the Changing and Changed events. + /// + event EventHandler TextChanging; + + /// + /// This event is called directly after a change is applied to the document. + /// + /// + /// It is invalid to modify the document within this event handler. + /// Aborting the event handler (by throwing an exception) is likely to cause corruption of data structures + /// that listen to the Changing and Changed events. + /// + event EventHandler TextChanged; + + /// + /// This event is called after a group of changes is completed. + /// + /// + event EventHandler ChangeCompleted; + + /// + /// Gets the number of lines in the document. + /// + int LineCount { get; } + + /// + /// Gets the document line with the specified number. + /// + /// The number of the line to retrieve. The first line has number 1. + IDocumentLine GetLineByNumber(int lineNumber); + + /// + /// Gets the document line that contains the specified offset. + /// + IDocumentLine GetLineByOffset(int offset); + + /// + /// Gets the offset from a text location. + /// + /// + int GetOffset(int line, int column); + + /// + /// Gets the offset from a text location. + /// + /// + int GetOffset(TextLocation location); + + /// + /// Gets the location from an offset. + /// + /// + TextLocation GetLocation(int offset); + + /// + /// Inserts text. + /// + /// The offset at which the text is inserted. + /// The new text. + /// + /// Anchors positioned exactly at the insertion offset will move according to their movement type. + /// For AnchorMovementType.Default, they will move behind the inserted text. + /// The caret will also move behind the inserted text. + /// + void Insert(int offset, string text); + + /// + /// Inserts text. + /// + /// The offset at which the text is inserted. + /// The new text. + /// + /// Anchors positioned exactly at the insertion offset will move according to their movement type. + /// For AnchorMovementType.Default, they will move behind the inserted text. + /// The caret will also move behind the inserted text. + /// + void Insert(int offset, ITextSource text); + + /// + /// Inserts text. + /// + /// The offset at which the text is inserted. + /// The new text. + /// + /// Anchors positioned exactly at the insertion offset will move according to the anchor's movement type. + /// For AnchorMovementType.Default, they will move according to the movement type specified by this parameter. + /// The caret will also move according to the parameter. + /// + void Insert(int offset, string text, AnchorMovementType defaultAnchorMovementType); + + /// + /// Inserts text. + /// + /// The offset at which the text is inserted. + /// The new text. + /// + /// Anchors positioned exactly at the insertion offset will move according to the anchor's movement type. + /// For AnchorMovementType.Default, they will move according to the movement type specified by this parameter. + /// The caret will also move according to the parameter. + /// + void Insert(int offset, ITextSource text, AnchorMovementType defaultAnchorMovementType); + + /// + /// Removes text. + /// + /// Starting offset of the text to be removed. + /// Length of the text to be removed. + void Remove(int offset, int length); + + /// + /// Replaces text. + /// + /// The starting offset of the text to be replaced. + /// The length of the text to be replaced. + /// The new text. + void Replace(int offset, int length, string newText); + + /// + /// Replaces text. + /// + /// The starting offset of the text to be replaced. + /// The length of the text to be replaced. + /// The new text. + void Replace(int offset, int length, ITextSource newText); + + /// + /// Make the document combine the following actions into a single + /// action for undo purposes. + /// + void StartUndoableAction(); + + /// + /// Ends the undoable action started with . + /// + void EndUndoableAction(); + + /// + /// Creates an undo group. Dispose the returned value to close the undo group. + /// + /// An object that closes the undo group when Dispose() is called. + IDisposable OpenUndoGroup(); + + /// + /// Creates a new at the specified offset. + /// + /// + ITextAnchor CreateAnchor(int offset); + + /// + /// Gets the name of the file the document is stored in. + /// Could also be a non-existent dummy file name or null if no name has been set. + /// + string FileName { get; } + + /// + /// Fired when the file name of the document changes. + /// + event EventHandler FileNameChanged; + } + + /// + /// A line inside a . + /// + public interface IDocumentLine : ISegment + { + /// + /// Gets the length of this line, including the line delimiter. + /// + int TotalLength { get; } + + /// + /// Gets the length of the line terminator. + /// Returns 1 or 2; or 0 at the end of the document. + /// + int DelimiterLength { get; } + + /// + /// Gets the number of this line. + /// The first line has the number 1. + /// + int LineNumber { get; } + + /// + /// Gets the previous line. Returns null if this is the first line in the document. + /// + IDocumentLine PreviousLine { get; } + + /// + /// Gets the next line. Returns null if this is the last line in the document. + /// + IDocumentLine NextLine { get; } + + /// + /// Gets whether the line was deleted. + /// + bool IsDeleted { get; } + } + + /// + /// Describes a change of the document text. + /// This class is thread-safe. + /// + [Serializable] + public class TextChangeEventArgs : EventArgs + { + readonly int offset; + readonly ITextSource removedText; + readonly ITextSource insertedText; + + /// + /// The offset at which the change occurs. + /// + public int Offset { + get { return offset; } + } + + /// + /// The text that was removed. + /// + public ITextSource RemovedText { + get { return removedText; } + } + + /// + /// The number of characters removed. + /// + public int RemovalLength { + get { return removedText.TextLength; } + } + + /// + /// The text that was inserted. + /// + public ITextSource InsertedText { + get { return insertedText; } + } + + /// + /// The number of characters inserted. + /// + public int InsertionLength { + get { return insertedText.TextLength; } + } + + /// + /// Creates a new TextChangeEventArgs object. + /// + public TextChangeEventArgs(int offset, string removedText, string insertedText) + { + if (offset < 0) + throw new ArgumentOutOfRangeException("offset", offset, "offset must not be negative"); + this.offset = offset; + this.removedText = removedText != null ? new StringTextSource(removedText) : StringTextSource.Empty; + this.insertedText = insertedText != null ? new StringTextSource(insertedText) : StringTextSource.Empty; + } + + /// + /// Creates a new TextChangeEventArgs object. + /// + public TextChangeEventArgs(int offset, ITextSource removedText, ITextSource insertedText) + { + if (offset < 0) + throw new ArgumentOutOfRangeException("offset", offset, "offset must not be negative"); + this.offset = offset; + this.removedText = removedText ?? StringTextSource.Empty; + this.insertedText = insertedText ?? StringTextSource.Empty; + } + + /// + /// Gets the new offset where the specified offset moves after this document change. + /// + public virtual int GetNewOffset(int offset, AnchorMovementType movementType = AnchorMovementType.Default) + { + if (offset >= this.Offset && offset <= this.Offset + this.RemovalLength) { + if (movementType == AnchorMovementType.BeforeInsertion) + return this.Offset; + else + return this.Offset + this.InsertionLength; + } else if (offset > this.Offset) { + return offset + this.InsertionLength - this.RemovalLength; + } else { + return offset; + } + } + + /// + /// Creates TextChangeEventArgs for the reverse change. + /// + public virtual TextChangeEventArgs Invert() + { + return new TextChangeEventArgs(offset, insertedText, removedText); + } + } + #endif +} \ No newline at end of file diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ITextAnchor.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ITextAnchor.cs new file mode 100644 index 0000000000..ba8977f0f0 --- /dev/null +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ITextAnchor.cs @@ -0,0 +1,142 @@ +// Copyright (c) 2014 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 ICSharpCode.NRefactory; + +namespace ICSharpCode.AvalonEdit.Document +{ + #if !NREFACTORY + /// + /// The TextAnchor class references an offset (a position between two characters). + /// It automatically updates the offset when text is inserted/removed in front of the anchor. + /// + /// + /// Use the property to get the offset from a text anchor. + /// Use the method to create an anchor from an offset. + /// + /// + /// The document will automatically update all text anchors; and because it uses weak references to do so, + /// the garbage collector can simply collect the anchor object when you don't need it anymore. + /// + /// Moreover, the document is able to efficiently update a large number of anchors without having to look + /// at each anchor object individually. Updating the offsets of all anchors usually only takes time logarithmic + /// to the number of anchors. Retrieving the property also runs in O(lg N). + /// + /// + /// Usage: + /// TextAnchor anchor = document.CreateAnchor(offset); + /// ChangeMyDocument(); + /// int newOffset = anchor.Offset; + /// + /// + public interface ITextAnchor + { + /// + /// Gets the text location of this anchor. + /// + /// Thrown when trying to get the Offset from a deleted anchor. + TextLocation Location { get; } + + /// + /// Gets the offset of the text anchor. + /// + /// Thrown when trying to get the Offset from a deleted anchor. + int Offset { get; } + + /// + /// Controls how the anchor moves. + /// + /// Anchor movement is ambiguous if text is inserted exactly at the anchor's location. + /// Does the anchor stay before the inserted text, or does it move after it? + /// The property will be used to determine which of these two options the anchor will choose. + /// The default value is . + AnchorMovementType MovementType { get; set; } + + /// + /// + /// Specifies whether the anchor survives deletion of the text containing it. + /// + /// false: The anchor is deleted when the a selection that includes the anchor is deleted. + /// true: The anchor is not deleted. + /// + /// + /// + bool SurviveDeletion { get; set; } + + /// + /// Gets whether the anchor was deleted. + /// + /// + /// When a piece of text containing an anchor is removed, then that anchor will be deleted. + /// First, the property is set to true on all deleted anchors, + /// then the events are raised. + /// You cannot retrieve the offset from an anchor that has been deleted. + /// This deletion behavior might be useful when using anchors for building a bookmark feature, + /// but in other cases you want to still be able to use the anchor. For those cases, set = true. + /// + bool IsDeleted { get; } + + /// + /// Occurs after the anchor was deleted. + /// + /// + /// + /// Due to the 'weak reference' nature of text anchors, you will receive + /// the Deleted event only while your code holds a reference to the TextAnchor object. + /// + /// + event EventHandler Deleted; + + /// + /// Gets the line number of the anchor. + /// + /// Thrown when trying to get the Offset from a deleted anchor. + int Line { get; } + + /// + /// Gets the column number of this anchor. + /// + /// Thrown when trying to get the Offset from a deleted anchor. + int Column { get; } + } + + /// + /// Defines how a text anchor moves. + /// + public enum AnchorMovementType + { + /// + /// When text is inserted at the anchor position, the type of the insertion + /// determines where the caret moves to. For normal insertions, the anchor will move + /// after the inserted text. + /// + Default, + /// + /// Behaves like a start marker - when text is inserted at the anchor position, the anchor will stay + /// before the inserted text. + /// + BeforeInsertion, + /// + /// Behave like an end marker - when text is insered at the anchor position, the anchor will move + /// after the inserted text. + /// + AfterInsertion + } + #endif +} \ No newline at end of file diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ITextSource.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ITextSource.cs new file mode 100644 index 0000000000..33077fe419 --- /dev/null +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ITextSource.cs @@ -0,0 +1,357 @@ +// Copyright (c) 2014 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.Collections.Generic; +using System; +using System.IO; + +namespace ICSharpCode.AvalonEdit.Document +{ + #if !NREFACTORY + /// + /// A read-only view on a (potentially mutable) text source. + /// The IDocument interface derives from this interface. + /// + public interface ITextSource + { + /// + /// Gets a version identifier for this text source. + /// Returns null for unversioned text sources. + /// + ITextSourceVersion Version { get; } + + /// + /// Creates an immutable snapshot of this text source. + /// Unlike all other methods in this interface, this method is thread-safe. + /// + ITextSource CreateSnapshot(); + + /// + /// Creates an immutable snapshot of a part of this text source. + /// Unlike all other methods in this interface, this method is thread-safe. + /// + ITextSource CreateSnapshot(int offset, int length); + + /// + /// Creates a new TextReader to read from this text source. + /// + TextReader CreateReader(); + + /// + /// Creates a new TextReader to read from this text source. + /// + TextReader CreateReader(int offset, int length); + + /// + /// Gets the total text length. + /// + /// The length of the text, in characters. + /// This is the same as Text.Length, but is more efficient because + /// it doesn't require creating a String object. + int TextLength { get; } + + /// + /// Gets the whole text as string. + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] + string Text { get; } + + /// + /// Gets a character at the specified position in the document. + /// + /// The index of the character to get. + /// Offset is outside the valid range (0 to TextLength-1). + /// The character at the specified position. + /// This is the same as Text[offset], but is more efficient because + /// it doesn't require creating a String object. + char GetCharAt(int offset); + + /// + /// Retrieves the text for a portion of the document. + /// + /// offset or length is outside the valid range. + /// This is the same as Text.Substring, but is more efficient because + /// it doesn't require creating a String object for the whole document. + string GetText(int offset, int length); + + /// + /// Retrieves the text for a portion of the document. + /// + /// offset or length is outside the valid range. + string GetText(ISegment segment); + + /// + /// Writes the text from this document into the TextWriter. + /// + void WriteTextTo(TextWriter writer); + + /// + /// Writes the text from this document into the TextWriter. + /// + void WriteTextTo(TextWriter writer, int offset, int length); + + /// + /// Gets the index of the first occurrence of the character in the specified array. + /// + /// Character to search for + /// Start index of the area to search. + /// Length of the area to search. + /// The first index where the character was found; or -1 if no occurrence was found. + int IndexOf(char c, int startIndex, int count); + + /// + /// Gets the index of the first occurrence of any character in the specified array. + /// + /// Characters to search for + /// Start index of the area to search. + /// Length of the area to search. + /// The first index where any character was found; or -1 if no occurrence was found. + int IndexOfAny(char[] anyOf, int startIndex, int count); + + /// + /// Gets the index of the first occurrence of the specified search text in this text source. + /// + /// The search text + /// Start index of the area to search. + /// Length of the area to search. + /// String comparison to use. + /// The first index where the search term was found; or -1 if no occurrence was found. + int IndexOf(string searchText, int startIndex, int count, StringComparison comparisonType); + + /// + /// Gets the index of the last occurrence of the specified character in this text source. + /// + /// The search character + /// Start index of the area to search. + /// Length of the area to search. + /// The last index where the search term was found; or -1 if no occurrence was found. + /// The search proceeds backwards from (startIndex+count) to startIndex. + /// This is different than the meaning of the parameters on string.LastIndexOf! + int LastIndexOf(char c, int startIndex, int count); + + /// + /// Gets the index of the last occurrence of the specified search text in this text source. + /// + /// The search text + /// Start index of the area to search. + /// Length of the area to search. + /// String comparison to use. + /// The last index where the search term was found; or -1 if no occurrence was found. + /// The search proceeds backwards from (startIndex+count) to startIndex. + /// This is different than the meaning of the parameters on string.LastIndexOf! + int LastIndexOf(string searchText, int startIndex, int count, StringComparison comparisonType); + + /* What about: + void Insert (int offset, string value); + void Remove (int offset, int count); + void Remove (ISegment segment); + + void Replace (int offset, int count, string value); + + Or more search operations: + + IEnumerable SearchForward (string pattern, int startIndex); + IEnumerable SearchForwardIgnoreCase (string pattern, int startIndex); + + IEnumerable SearchBackward (string pattern, int startIndex); + IEnumerable SearchBackwardIgnoreCase (string pattern, int startIndex); + */ + } + + /// + /// Represents a version identifier for a text source. + /// + /// + /// Verions can be used to efficiently detect whether a document has changed and needs reparsing; + /// or even to implement incremental parsers. + /// It is a separate class from ITextSource to allow the GC to collect the text source while + /// the version checkpoint is still in use. + /// + public interface ITextSourceVersion + { + /// + /// Gets whether this checkpoint belongs to the same document as the other checkpoint. + /// + /// + /// Returns false when given null. + /// + bool BelongsToSameDocumentAs(ITextSourceVersion other); + + /// + /// Compares the age of this checkpoint to the other checkpoint. + /// + /// This method is thread-safe. + /// Raised if 'other' belongs to a different document than this version. + /// -1 if this version is older than . + /// 0 if this version instance represents the same version as . + /// 1 if this version is newer than . + int CompareAge(ITextSourceVersion other); + + /// + /// Gets the changes from this checkpoint to the other checkpoint. + /// If 'other' is older than this checkpoint, reverse changes are calculated. + /// + /// This method is thread-safe. + /// Raised if 'other' belongs to a different document than this checkpoint. + IEnumerable GetChangesTo(ITextSourceVersion other); + + /// + /// Calculates where the offset has moved in the other buffer version. + /// + /// Raised if 'other' belongs to a different document than this checkpoint. + int MoveOffsetTo(ITextSourceVersion other, int oldOffset, AnchorMovementType movement = AnchorMovementType.Default); + } + + /// + /// Implements the ITextSource interface using a string. + /// + [Serializable] + public class StringTextSource : ITextSource + { + /// + /// Gets a text source containing the empty string. + /// + public static readonly StringTextSource Empty = new StringTextSource(string.Empty); + + readonly string text; + readonly ITextSourceVersion version; + + /// + /// Creates a new StringTextSource with the given text. + /// + public StringTextSource(string text) + { + if (text == null) + throw new ArgumentNullException("text"); + this.text = text; + } + + /// + /// Creates a new StringTextSource with the given text. + /// + public StringTextSource(string text, ITextSourceVersion version) + { + if (text == null) + throw new ArgumentNullException("text"); + this.text = text; + this.version = version; + } + + /// + public ITextSourceVersion Version { + get { return version; } + } + + /// + public int TextLength { + get { return text.Length; } + } + + /// + public string Text { + get { return text; } + } + + /// + public ITextSource CreateSnapshot() + { + return this; // StringTextSource is immutable + } + + /// + public ITextSource CreateSnapshot(int offset, int length) + { + return new StringTextSource(text.Substring(offset, length)); + } + + /// + public TextReader CreateReader() + { + return new StringReader(text); + } + + /// + public TextReader CreateReader(int offset, int length) + { + return new StringReader(text.Substring(offset, length)); + } + + /// + public void WriteTextTo(TextWriter writer) + { + writer.Write(text); + } + + /// + public void WriteTextTo(TextWriter writer, int offset, int length) + { + writer.Write(text.Substring(offset, length)); + } + + /// + public char GetCharAt(int offset) + { + return text[offset]; + } + + /// + public string GetText(int offset, int length) + { + return text.Substring(offset, length); + } + + /// + public string GetText(ISegment segment) + { + if (segment == null) + throw new ArgumentNullException("segment"); + return text.Substring(segment.Offset, segment.Length); + } + + /// + public int IndexOf(char c, int startIndex, int count) + { + return text.IndexOf(c, startIndex, count); + } + + /// + public int IndexOfAny(char[] anyOf, int startIndex, int count) + { + return text.IndexOfAny(anyOf, startIndex, count); + } + + /// + public int IndexOf(string searchText, int startIndex, int count, StringComparison comparisonType) + { + return text.IndexOf(searchText, startIndex, count, comparisonType); + } + + /// + public int LastIndexOf(char c, int startIndex, int count) + { + return text.LastIndexOf(c, startIndex + count - 1, count); + } + + /// + public int LastIndexOf(string searchText, int startIndex, int count, StringComparison comparisonType) + { + return text.LastIndexOf(searchText, startIndex + count - 1, count, comparisonType); + } + } + #endif +} diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/LineManager.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/LineManager.cs index fcc4cc3d06..7ff71d2eb0 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/LineManager.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/LineManager.cs @@ -16,7 +16,6 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -using ICSharpCode.AvalonEdit.Utils; using System; using System.Collections.Generic; using System.Diagnostics; diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/NewLineFinder.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/NewLineFinder.cs index 4f4b206af6..07cb18a809 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/NewLineFinder.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/NewLineFinder.cs @@ -18,7 +18,9 @@ using System; using System.Text; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Document { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/OffsetChangeMap.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/OffsetChangeMap.cs index 8c7598c92b..5584392bb7 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/OffsetChangeMap.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/OffsetChangeMap.cs @@ -21,7 +21,9 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; using ICSharpCode.AvalonEdit.Utils; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Document { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/RopeTextSource.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/RopeTextSource.cs index 43ebcb413f..73a6f0b0c3 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/RopeTextSource.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/RopeTextSource.cs @@ -19,7 +19,9 @@ using System; using System.IO; using ICSharpCode.AvalonEdit.Utils; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Document { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/SimpleSegment.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/SimpleSegment.cs index 0c4adb8632..27c646e408 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/SimpleSegment.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/SimpleSegment.cs @@ -20,7 +20,9 @@ using System; using System.Diagnostics; using System.Globalization; using ICSharpCode.AvalonEdit.Utils; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Document { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextAnchor.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextAnchor.cs index 9571bd51e1..45bddde16c 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextAnchor.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextAnchor.cs @@ -20,6 +20,7 @@ using System; using ICSharpCode.AvalonEdit.Utils; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Editor; +using ICSharpCode.AvalonEdit.Document; namespace ICSharpCode.AvalonEdit.Document { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextAnchorTree.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextAnchorTree.cs index cc409c0340..5c285d47cf 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextAnchorTree.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextAnchorTree.cs @@ -21,7 +21,9 @@ using System.Collections.Generic; using System.Diagnostics; using System.Text; using ICSharpCode.AvalonEdit.Utils; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Document { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocument.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocument.cs index 83de7780c2..e7e02e0120 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocument.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocument.cs @@ -27,7 +27,6 @@ using System.Threading; using ICSharpCode.AvalonEdit.Utils; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Editor; -using ICSharpCode.NRefactory.Utils; namespace ICSharpCode.AvalonEdit.Document { @@ -133,8 +132,10 @@ namespace ICSharpCode.AvalonEdit.Document if (textSource == null) throw new ArgumentNullException("textSource"); + #if NREFACTORY if (textSource is ReadOnlyDocument) textSource = textSource.CreateSnapshot(); // retrieve underlying text source, which might be a RopeTextSource + #endif RopeTextSource rts = textSource as RopeTextSource; if (rts != null) @@ -362,11 +363,13 @@ namespace ICSharpCode.AvalonEdit.Document } } + #if NREFACTORY /// public IDocument CreateDocumentSnapshot() { return new ReadOnlyDocument(this, fileName); } + #endif /// public ITextSourceVersion Version { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocumentWeakEventManager.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocumentWeakEventManager.cs index d2a8335944..52d9c6fbc2 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocumentWeakEventManager.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocumentWeakEventManager.cs @@ -17,7 +17,9 @@ // DEALINGS IN THE SOFTWARE. using System; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif using ICSharpCode.AvalonEdit.Utils; namespace ICSharpCode.AvalonEdit.Document diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextLocation.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextLocation.cs new file mode 100644 index 0000000000..f2950e64a9 --- /dev/null +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextLocation.cs @@ -0,0 +1,271 @@ +// Copyright (c) 2010-2013 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.ComponentModel; +using System.Globalization; + +namespace ICSharpCode.AvalonEdit.Document +{ + #if !NREFACTORY + /// + /// A line/column position. + /// Text editor lines/columns are counted started from one. + /// + /// + /// The document provides the methods and + /// to convert between offsets and TextLocations. + /// + [Serializable] + [TypeConverter(typeof(TextLocationConverter))] + public struct TextLocation : IComparable, IEquatable + { + /// + /// Represents no text location (0, 0). + /// + public static readonly TextLocation Empty = new TextLocation(0, 0); + + /// + /// Creates a TextLocation instance. + /// + public TextLocation(int line, int column) + { + this.line = line; + this.column = column; + } + + readonly int column, line; + + /// + /// Gets the line number. + /// + public int Line { + get { return line; } + } + + /// + /// Gets the column number. + /// + public int Column { + get { return column; } + } + + /// + /// Gets whether the TextLocation instance is empty. + /// + public bool IsEmpty { + get { + return column <= 0 && line <= 0; + } + } + + /// + /// Gets a string representation for debugging purposes. + /// + public override string ToString() + { + return string.Format(CultureInfo.InvariantCulture, "(Line {1}, Col {0})", this.column, this.line); + } + + /// + /// Gets a hash code. + /// + public override int GetHashCode() + { + return unchecked (191 * column.GetHashCode() ^ line.GetHashCode()); + } + + /// + /// Equality test. + /// + public override bool Equals(object obj) + { + if (!(obj is TextLocation)) return false; + return (TextLocation)obj == this; + } + + /// + /// Equality test. + /// + public bool Equals(TextLocation other) + { + return this == other; + } + + /// + /// Equality test. + /// + public static bool operator ==(TextLocation left, TextLocation right) + { + return left.column == right.column && left.line == right.line; + } + + /// + /// Inequality test. + /// + public static bool operator !=(TextLocation left, TextLocation right) + { + return left.column != right.column || left.line != right.line; + } + + /// + /// Compares two text locations. + /// + public static bool operator <(TextLocation left, TextLocation right) + { + if (left.line < right.line) + return true; + else if (left.line == right.line) + return left.column < right.column; + else + return false; + } + + /// + /// Compares two text locations. + /// + public static bool operator >(TextLocation left, TextLocation right) + { + if (left.line > right.line) + return true; + else if (left.line == right.line) + return left.column > right.column; + else + return false; + } + + /// + /// Compares two text locations. + /// + public static bool operator <=(TextLocation left, TextLocation right) + { + return !(left > right); + } + + /// + /// Compares two text locations. + /// + public static bool operator >=(TextLocation left, TextLocation right) + { + return !(left < right); + } + + /// + /// Compares two text locations. + /// + public int CompareTo(TextLocation other) + { + if (this == other) + return 0; + if (this < other) + return -1; + else + return 1; + } + } + + /// + /// Converts strings of the form '0+[;,]0+' to a . + /// + public class TextLocationConverter : TypeConverter + { + /// + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); + } + + /// + public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) + { + return destinationType == typeof(TextLocation) || base.CanConvertTo(context, destinationType); + } + + /// + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + if (value is string) { + string[] parts = ((string)value).Split(';', ','); + if (parts.Length == 2) { + return new TextLocation(int.Parse(parts[0], culture), int.Parse(parts[1], culture)); + } + } + return base.ConvertFrom(context, culture, value); + } + + /// + public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + if (value is TextLocation && destinationType == typeof(string)) { + var loc = (TextLocation)value; + return loc.Line.ToString(culture) + ";" + loc.Column.ToString(culture); + } + return base.ConvertTo(context, culture, value, destinationType); + } + } + + /// + /// An (Offset,Length)-pair. + /// + public interface ISegment + { + /// + /// Gets the start offset of the segment. + /// + int Offset { get; } + + /// + /// Gets the length of the segment. + /// + /// For line segments (IDocumentLine), the length does not include the line delimeter. + int Length { get; } + + /// + /// Gets the end offset of the segment. + /// + /// EndOffset = Offset + Length; + int EndOffset { get; } + } + + /// + /// Extension methods for . + /// + public static class ISegmentExtensions + { + /// + /// Gets whether fully contains the specified segment. + /// + /// + /// Use segment.Contains(offset, 0) to detect whether a segment (end inclusive) contains offset; + /// use segment.Contains(offset, 1) to detect whether a segment (end exclusive) contains offset. + /// + public static bool Contains (this ISegment segment, int offset, int length) + { + return segment.Offset <= offset && offset + length <= segment.EndOffset; + } + + /// + /// Gets whether fully contains the specified segment. + /// + public static bool Contains (this ISegment thisSegment, ISegment segment) + { + return segment != null && thisSegment.Offset <= segment.Offset && segment.EndOffset <= thisSegment.EndOffset; + } + } + #endif +} diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSegment.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSegment.cs index 7a9090afa2..e0d8873c22 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSegment.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSegment.cs @@ -18,7 +18,9 @@ using System; using System.Diagnostics; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Document { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSegmentCollection.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSegmentCollection.cs index 96f7be86bb..88861db9f3 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSegmentCollection.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSegmentCollection.cs @@ -24,7 +24,9 @@ using System.Linq; using System.Text; using System.Windows; using ICSharpCode.AvalonEdit.Utils; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Document { @@ -47,7 +49,7 @@ namespace ICSharpCode.AvalonEdit.Document /// /// /// - public sealed class TextSegmentCollection : ICollection, IReadOnlyCollection, ISegmentTree, IWeakEventListener where T : TextSegment + public sealed class TextSegmentCollection : ICollection, ISegmentTree, IWeakEventListener where T : TextSegment { // Implementation: this is basically a mixture of an augmented interval tree // and the TextAnchorTree. diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSourceVersionProvider.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSourceVersionProvider.cs new file mode 100644 index 0000000000..c2dffc19ad --- /dev/null +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSourceVersionProvider.cs @@ -0,0 +1,136 @@ +// Copyright (c) 2014 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.Diagnostics; +using System.Linq; +using ICSharpCode.AvalonEdit.Utils; + +namespace ICSharpCode.AvalonEdit.Document +{ + #if !NREFACTORY + /// + /// Provides ITextSourceVersion instances. + /// + public class TextSourceVersionProvider + { + Version currentVersion; + + /// + /// Creates a new TextSourceVersionProvider instance. + /// + public TextSourceVersionProvider() + { + this.currentVersion = new Version(this); + } + + /// + /// Gets the current version. + /// + public ITextSourceVersion CurrentVersion { + get { return currentVersion; } + } + + /// + /// Replaces the current version with a new version. + /// + /// Change from current version to new version + public void AppendChange(TextChangeEventArgs change) + { + if (change == null) + throw new ArgumentNullException("change"); + currentVersion.change = change; + currentVersion.next = new Version(currentVersion); + currentVersion = currentVersion.next; + } + + [DebuggerDisplay("Version #{id}")] + sealed class Version : ITextSourceVersion + { + // Reference back to the provider. + // Used to determine if two checkpoints belong to the same document. + readonly TextSourceVersionProvider provider; + // ID used for CompareAge() + readonly int id; + + // the change from this version to the next version + internal TextChangeEventArgs change; + internal Version next; + + internal Version(TextSourceVersionProvider provider) + { + this.provider = provider; + } + + internal Version(Version prev) + { + this.provider = prev.provider; + this.id = unchecked( prev.id + 1 ); + } + + public bool BelongsToSameDocumentAs(ITextSourceVersion other) + { + Version o = other as Version; + return o != null && provider == o.provider; + } + + public int CompareAge(ITextSourceVersion other) + { + if (other == null) + throw new ArgumentNullException("other"); + Version o = other as Version; + if (o == null || provider != o.provider) + throw new ArgumentException("Versions do not belong to the same document."); + // We will allow overflows, but assume that the maximum distance between checkpoints is 2^31-1. + // This is guaranteed on x86 because so many checkpoints don't fit into memory. + return Math.Sign(unchecked( this.id - o.id )); + } + + public IEnumerable GetChangesTo(ITextSourceVersion other) + { + int result = CompareAge(other); + Version o = (Version)other; + if (result < 0) + return GetForwardChanges(o); + else if (result > 0) + return o.GetForwardChanges(this).Reverse().Select(change => change.Invert()); + else + return Empty.Array; + } + + IEnumerable GetForwardChanges(Version other) + { + // Return changes from this(inclusive) to other(exclusive). + for (Version node = this; node != other; node = node.next) { + yield return node.change; + } + } + + public int MoveOffsetTo(ITextSourceVersion other, int oldOffset, AnchorMovementType movement) + { + int offset = oldOffset; + foreach (var e in GetChangesTo(other)) { + offset = e.GetNewOffset(offset, movement); + } + return offset; + } + } + } + #endif +} diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextUtilities.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextUtilities.cs index 3dd0e647e7..2d6f757843 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextUtilities.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextUtilities.cs @@ -19,7 +19,9 @@ using System; using System.Globalization; using System.Windows.Documents; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Document { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Caret.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Caret.cs index badc106212..7f33289f1c 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Caret.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Caret.cs @@ -27,8 +27,10 @@ using System.Windows.Threading; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.AvalonEdit.Utils; +#if NREFACTORY using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Editing { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EditingCommandHandler.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EditingCommandHandler.cs index 247f03adff..91140970a5 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EditingCommandHandler.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EditingCommandHandler.cs @@ -29,7 +29,9 @@ using System.Windows.Input; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.AvalonEdit.Utils; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Editing { @@ -340,7 +342,6 @@ namespace ICSharpCode.AvalonEdit.Editing } catch (ExternalException) { // Apparently this exception sometimes happens randomly. // The MS controls just ignore it, so we'll do the same. - return false; } string text = textArea.Selection.GetText(); diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EmptySelection.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EmptySelection.cs index 2cef05f068..1f43206181 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EmptySelection.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EmptySelection.cs @@ -22,8 +22,10 @@ using System.Runtime.CompilerServices; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Utils; +#if NREFACTORY using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Editing { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/IReadOnlySectionProvider.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/IReadOnlySectionProvider.cs index daf8458b3c..5f37fc3668 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/IReadOnlySectionProvider.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/IReadOnlySectionProvider.cs @@ -18,7 +18,11 @@ using System; using System.Collections.Generic; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#else +using ICSharpCode.AvalonEdit.Document; +#endif namespace ICSharpCode.AvalonEdit.Editing { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/NoReadOnlySections.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/NoReadOnlySections.cs index 98ebf022f7..dbafa600f2 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/NoReadOnlySections.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/NoReadOnlySections.cs @@ -19,8 +19,9 @@ using System; using System.Collections.Generic; using System.Linq; -using ICSharpCode.AvalonEdit.Utils; +using ICSharpCode.AvalonEdit.Document; using ICSharpCode.NRefactory.Editor; +using ICSharpCode.AvalonEdit.Utils; namespace ICSharpCode.AvalonEdit.Editing { @@ -48,9 +49,9 @@ namespace ICSharpCode.AvalonEdit.Editing /// /// that completely disables editing. /// - sealed class ReadOnlyDocument : IReadOnlySectionProvider + sealed class ReadOnlySectionDocument : IReadOnlySectionProvider { - public static readonly ReadOnlyDocument Instance = new ReadOnlyDocument(); + public static readonly ReadOnlySectionDocument Instance = new ReadOnlySectionDocument(); public bool CanInsert(int offset) { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/RectangleSelection.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/RectangleSelection.cs index abaa80d797..8d6a991388 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/RectangleSelection.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/RectangleSelection.cs @@ -28,8 +28,10 @@ using System.Windows.Media.TextFormatting; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.AvalonEdit.Utils; +#if NREFACTORY using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Editing { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Selection.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Selection.cs index ba4034accf..b25a31b050 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Selection.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Selection.cs @@ -24,7 +24,9 @@ using System.Windows; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.AvalonEdit.Utils; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Editing { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SelectionColorizer.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SelectionColorizer.cs index 17c1c842ba..3c6be06c86 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SelectionColorizer.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SelectionColorizer.cs @@ -18,7 +18,9 @@ using System; using ICSharpCode.AvalonEdit.Rendering; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Editing { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SelectionMouseHandler.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SelectionMouseHandler.cs index 6fde39781d..dcb2f16149 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SelectionMouseHandler.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SelectionMouseHandler.cs @@ -29,7 +29,9 @@ using System.Windows.Threading; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.AvalonEdit.Utils; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Editing { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SelectionSegment.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SelectionSegment.cs index 8b258dc6e3..6c0b1e7a34 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SelectionSegment.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SelectionSegment.cs @@ -17,7 +17,11 @@ // DEALINGS IN THE SOFTWARE. using System; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#else +using ICSharpCode.AvalonEdit.Document; +#endif namespace ICSharpCode.AvalonEdit.Editing { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs index abbbe0b7cc..24f27825db 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs @@ -20,7 +20,9 @@ using System; using System.Collections.Generic; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Utils; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Editing { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs index d4eb99264a..11dcf3e70a 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs @@ -35,7 +35,6 @@ using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.AvalonEdit.Utils; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Editor; -using ICSharpCode.NRefactory.Utils; namespace ICSharpCode.AvalonEdit.Editing { @@ -1023,9 +1022,11 @@ namespace ICSharpCode.AvalonEdit.Editing this.MouseEnter += delegate { ShowMouseCursor(); }; this.MouseLeave += delegate { ShowMouseCursor(); }; this.PreviewMouseMove += delegate { ShowMouseCursor(); }; + #if DOTNET4 this.TouchEnter += delegate { ShowMouseCursor(); }; this.TouchLeave += delegate { ShowMouseCursor(); }; this.PreviewTouchMove += delegate { ShowMouseCursor(); }; + #endif } void ShowMouseCursor() diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextSegmentReadOnlySectionProvider.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextSegmentReadOnlySectionProvider.cs index 09c50f8ab8..fb26624710 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextSegmentReadOnlySectionProvider.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextSegmentReadOnlySectionProvider.cs @@ -19,7 +19,9 @@ using System; using System.Collections.Generic; using ICSharpCode.AvalonEdit.Document; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif namespace ICSharpCode.AvalonEdit.Editing { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/FoldingSection.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/FoldingSection.cs index 78791398d4..c84a962f8e 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/FoldingSection.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/FoldingSection.cs @@ -19,7 +19,9 @@ using System; using System.Diagnostics; using System.Text; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#endif using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.AvalonEdit.Utils; diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/NewFolding.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/NewFolding.cs index 0491ace072..5e6205a508 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/NewFolding.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/NewFolding.cs @@ -17,7 +17,11 @@ // DEALINGS IN THE SOFTWARE. using System; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#else +using ICSharpCode.AvalonEdit.Document; +#endif namespace ICSharpCode.AvalonEdit.Folding { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/DocumentHighlighter.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/DocumentHighlighter.cs index 96afdbfcda..8ba6c044c8 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/DocumentHighlighter.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/DocumentHighlighter.cs @@ -20,12 +20,10 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using System.Text.RegularExpressions; +using ICSharpCode.NRefactory.Editor; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Utils; -using ICSharpCode.NRefactory.Editor; -using ICSharpCode.NRefactory.Utils; -using SpanStack = ICSharpCode.NRefactory.Utils.ImmutableStack; +using SpanStack = ICSharpCode.AvalonEdit.Utils.ImmutableStack; namespace ICSharpCode.AvalonEdit.Highlighting { @@ -74,6 +72,7 @@ namespace ICSharpCode.AvalonEdit.Highlighting InvalidateHighlighting(); } + #if NREFACTORY /// /// Creates a new DocumentHighlighter instance. /// @@ -88,6 +87,7 @@ namespace ICSharpCode.AvalonEdit.Highlighting this.engine = new HighlightingEngine(definition.MainRuleSet); InvalidateHighlighting(); } + #endif /// /// Disposes the document highlighter. diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedInlineBuilder.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedInlineBuilder.cs index c48a97bc9f..e5f2e24bba 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedInlineBuilder.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedInlineBuilder.cs @@ -24,7 +24,7 @@ using System.Text; using System.Windows; using System.Windows.Documents; using System.Windows.Media; -using ICSharpCode.NRefactory.TypeSystem.Implementation; +using ICSharpCode.AvalonEdit.Utils; namespace ICSharpCode.AvalonEdit.Highlighting { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedLine.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedLine.cs index 0d42809431..55842a1d8e 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedLine.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedLine.cs @@ -18,7 +18,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedSection.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedSection.cs index b42abb43f3..f1ffdfd9ea 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedSection.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedSection.cs @@ -17,7 +17,11 @@ // DEALINGS IN THE SOFTWARE. using System; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#else +using ICSharpCode.AvalonEdit.Document; +#endif namespace ICSharpCode.AvalonEdit.Highlighting { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingColor.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingColor.cs index 067e75693c..f8f13182a7 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingColor.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingColor.cs @@ -23,8 +23,7 @@ using System.Security.Permissions; using System.Text; using System.Windows; using System.Windows.Media; -using ICSharpCode.NRefactory.TypeSystem; -using ICSharpCode.NRefactory.TypeSystem.Implementation; +using ICSharpCode.AvalonEdit.Utils; namespace ICSharpCode.AvalonEdit.Highlighting { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingColorizer.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingColorizer.cs index 1754d3d4b0..68a625745e 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingColorizer.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingColorizer.cs @@ -289,7 +289,7 @@ namespace ICSharpCode.AvalonEdit.Highlighting // If the highlighting state change applies to the lines below, too, the construction of each line // will invalidate the next line, and the construction pass will regenerate all lines. - Debug.WriteLine("OnHighlightStateChanged forces redraw of lines {0} to {1}", fromLineNumber, toLineNumber); + Debug.WriteLine(string.Format("OnHighlightStateChanged forces redraw of lines {0} to {1}", fromLineNumber, toLineNumber)); // If the VisualLine construction is in progress, we have to avoid sending redraw commands for // anything above the line currently being constructed. diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingEngine.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingEngine.cs index b80d9ac9a3..e08753130d 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingEngine.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingEngine.cs @@ -21,9 +21,13 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text.RegularExpressions; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#else +using ICSharpCode.AvalonEdit.Document; +#endif using ICSharpCode.AvalonEdit.Utils; -using SpanStack = ICSharpCode.NRefactory.Utils.ImmutableStack; +using SpanStack = ICSharpCode.AvalonEdit.Utils.ImmutableStack; namespace ICSharpCode.AvalonEdit.Highlighting { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingManager.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingManager.cs index 37b666b7b7..c9ea32f074 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingManager.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingManager.cs @@ -22,8 +22,7 @@ using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Xml; - -using ICSharpCode.NRefactory.Utils; +using ICSharpCode.AvalonEdit.Utils; namespace ICSharpCode.AvalonEdit.Highlighting { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HtmlClipboard.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HtmlClipboard.cs index 68eba79c3e..eb0afc0c24 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HtmlClipboard.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HtmlClipboard.cs @@ -19,7 +19,6 @@ using System; using System.Diagnostics; using System.Globalization; -using System.IO; using System.Text; using System.Windows; using ICSharpCode.AvalonEdit.Document; diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HtmlOptions.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HtmlOptions.cs index c3458a7015..13c76c2415 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HtmlOptions.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HtmlOptions.cs @@ -18,7 +18,11 @@ using System; using System.IO; +#if DOTNET4 using System.Net; +#else +using System.Web; +#endif namespace ICSharpCode.AvalonEdit.Highlighting { @@ -60,7 +64,11 @@ namespace ICSharpCode.AvalonEdit.Highlighting if (color == null) throw new ArgumentNullException("color"); writer.Write(" style=\""); + #if DOTNET4 WebUtility.HtmlEncode(color.ToCss(), writer); + #else + HttpUtility.HtmlEncode(color.ToCss(), writer); + #endif writer.Write('"'); } diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HtmlRichTextWriter.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HtmlRichTextWriter.cs index d1ec19709a..b29d452a3d 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HtmlRichTextWriter.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HtmlRichTextWriter.cs @@ -19,7 +19,11 @@ using System; using System.Collections.Generic; using System.IO; +#if DOTNET4 using System.Net; +#else +using System.Web; +#endif using System.Text; using System.Windows; using System.Windows.Media; @@ -132,7 +136,11 @@ namespace ICSharpCode.AvalonEdit.Highlighting needIndentation = true; break; default: + #if DOTNET4 WebUtility.HtmlEncode(c.ToString(), htmlWriter); + #else + HttpUtility.HtmlEncode(c.ToString(), htmlWriter); + #endif break; } // If we just handled a space by setting hasSpace = true, @@ -173,7 +181,11 @@ namespace ICSharpCode.AvalonEdit.Highlighting if (value.Length == 0) return; WriteIndentationAndSpace(); + #if DOTNET4 WebUtility.HtmlEncode(value, htmlWriter); + #else + HttpUtility.HtmlEncode(value, htmlWriter); + #endif } /// @@ -244,7 +256,12 @@ namespace ICSharpCode.AvalonEdit.Highlighting public override void BeginHyperlinkSpan(Uri uri) { WriteIndentationAndSpace(); - htmlWriter.Write(""); + #if DOTNET4 + string link = WebUtility.HtmlEncode(uri.ToString()); + #else + string link = HttpUtility.HtmlEncode(uri.ToString()); + #endif + htmlWriter.Write(""); endTagStack.Push(""); } } diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/IHighlighter.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/IHighlighter.cs index 8edbd89061..66702adf92 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/IHighlighter.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/IHighlighter.cs @@ -18,7 +18,11 @@ using System; using System.Collections.Generic; +#if NREFACTORY using ICSharpCode.NRefactory.Editor; +#else +using ICSharpCode.AvalonEdit.Document; +#endif namespace ICSharpCode.AvalonEdit.Highlighting { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/RichTextModel.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/RichTextModel.cs index b41012bee0..10c018e98e 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/RichTextModel.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/RichTextModel.cs @@ -17,24 +17,20 @@ // DEALINGS IN THE SOFTWARE. using System; -using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Windows; using System.Windows.Documents; -using System.Windows.Media; -using ICSharpCode.NRefactory.Editor; -using ICSharpCode.NRefactory.TypeSystem.Implementation; using ICSharpCode.AvalonEdit.Document; -using ICSharpCode.AvalonEdit.Utils; +using ICSharpCode.NRefactory.Editor; namespace ICSharpCode.AvalonEdit.Highlighting { /// /// Stores rich-text formatting. /// - public sealed class RichTextModel : AbstractFreezable + public sealed class RichTextModel { List stateChangeOffsets = new List(); List stateChanges = new List(); diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/RichTextModelWriter.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/RichTextModelWriter.cs index c965343be7..66c455e269 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/RichTextModelWriter.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/RichTextModelWriter.cs @@ -18,8 +18,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; -using System.IO; using System.Windows; using System.Windows.Media; using ICSharpCode.NRefactory.Editor; diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj index ff6cf09d56..df226bd6bd 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj @@ -3,52 +3,73 @@ {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1} Debug - AnyCPU + Net40 Library ICSharpCode.AvalonEdit ICSharpCode.AvalonEdit - v4.5 Properties - "C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\Misc\SourceAnalysis\Settings.SourceAnalysis" False False 4 - false + False True ICSharpCode.AvalonEdit.snk False File False -Microsoft.Design#CA1020;-Microsoft.Design#CA1033;-Microsoft.Performance#CA1805;-Microsoft.Performance#CA1810 - ..\..\..\..\bin\ - ..\..\..\..\bin\ICSharpCode.AvalonEdit.xml 1607 + False + obj\$(Configuration)\ + False + Auto + 4194304 + AnyCPU + 4096 + + + v3.5 + + + v4.0 + DOTNET4 + + + v4.5 + DOTNET4;NREFACTORY + ..\..\NRefactory\ICSharpCode.NRefactory.snk + bin\Debug\ + bin\Debug\ICSharpCode.AvalonEdit.xml true - Full False True - DEBUG;TRACE;DOTNET4 + obj\ + Full + + + bin\Release\ + bin\Release\ICSharpCode.AvalonEdit.xml false - PdbOnly True False - TRACE;DOTNET4 - - - False - Auto - 4194304 - AnyCPU - 4096 + Full + + + {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} + ICSharpCode.NRefactory + + + 4.0 + 3.0 @@ -67,6 +88,7 @@ 3.0 + 4.0 @@ -86,9 +108,6 @@ - - Properties\GlobalAssemblyInfo.cs - @@ -97,7 +116,6 @@ Code - @@ -106,7 +124,10 @@ UndoStack.cs + + + @@ -120,6 +141,7 @@ TextDocument.cs + @@ -129,6 +151,7 @@ TextAnchor.cs + UndoStack.cs @@ -355,6 +378,7 @@ + @@ -364,6 +388,8 @@ + + @@ -412,51 +438,10 @@ - - - {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} - ICSharpCode.Core - false - - - {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} - ICSharpCode.NRefactory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Indentation/DefaultIndentationStrategy.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Indentation/DefaultIndentationStrategy.cs index b84853ab7d..2ac7c2e485 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Indentation/DefaultIndentationStrategy.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Indentation/DefaultIndentationStrategy.cs @@ -17,8 +17,8 @@ // DEALINGS IN THE SOFTWARE. using System; -using ICSharpCode.AvalonEdit.Document; using ICSharpCode.NRefactory.Editor; +using ICSharpCode.AvalonEdit.Document; namespace ICSharpCode.AvalonEdit.Indentation { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Properties/AssemblyInfo.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Properties/AssemblyInfo.cs index 1d9f84ff64..21160ccbc5 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Properties/AssemblyInfo.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Properties/AssemblyInfo.cs @@ -50,6 +50,13 @@ using System.Windows.Markup; // app, or any theme specific resource dictionaries) )] +[assembly: System.Runtime.InteropServices.ComVisible(false)] +[assembly: AssemblyCompany("ic#code")] +[assembly: AssemblyProduct("SharpDevelop")] +[assembly: AssemblyCopyright("2000-2014 AlphaSierraPapa for the SharpDevelop Team")] +[assembly: AssemblyVersion("5.0.1")] +[assembly: NeutralResourcesLanguage("en-US")] + [assembly: XmlnsPrefix("http://icsharpcode.net/sharpdevelop/avalonedit", "avalonedit")] [assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/avalonedit", "ICSharpCode.AvalonEdit")] @@ -57,3 +64,8 @@ using System.Windows.Markup; [assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/avalonedit", "ICSharpCode.AvalonEdit.Rendering")] [assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/avalonedit", "ICSharpCode.AvalonEdit.Highlighting")] [assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/avalonedit", "ICSharpCode.AvalonEdit.Search")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly", + Justification = "AssemblyInformationalVersion does not need to be a parsable version")] + +namespace ICSharpCode.NRefactory.Editor {} diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/BackgroundGeometryBuilder.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/BackgroundGeometryBuilder.cs index cde47d1ef1..73f135cfe3 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/BackgroundGeometryBuilder.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/BackgroundGeometryBuilder.cs @@ -23,9 +23,10 @@ using System.Windows; using System.Windows.Controls.Primitives; using System.Windows.Media; using System.Windows.Media.TextFormatting; +using ICSharpCode.NRefactory.Editor; +using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Editing; using ICSharpCode.AvalonEdit.Utils; -using ICSharpCode.NRefactory.Editor; namespace ICSharpCode.AvalonEdit.Rendering { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextView.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextView.cs index 2871c38fe4..516c0a4623 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextView.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextView.cs @@ -31,10 +31,9 @@ using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.TextFormatting; using System.Windows.Threading; +using ICSharpCode.NRefactory.Editor; using ICSharpCode.AvalonEdit.Document; -using ICSharpCode.AvalonEdit.Editing; using ICSharpCode.AvalonEdit.Utils; -using ICSharpCode.NRefactory.Editor; namespace ICSharpCode.AvalonEdit.Rendering { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/DropDownButton.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/DropDownButton.cs index cf7d5d1c35..31cb5f9963 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/DropDownButton.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/DropDownButton.cs @@ -18,26 +18,33 @@ using System; using System.Windows; -using System.Windows.Controls; using System.Windows.Controls.Primitives; -using System.Windows.Input; namespace ICSharpCode.AvalonEdit.Search { /// /// A button that opens a drop-down menu when clicked. /// - class DropDownButton : ButtonBase + public class DropDownButton : ButtonBase { + /// + /// Identifies the  dependency property. + /// public static readonly DependencyProperty DropDownContentProperty - = DependencyProperty.Register("DropDownContent", typeof(Popup), - typeof(DropDownButton), new FrameworkPropertyMetadata(null)); + = DependencyProperty.Register("DropDownContent", typeof(Popup), + typeof(DropDownButton), new FrameworkPropertyMetadata(null)); + /// + /// The key that identifies the  dependency property. + /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] protected static readonly DependencyPropertyKey IsDropDownContentOpenPropertyKey - = DependencyProperty.RegisterReadOnly("IsDropDownContentOpen", typeof(bool), - typeof(DropDownButton), new FrameworkPropertyMetadata(false)); + = DependencyProperty.RegisterReadOnly("IsDropDownContentOpen", typeof(bool), + typeof(DropDownButton), new FrameworkPropertyMetadata(false)); + /// + /// Identifies the  dependency property. + /// public static readonly DependencyProperty IsDropDownContentOpenProperty = IsDropDownContentOpenPropertyKey.DependencyProperty; static DropDownButton() @@ -45,16 +52,23 @@ namespace ICSharpCode.AvalonEdit.Search DefaultStyleKeyProperty.OverrideMetadata(typeof(DropDownButton), new FrameworkPropertyMetadata(typeof(DropDownButton))); } + /// + /// Gets/Sets the popup that is used as drop-down content. + /// public Popup DropDownContent { get { return (Popup)GetValue(DropDownContentProperty); } set { SetValue(DropDownContentProperty, value); } } + /// + /// Gets whether the drop-down is opened. + /// public bool IsDropDownContentOpen { get { return (bool)GetValue(IsDropDownContentOpenProperty); } protected set { SetValue(IsDropDownContentOpenPropertyKey, value); } } + /// protected override void OnClick() { if (DropDownContent != null && !IsDropDownContentOpen) { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs index 77f80fc33d..9121a454ad 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs @@ -19,8 +19,8 @@ using System; using System.Collections.Generic; using System.Runtime.Serialization; - using ICSharpCode.NRefactory.Editor; +using ICSharpCode.AvalonEdit.Document; namespace ICSharpCode.AvalonEdit.Search { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/RegexSearchStrategy.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/RegexSearchStrategy.cs index 44bf6d22d1..47bde5af07 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/RegexSearchStrategy.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/RegexSearchStrategy.cs @@ -22,7 +22,6 @@ using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Windows.Documents; - using ICSharpCode.AvalonEdit.Document; using ICSharpCode.NRefactory.Editor; diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/SearchCommands.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/SearchCommands.cs index b4444e331d..03057f3321 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/SearchCommands.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/SearchCommands.cs @@ -86,9 +86,9 @@ namespace ICSharpCode.AvalonEdit.Search void RegisterCommands(ICollection commandBindings) { commandBindings.Add(new CommandBinding(ApplicationCommands.Find, ExecuteFind)); - commandBindings.Add(new CommandBinding(SearchCommands.FindNext, ExecuteFindNext)); - commandBindings.Add(new CommandBinding(SearchCommands.FindPrevious, ExecuteFindPrevious)); - commandBindings.Add(new CommandBinding(SearchCommands.CloseSearchPanel, ExecuteCloseSearchPanel)); + commandBindings.Add(new CommandBinding(SearchCommands.FindNext, ExecuteFindNext, CanExecuteWithOpenSearchPanel)); + commandBindings.Add(new CommandBinding(SearchCommands.FindPrevious, ExecuteFindPrevious, CanExecuteWithOpenSearchPanel)); + commandBindings.Add(new CommandBinding(SearchCommands.CloseSearchPanel, ExecuteCloseSearchPanel, CanExecuteWithOpenSearchPanel)); } SearchPanel panel; @@ -100,20 +100,41 @@ namespace ICSharpCode.AvalonEdit.Search panel.SearchPattern = TextArea.Selection.GetText(); Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Input, (Action)delegate { panel.Reactivate(); }); } + + void CanExecuteWithOpenSearchPanel(object sender, CanExecuteRoutedEventArgs e) + { + if (panel.IsClosed) { + e.CanExecute = false; + // Continue routing so that the key gesture can be consumed by another component. + e.ContinueRouting = true; + } else { + e.CanExecute = true; + e.Handled = true; + } + } void ExecuteFindNext(object sender, ExecutedRoutedEventArgs e) { - panel.FindNext(); + if (!panel.IsClosed) { + panel.FindNext(); + e.Handled = true; + } } void ExecuteFindPrevious(object sender, ExecutedRoutedEventArgs e) { - panel.FindPrevious(); + if (!panel.IsClosed) { + panel.FindPrevious(); + e.Handled = true; + } } void ExecuteCloseSearchPanel(object sender, ExecutedRoutedEventArgs e) { - panel.Close(); + if (!panel.IsClosed) { + panel.Close(); + e.Handled = true; + } } /// diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/IActiveElement.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/IActiveElement.cs index 02466ce7a6..1c566d7c5c 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/IActiveElement.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/IActiveElement.cs @@ -18,6 +18,7 @@ using System; using ICSharpCode.NRefactory.Editor; +using ICSharpCode.AvalonEdit.Document; namespace ICSharpCode.AvalonEdit.Snippets { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/InsertionContext.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/InsertionContext.cs index 3130a97ca1..17438c6af4 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/InsertionContext.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/InsertionContext.cs @@ -19,9 +19,9 @@ using System; using System.Collections.Generic; using System.Windows; +using ICSharpCode.NRefactory.Editor; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Editing; -using ICSharpCode.NRefactory.Editor; namespace ICSharpCode.AvalonEdit.Snippets { @@ -70,7 +70,7 @@ namespace ICSharpCode.AvalonEdit.Snippets /// /// Gets the text document. /// - public TextDocument Document { get; private set; } + public ICSharpCode.AvalonEdit.Document.TextDocument Document { get; private set; } /// /// Gets the text that was selected before the insertion of the snippet. @@ -98,7 +98,7 @@ namespace ICSharpCode.AvalonEdit.Snippets public int InsertionPosition { get; set; } readonly int startPosition; - AnchorSegment wholeSnippetAnchor; + ICSharpCode.AvalonEdit.Document.AnchorSegment wholeSnippetAnchor; bool deactivateIfSnippetEmpty; /// diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/Snippet.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/Snippet.cs index 619e7c2f39..ebc2771bfc 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/Snippet.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/Snippet.cs @@ -17,9 +17,9 @@ // DEALINGS IN THE SOFTWARE. using System; +using ICSharpCode.NRefactory.Editor; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Editing; -using ICSharpCode.NRefactory.Editor; namespace ICSharpCode.AvalonEdit.Snippets { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/SnippetCaretElement.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/SnippetCaretElement.cs index f3efd15adc..0fd8ac05de 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/SnippetCaretElement.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/SnippetCaretElement.cs @@ -18,9 +18,8 @@ using System; using System.Runtime.Serialization; -using System.Windows.Input; -using ICSharpCode.AvalonEdit.Document; using ICSharpCode.NRefactory.Editor; +using ICSharpCode.AvalonEdit.Document; namespace ICSharpCode.AvalonEdit.Snippets { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/SnippetReplaceableTextElement.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/SnippetReplaceableTextElement.cs index 65af6935e2..e07b2843b7 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/SnippetReplaceableTextElement.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/SnippetReplaceableTextElement.cs @@ -21,9 +21,9 @@ using System.Linq; using System.Windows; using System.Windows.Documents; using System.Windows.Media; +using ICSharpCode.NRefactory.Editor; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Rendering; -using ICSharpCode.NRefactory.Editor; namespace ICSharpCode.AvalonEdit.Snippets { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditor.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditor.cs index a69bd2e831..91e183d46d 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditor.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditor.cs @@ -408,7 +408,7 @@ namespace ICSharpCode.AvalonEdit TextEditor editor = d as TextEditor; if (editor != null) { if ((bool)e.NewValue) - editor.TextArea.ReadOnlySectionProvider = ReadOnlyDocument.Instance; + editor.TextArea.ReadOnlySectionProvider = ReadOnlySectionDocument.Instance; else editor.TextArea.ReadOnlySectionProvider = NoReadOnlySections.Instance; @@ -905,7 +905,7 @@ namespace ICSharpCode.AvalonEdit if (start < 0 || start > documentLength) throw new ArgumentOutOfRangeException("start", start, "Value must be between 0 and " + documentLength); if (length < 0 || start + length > documentLength) - throw new ArgumentOutOfRangeException("length", length, "Value must be between 0 and " + (documentLength - length)); + throw new ArgumentOutOfRangeException("length", length, "Value must be between 0 and " + (documentLength - start)); textArea.Selection = SimpleSelection.Create(textArea, start, start + length); textArea.Caret.Offset = start + length; } @@ -944,9 +944,9 @@ namespace ICSharpCode.AvalonEdit { using (StreamReader reader = FileReader.OpenStream(stream, this.Encoding ?? Encoding.UTF8)) { this.Text = reader.ReadToEnd(); - this.Encoding = reader.CurrentEncoding; // assign encoding after ReadToEnd() so that the StreamReader can autodetect the encoding + SetCurrentValue(EncodingProperty, reader.CurrentEncoding); // assign encoding after ReadToEnd() so that the StreamReader can autodetect the encoding } - this.IsModified = false; + SetCurrentValue(IsModifiedProperty, Boxes.False); } /// @@ -997,7 +997,7 @@ namespace ICSharpCode.AvalonEdit document.WriteTextTo(writer); writer.Flush(); // do not close the stream - this.IsModified = false; + SetCurrentValue(IsModifiedProperty, Boxes.False); } /// diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextViewPosition.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextViewPosition.cs index 635e116277..3fcbfbf5fa 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextViewPosition.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextViewPosition.cs @@ -19,6 +19,7 @@ using System; using System.Globalization; using ICSharpCode.NRefactory; +using ICSharpCode.AvalonEdit.Document; namespace ICSharpCode.AvalonEdit { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/CallbackOnDispose.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/CallbackOnDispose.cs new file mode 100644 index 0000000000..ffcc717c11 --- /dev/null +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/CallbackOnDispose.cs @@ -0,0 +1,101 @@ +// Copyright (c) 2014 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.Threading; + +namespace ICSharpCode.AvalonEdit.Utils +{ + /// + /// Invokes an action when it is disposed. + /// + /// + /// This class ensures the callback is invoked at most once, + /// even when Dispose is called on multiple threads. + /// + sealed class CallbackOnDispose : IDisposable + { + Action action; + + public CallbackOnDispose(Action action) + { + if (action == null) + throw new ArgumentNullException("action"); + this.action = action; + } + + public void Dispose() + { + Action a = Interlocked.Exchange(ref action, null); + if (a != null) { + a(); + } + } + } + + /// + /// This class is used to prevent stack overflows by representing a 'busy' flag + /// that prevents reentrance when another call is running. + /// However, using a simple 'bool busy' is not thread-safe, so we use a + /// thread-static BusyManager. + /// + static class BusyManager + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", + Justification = "Should always be used with 'var'")] + public struct BusyLock : IDisposable + { + public static readonly BusyLock Failed = new BusyLock(null); + + readonly List objectList; + + internal BusyLock(List objectList) + { + this.objectList = objectList; + } + + public bool Success { + get { return objectList != null; } + } + + public void Dispose() + { + if (objectList != null) { + objectList.RemoveAt(objectList.Count - 1); + } + } + } + + [ThreadStatic] static List _activeObjects; + + public static BusyLock Enter(object obj) + { + List activeObjects = _activeObjects; + if (activeObjects == null) + activeObjects = _activeObjects = new List(); + for (int i = 0; i < activeObjects.Count; i++) { + if (activeObjects[i] == obj) + return BusyLock.Failed; + } + activeObjects.Add(obj); + return new BusyLock(activeObjects); + } + } +} diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/Deque.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/Deque.cs index 964c6833db..d67a6b17b2 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/Deque.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/Deque.cs @@ -27,7 +27,7 @@ namespace ICSharpCode.AvalonEdit.Utils /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] [Serializable] - public sealed class Deque : ICollection, IReadOnlyCollection + public sealed class Deque : ICollection { T[] arr = Empty.Array; int size, head, tail; diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/DocumentPrinter.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/DocumentPrinter.cs index f92e36d649..49d3abc79a 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/DocumentPrinter.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/DocumentPrinter.cs @@ -18,17 +18,12 @@ using System; using System.Collections.Generic; -using System.IO; -using System.IO.Packaging; -using System.Printing; using System.Windows; -using System.Windows.Controls; using System.Windows.Documents; -using System.Windows.Xps; +using ICSharpCode.NRefactory.Editor; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Highlighting; -using ICSharpCode.NRefactory.Editor; namespace ICSharpCode.AvalonEdit.Utils { @@ -37,6 +32,7 @@ namespace ICSharpCode.AvalonEdit.Utils /// public static class DocumentPrinter { + #if NREFACTORY /// /// Converts a readonly TextDocument to a Block and applies the provided highlighting definition. /// @@ -49,6 +45,7 @@ namespace ICSharpCode.AvalonEdit.Utils highlighter = null; return ConvertTextDocumentToBlock(document, highlighter); } + #endif /// /// Converts an IDocument to a Block and applies the provided highlighter. @@ -73,6 +70,7 @@ namespace ICSharpCode.AvalonEdit.Utils return p; } + #if NREFACTORY /// /// Converts a readonly TextDocument to a RichText and applies the provided highlighting definition. /// @@ -85,6 +83,7 @@ namespace ICSharpCode.AvalonEdit.Utils highlighter = null; return ConvertTextDocumentToRichText(document, highlighter); } + #endif /// /// Converts an IDocument to a RichText and applies the provided highlighter. diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/IFreezable.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/IFreezable.cs new file mode 100644 index 0000000000..1529e29428 --- /dev/null +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/IFreezable.cs @@ -0,0 +1,123 @@ +// Copyright (c) 2014 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.Collections.ObjectModel; +using System.Linq; + +namespace ICSharpCode.AvalonEdit.Utils +{ + interface IFreezable + { + /// + /// Gets if this instance is frozen. Frozen instances are immutable and thus thread-safe. + /// + bool IsFrozen { get; } + + /// + /// Freezes this instance. + /// + void Freeze(); + } + + static class FreezableHelper + { + public static void ThrowIfFrozen(IFreezable freezable) + { + if (freezable.IsFrozen) + throw new InvalidOperationException("Cannot mutate frozen " + freezable.GetType().Name); + } + + public static IList FreezeListAndElements(IList list) + { + if (list != null) { + foreach (T item in list) + Freeze(item); + } + return FreezeList(list); + } + + public static IList FreezeList(IList list) + { + if (list == null || list.Count == 0) + return Empty.Array; + if (list.IsReadOnly) { + // If the list is already read-only, return it directly. + // This is important, otherwise we might undo the effects of interning. + return list; + } else { + return new ReadOnlyCollection(list.ToArray()); + } + } + + public static void Freeze(object item) + { + IFreezable f = item as IFreezable; + if (f != null) + f.Freeze(); + } + + public static T FreezeAndReturn(T item) where T : IFreezable + { + item.Freeze(); + return item; + } + + /// + /// If the item is not frozen, this method creates and returns a frozen clone. + /// If the item is already frozen, it is returned without creating a clone. + /// + public static T GetFrozenClone(T item) where T : IFreezable, ICloneable + { + if (!item.IsFrozen) { + item = (T)item.Clone(); + item.Freeze(); + } + return item; + } + } + + [Serializable] + abstract class AbstractFreezable : IFreezable + { + bool isFrozen; + + /// + /// Gets if this instance is frozen. Frozen instances are immutable and thus thread-safe. + /// + public bool IsFrozen { + get { return isFrozen; } + } + + /// + /// Freezes this instance. + /// + public void Freeze() + { + if (!isFrozen) { + FreezeInternal(); + isFrozen = true; + } + } + + protected virtual void FreezeInternal() + { + } + } +} \ No newline at end of file diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/ImmutableStack.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/ImmutableStack.cs new file mode 100644 index 0000000000..17e717d283 --- /dev/null +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/ImmutableStack.cs @@ -0,0 +1,132 @@ +// Copyright (c) 2014 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.Diagnostics; +using System.Text; + +namespace ICSharpCode.AvalonEdit.Utils +{ + /// + /// An immutable stack. + /// + /// Using 'foreach' on the stack will return the items from top to bottom (in the order they would be popped). + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] + [Serializable] + public sealed class ImmutableStack : IEnumerable + { + /// + /// Gets the empty stack instance. + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "ImmutableStack is immutable")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes")] + public static readonly ImmutableStack Empty = new ImmutableStack(); + + readonly T value; + readonly ImmutableStack next; + + private ImmutableStack() + { + } + + private ImmutableStack(T value, ImmutableStack next) + { + this.value = value; + this.next = next; + } + + /// + /// Pushes an item on the stack. This does not modify the stack itself, but returns a new + /// one with the value pushed. + /// + public ImmutableStack Push(T item) + { + return new ImmutableStack(item, this); + } + + /// + /// Gets the item on the top of the stack. + /// + /// The stack is empty. + public T Peek() + { + if (IsEmpty) + throw new InvalidOperationException("Operation not valid on empty stack."); + return value; + } + + /// + /// Gets the item on the top of the stack. + /// Returns default(T) if the stack is empty. + /// + public T PeekOrDefault() + { + return value; + } + + /// + /// Gets the stack with the top item removed. + /// + /// The stack is empty. + public ImmutableStack Pop() + { + if (IsEmpty) + throw new InvalidOperationException("Operation not valid on empty stack."); + return next; + } + + /// + /// Gets if this stack is empty. + /// + public bool IsEmpty { + get { return next == null; } + } + + /// + /// Gets an enumerator that iterates through the stack top-to-bottom. + /// + public IEnumerator GetEnumerator() + { + ImmutableStack t = this; + while (!t.IsEmpty) { + yield return t.value; + t = t.next; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return this.GetEnumerator(); + } + + /// + public override string ToString() + { + StringBuilder b = new StringBuilder("[Stack"); + foreach (T val in this) { + b.Append(' '); + b.Append(val); + } + b.Append(']'); + return b.ToString(); + } + } +} \ No newline at end of file diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/Rope.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/Rope.cs index e45df86b55..2e489c2369 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/Rope.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/Rope.cs @@ -23,7 +23,6 @@ using System.Diagnostics; using System.Globalization; using System.Runtime.Serialization; using System.Text; -using ICSharpCode.NRefactory.Utils; namespace ICSharpCode.AvalonEdit.Utils { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/AccessToClosureIssues/AccessToDisposedClosureIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/AccessToClosureIssues/AccessToDisposedClosureIssue.cs index bc48a268ad..6af6c855fb 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/AccessToClosureIssues/AccessToDisposedClosureIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/AccessToClosureIssues/AccessToDisposedClosureIssue.cs @@ -32,12 +32,12 @@ using ICSharpCode.NRefactory.Refactoring; namespace ICSharpCode.NRefactory.CSharp.Refactoring { - [IssueDescription ("Access to disposed closure variable", - Description = "Access to closure variable from anonymous method when the variable is" + - " disposed externally", - Category = IssueCategories.CodeQualityIssues, - Severity = Severity.Warning, - AnalysisDisableKeyword = "AccessToDisposedClosure")] +// [IssueDescription ("Access to disposed closure variable", +// Description = "Access to closure variable from anonymous method when the variable is" + +// " disposed externally", +// Category = IssueCategories.CodeQualityIssues, +// Severity = Severity.Warning, +// AnalysisDisableKeyword = "AccessToDisposedClosure")] public class AccessToDisposedClosureIssue : AccessToClosureIssue { public AccessToDisposedClosureIssue () diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/AccessToClosureIssues/AccessToModifiedClosureIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/AccessToClosureIssues/AccessToModifiedClosureIssue.cs index 1f6b0df694..94f6f3ad87 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/AccessToClosureIssues/AccessToModifiedClosureIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/AccessToClosureIssues/AccessToModifiedClosureIssue.cs @@ -31,12 +31,12 @@ using ICSharpCode.NRefactory.Refactoring; namespace ICSharpCode.NRefactory.CSharp.Refactoring { - [IssueDescription("Access to modified closure variable", - Description = "Access to closure variable from anonymous method when the variable is modified " + - "externally", - Category = IssueCategories.CodeQualityIssues, - Severity = Severity.Warning, - AnalysisDisableKeyword = "AccessToModifiedClosure")] +// [IssueDescription("Access to modified closure variable", +// Description = "Access to closure variable from anonymous method when the variable is modified " + +// "externally", +// Category = IssueCategories.CodeQualityIssues, +// Severity = Severity.Warning, +// AnalysisDisableKeyword = "AccessToModifiedClosure")] public class AccessToModifiedClosureIssue : AccessToClosureIssue { public AccessToModifiedClosureIssue () diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/VariableDeclaredInWideScopeIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/VariableDeclaredInWideScopeIssue.cs index 563a0d49bd..ea8c0c2e61 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/VariableDeclaredInWideScopeIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/VariableDeclaredInWideScopeIssue.cs @@ -134,7 +134,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring } // Restrict to locations outside of blacklisted node types - var firstBlackListedNode = path.Where(node => moveTargetBlacklist.Contains(node.GetType())).FirstOrDefault(); + var firstBlackListedNode = path.FirstOrDefault(node => moveTargetBlacklist.Contains(node.GetType())); if (firstBlackListedNode != null) { path = GetPath(rootNode, firstBlackListedNode.Parent); anchorNode = firstBlackListedNode; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/ConstraintViolations/InconsistentNamingIssue/NamingRule.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/ConstraintViolations/InconsistentNamingIssue/NamingRule.cs index 5b087bf7b6..6deb6422ee 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/ConstraintViolations/InconsistentNamingIssue/NamingRule.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/ConstraintViolations/InconsistentNamingIssue/NamingRule.cs @@ -376,7 +376,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring break; case NamingStyle.CamelCase: - if (id.Length > 0 && char.IsUpper(id [0])) { + if (id.Length > 0 && !char.IsLower(id [0])) { errorMessage = string.Format(ctx.TranslateString("'{0}' should start with a lower case letter. (Rule '{1}')"), name, Name); } else if (!CheckUnderscore(id, UnderscoreHandling.Forbid)) { errorMessage = string.Format(ctx.TranslateString("'{0}' should not separate words with an underscore. (Rule '{1}')"), name, Name); @@ -387,7 +387,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring suggestedNames.Add(CamelCaseIdentifier(id)); break; case NamingStyle.CamelCaseWithLowerLetterUnderscore: - if (id.Length > 0 && char.IsUpper(id [0])) { + if (id.Length > 0 && !char.IsLower(id [0])) { errorMessage = string.Format(ctx.TranslateString("'{0}' should start with a lower case letter. (Rule '{1}')"), name, Name); } else if (!CheckUnderscore(id, UnderscoreHandling.AllowWithLowerStartingLetter)) { errorMessage = string.Format(ctx.TranslateString("after '_' a lower letter should follow. (Rule '{0}')"), Name); @@ -398,7 +398,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring suggestedNames.Add(CamelCaseWithLowerLetterUnderscore(id)); break; case NamingStyle.CamelCaseWithUpperLetterUnderscore: - if (id.Length > 0 && char.IsUpper(id [0])) { + if (id.Length > 0 && !char.IsLower(id [0])) { errorMessage = string.Format(ctx.TranslateString("'{0}' should start with a lower case letter. (Rule '{1}')"), name, Name); } else if (!CheckUnderscore(id, UnderscoreHandling.AllowWithUpperStartingLetter)) { errorMessage = string.Format(ctx.TranslateString("after '_' an upper letter should follow. (Rule '{0}')"), Name); @@ -410,7 +410,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring break; case NamingStyle.PascalCase: - if (id.Length > 0 && char.IsLower(id [0])) { + if (id.Length > 0 && !char.IsUpper(id [0])) { errorMessage = string.Format(ctx.TranslateString("'{0}' should start with an upper case letter. (Rule '{1}')"), name, Name); } else if (!CheckUnderscore(id, UnderscoreHandling.Forbid)) { errorMessage = string.Format(ctx.TranslateString("'{0}' should not separate words with an underscore. (Rule '{1}')"), name, Name); @@ -421,7 +421,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring suggestedNames.Add(PascalCaseIdentifier(id)); break; case NamingStyle.PascalCaseWithLowerLetterUnderscore: - if (id.Length > 0 && char.IsLower(id [0])) { + if (id.Length > 0 && !char.IsUpper(id [0])) { errorMessage = string.Format(ctx.TranslateString("'{0}' should start with an upper case letter. (Rule '{1}')"), name, Name); } else if (!CheckUnderscore(id, UnderscoreHandling.AllowWithLowerStartingLetter)) { errorMessage = string.Format(ctx.TranslateString("after '_' a lower letter should follow. (Rule '{0}')"), Name); @@ -432,7 +432,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring suggestedNames.Add(PascalCaseWithLowerLetterUnderscore(id)); break; case NamingStyle.PascalCaseWithUpperLetterUnderscore: - if (id.Length > 0 && char.IsLower(id [0])) { + if (id.Length > 0 && !char.IsUpper(id [0])) { errorMessage = string.Format(ctx.TranslateString("'{0}' should start with an upper case letter. (Rule '{1}')"), name, Name); } else if (!CheckUnderscore(id, UnderscoreHandling.AllowWithUpperStartingLetter)) { errorMessage = string.Format(ctx.TranslateString("after '_' an upper letter should follow. (Rule '{0}')"), Name); @@ -443,7 +443,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring suggestedNames.Add(PascalCaseWithUpperLetterUnderscore(id)); break; case NamingStyle.FirstUpper: - if (id.Length > 0 && char.IsLower(id [0])) { + if (id.Length > 0 && !char.IsUpper(id [0])) { errorMessage = string.Format(ctx.TranslateString("'{0}' should start with an upper case letter. (Rule '{1}')"), name, Name); } else if (id.Take(1).Any(ch => char.IsLetter(ch) && char.IsUpper(ch))) { errorMessage = string.Format(ctx.TranslateString("'{0}' contains an upper case letter after the first. (Rule '{1}')"), name, Name); @@ -525,6 +525,8 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring bool first = true; for (int i = 0; i < id.Length; i++) { char ch = id[i]; + if (i == 0 && ch == '_') + continue; if (first && char.IsLetter(ch)) { sb.Append(firstCharFunc(ch)); firstCharFunc = followingCharFunc; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToAverageIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToAverageIssue.cs new file mode 100644 index 0000000000..20eae5fa0e --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToAverageIssue.cs @@ -0,0 +1,123 @@ +// +// ReplaceWithSingleCallToAverageIssue.cs +// +// Author: +// Marius Ungureanu +// +// Copyright (c) 2014 Xamarin +// +// 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.Linq; +using ICSharpCode.NRefactory.Semantics; +using ICSharpCode.NRefactory.TypeSystem; +using ICSharpCode.NRefactory.PatternMatching; +using ICSharpCode.NRefactory.Refactoring; + +namespace ICSharpCode.NRefactory.CSharp.Refactoring +{ + [IssueDescription("Replace with single call to Average(...)", + Description = "Replace with single call to Average(...)", + Category = IssueCategories.PracticesAndImprovements, + Severity = Severity.Suggestion, + AnalysisDisableKeyword = "ReplaceWithSingleCallToAverage")] + public class ReplaceWithSingleCallToAverageIssue : GatherVisitorCodeIssueProvider + { + static readonly AstNode pattern = + new InvocationExpression ( + new MemberReferenceExpression ( + new NamedNode ("selectInvoke", + new InvocationExpression ( + new MemberReferenceExpression (new AnyNode ("target"), "Select"), + new AnyNode ())), + Pattern.AnyString)); + + protected override IGatherVisitor CreateVisitor(BaseRefactoringContext context) + { + return new GatherVisitor(context, "Average"); + } + + internal class GatherVisitor : GatherVisitorBase where T : GatherVisitorCodeIssueProvider + { + readonly string member; + + public GatherVisitor (BaseRefactoringContext ctx, string member) : base (ctx) + { + this.member = member; + } + + public override void VisitInvocationExpression (InvocationExpression invocationExpression) + { + base.VisitInvocationExpression (invocationExpression); + + var match = pattern.Match (invocationExpression); + if (!match.Success) + return; + + var averageResolve = ctx.Resolve (invocationExpression) as InvocationResolveResult; + if (averageResolve == null || !HasPredicateVersion(averageResolve.Member)) + return; + var selectInvoke = match.Get ("selectInvoke").Single (); + var selectResolve = ctx.Resolve (selectInvoke) as InvocationResolveResult; + if (selectResolve == null || selectResolve.Member.Name != "Select" || !IsQueryExtensionClass(selectResolve.Member.DeclaringTypeDefinition)) + return; + if (selectResolve.Member.Parameters.Count != 2) + return; + var predResolve = selectResolve.Member.Parameters [1]; + if (predResolve.Type.TypeParameterCount != 2) + return; + + AddIssue(new CodeIssue( + invocationExpression, string.Format(ctx.TranslateString("Redundant Select() call with predicate followed by {0}()"), averageResolve.Member.Name), + new CodeAction ( + string.Format(ctx.TranslateString("Replace with single call to '{0}'"), averageResolve.Member.Name), + script => { + var arg = selectInvoke.Arguments.Single ().Clone (); + var target = match.Get ("target").Single ().Clone (); + script.Replace (invocationExpression, new InvocationExpression (new MemberReferenceExpression (target, averageResolve.Member.Name), arg)); + }, + invocationExpression + ) + )); + } + + static bool IsQueryExtensionClass(ITypeDefinition typeDef) + { + if (typeDef == null || typeDef.Namespace != "System.Linq") + return false; + switch (typeDef.Name) { + case "Enumerable": + case "ParallelEnumerable": + case "Queryable": + return true; + default: + return false; + } + } + + bool HasPredicateVersion(IParameterizedMember member) + { + if (!IsQueryExtensionClass(member.DeclaringTypeDefinition)) + return false; + return member.Name == this.member; + } + } + } +} + + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToMaxIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToMaxIssue.cs new file mode 100644 index 0000000000..d8597f0bf6 --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToMaxIssue.cs @@ -0,0 +1,43 @@ +// +// ReplaceWithSingleCallToMaxIssue.cs +// +// Author: +// Marius Ungureanu +// +// Copyright (c) 2014 Xamarin +// +// 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 ICSharpCode.NRefactory.Refactoring; + +namespace ICSharpCode.NRefactory.CSharp.Refactoring +{ + [IssueDescription("Replace with single call to Max(...)", + Description = "Replace with single call to Max(...)", + Category = IssueCategories.PracticesAndImprovements, + Severity = Severity.Suggestion, + AnalysisDisableKeyword = "ReplaceWithSingleCallToMax")] + public class ReplaceWithSingleCallToMaxIssue : GatherVisitorCodeIssueProvider + { + protected override IGatherVisitor CreateVisitor(BaseRefactoringContext context) + { + return new ReplaceWithSingleCallToAverageIssue.GatherVisitor(context, "Max"); + } + } +} + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToMinIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToMinIssue.cs new file mode 100644 index 0000000000..2b63149e84 --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToMinIssue.cs @@ -0,0 +1,43 @@ +// +// ReplaceWithSingleCallToMinIssue.cs +// +// Author: +// Marius Ungureanu +// +// Copyright (c) 2014 Xamarin +// +// 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 ICSharpCode.NRefactory.Refactoring; + +namespace ICSharpCode.NRefactory.CSharp.Refactoring +{ + [IssueDescription("Replace with single call to Min(...)", + Description = "Replace with single call to Min(...)", + Category = IssueCategories.PracticesAndImprovements, + Severity = Severity.Suggestion, + AnalysisDisableKeyword = "ReplaceWithSingleCallToMin")] + public class ReplaceWithSingleCallToMinIssue : GatherVisitorCodeIssueProvider + { + protected override IGatherVisitor CreateVisitor(BaseRefactoringContext context) + { + return new ReplaceWithSingleCallToAverageIssue.GatherVisitor(context, "Min"); + } + } +} + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToSumIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToSumIssue.cs new file mode 100644 index 0000000000..45f1131371 --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToSumIssue.cs @@ -0,0 +1,43 @@ +// +// ReplaceWithSingleCallToSumIssue.cs +// +// Author: +// Marius Ungureanu +// +// Copyright (c) 2014 Xamarin +// +// 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 ICSharpCode.NRefactory.Refactoring; + +namespace ICSharpCode.NRefactory.CSharp.Refactoring +{ + [IssueDescription("Replace with single call to Sum(...)", + Description = "Replace with single call to Sum(...)", + Category = IssueCategories.PracticesAndImprovements, + Severity = Severity.Suggestion, + AnalysisDisableKeyword = "ReplaceWithSingleCallToSum")] + public class ReplaceWithSingleCallToSumIssue : GatherVisitorCodeIssueProvider + { + protected override IGatherVisitor CreateVisitor(BaseRefactoringContext context) + { + return new ReplaceWithSingleCallToAverageIssue.GatherVisitor(context, "Sum"); + } + } +} + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantAttributeParenthesesIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantAttributeParenthesesIssue.cs index 74884bf0a6..deb6e68944 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantAttributeParenthesesIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantAttributeParenthesesIssue.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring if (attribute.Arguments.Count > 0 || !attribute.HasArgumentList) return; - AddIssue(new CodeIssue(attribute.LParToken.StartLocation, attribute.RParToken.StartLocation, ctx.TranslateString("Parentheses are redundant if attribute has no arguments"), ctx.TranslateString("Remove '()'"), script => + AddIssue(new CodeIssue(attribute.LParToken.StartLocation, attribute.RParToken.EndLocation, ctx.TranslateString("Parentheses are redundant if attribute has no arguments"), ctx.TranslateString("Remove '()'"), script => script.Replace(attribute, new Attribute { Type = attribute.Type.Clone() })) { IssueMarker = IssueMarker.GrayOut }); } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/AutoAsyncIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/AutoAsyncIssue.cs index 426537fc50..c7b91edf2a 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/AutoAsyncIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/AutoAsyncIssue.cs @@ -39,10 +39,10 @@ using ICSharpCode.NRefactory.Refactoring; namespace ICSharpCode.NRefactory.CSharp.Refactoring { - [IssueDescription("Old-style asynchronous function can be converted to C# 5 async", - Description = "Detects usage of old-style TaskCompletionSource/ContinueWith and suggests using async/await instead", - Category = IssueCategories.Opportunities, - Severity = Severity.Hint)] +// [IssueDescription("Old-style asynchronous function can be converted to C# 5 async", +// Description = "Detects usage of old-style TaskCompletionSource/ContinueWith and suggests using async/await instead", +// Category = IssueCategories.Opportunities, +// Severity = Severity.Hint)] public class AutoAsyncIssue : GatherVisitorCodeIssueProvider { static readonly ReturnStatement ReturnTaskCompletionSourcePattern = new ReturnStatement { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DisposeMethodInNonIDisposableTypeIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DisposeMethodInNonIDisposableTypeIssue.cs index ca9690be50..69dd076408 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DisposeMethodInNonIDisposableTypeIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DisposeMethodInNonIDisposableTypeIssue.cs @@ -32,10 +32,10 @@ using ICSharpCode.NRefactory.CSharp.Resolver; namespace ICSharpCode.NRefactory.CSharp.Refactoring { - [IssueDescription("Type does not implement IDisposable despite having a Dispose method", - Description="This type declares a method named Dispose, but it does not implement the System.IDisposable interface", - Category=IssueCategories.CodeQualityIssues, - Severity=Severity.Warning)] +// [IssueDescription("Type does not implement IDisposable despite having a Dispose method", +// Description="This type declares a method named Dispose, but it does not implement the System.IDisposable interface", +// Category=IssueCategories.CodeQualityIssues, +// Severity=Severity.Warning)] public class DisposeMethodInNonIDisposableTypeIssue : GatherVisitorCodeIssueProvider { protected override IGatherVisitor CreateVisitor(BaseRefactoringContext context) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DontUseLinqWhenItsVerboseAndInefficientIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DontUseLinqWhenItsVerboseAndInefficientIssue.cs index 42e15acee9..5c53543771 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DontUseLinqWhenItsVerboseAndInefficientIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DontUseLinqWhenItsVerboseAndInefficientIssue.cs @@ -32,10 +32,10 @@ using ICSharpCode.NRefactory.CSharp.Resolver; namespace ICSharpCode.NRefactory.CSharp.Refactoring { - [IssueDescription("Use of Linq methods when there's a better alternative", - Description="Detects usage of Linq when there's a simpler and faster alternative", - Category=IssueCategories.CodeQualityIssues, - Severity=Severity.Warning)] +// [IssueDescription("Use of Linq methods when there's a better alternative", +// Description="Detects usage of Linq when there's a simpler and faster alternative", +// Category=IssueCategories.CodeQualityIssues, +// Severity=Severity.Warning)] public class DontUseLinqWhenItsVerboseAndInefficientIssue : GatherVisitorCodeIssueProvider { class LinqMethod { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DuplicatedLinqToListOrArrayIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DuplicatedLinqToListOrArrayIssue.cs index 172f8dfa0c..5077004309 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DuplicatedLinqToListOrArrayIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DuplicatedLinqToListOrArrayIssue.cs @@ -36,10 +36,10 @@ using System.Linq; namespace ICSharpCode.NRefactory.CSharp.Refactoring { - [IssueDescription ("Duplicated ToList() or ToArray() call", - Description = "Duplicated call to ToList() or ToArray()", - Category = IssueCategories.RedundanciesInCode, - Severity = Severity.Warning)] +// [IssueDescription ("Duplicated ToList() or ToArray() call", +// Description = "Duplicated call to ToList() or ToArray()", +// Category = IssueCategories.RedundanciesInCode, +// Severity = Severity.Warning)] public class DuplicatedLinqToListOrArrayIssue : GatherVisitorCodeIssueProvider { const string MemberTarget = "target"; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/IncorrectCallToObjectGetHashCodeIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/IncorrectCallToObjectGetHashCodeIssue.cs index f56a3b935a..e298987985 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/IncorrectCallToObjectGetHashCodeIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/IncorrectCallToObjectGetHashCodeIssue.cs @@ -30,11 +30,11 @@ using ICSharpCode.NRefactory.Refactoring; namespace ICSharpCode.NRefactory.CSharp.Refactoring { - [IssueDescription("Call resolves to Object.GetHashCode, which is reference based", - Description = "Finds calls to Object.GetHashCode inside overridden GetHashCode.", - Category = IssueCategories.CodeQualityIssues, - Severity = Severity.Warning, - AnalysisDisableKeyword = "BaseObjectGetHashCodeCallInGetHashCode")] +// [IssueDescription("Call resolves to Object.GetHashCode, which is reference based", +// Description = "Finds calls to Object.GetHashCode inside overridden GetHashCode.", +// Category = IssueCategories.CodeQualityIssues, +// Severity = Severity.Warning, +// AnalysisDisableKeyword = "BaseObjectGetHashCodeCallInGetHashCode")] public class IncorrectCallToObjectGetHashCodeIssue : GatherVisitorCodeIssueProvider { protected override IGatherVisitor CreateVisitor(BaseRefactoringContext context) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/RedundantBlockInDifferentBranchesIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/RedundantBlockInDifferentBranchesIssue.cs index e1e3f0fb06..caa9992d11 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/RedundantBlockInDifferentBranchesIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/RedundantBlockInDifferentBranchesIssue.cs @@ -29,11 +29,11 @@ using ICSharpCode.NRefactory.Refactoring; namespace ICSharpCode.NRefactory.CSharp.Refactoring { - [IssueDescription("RedundantBlockInDifferentBranches", - Description = "Blocks in if/else can be simplified to any of the branches if they have the same block.", - Category = IssueCategories.RedundanciesInCode, - Severity = Severity.Hint, - AnalysisDisableKeyword = "RedundantBlockInDifferentBranches")] +// [IssueDescription("RedundantBlockInDifferentBranches", +// Description = "Blocks in if/else can be simplified to any of the branches if they have the same block.", +// Category = IssueCategories.RedundanciesInCode, +// Severity = Severity.Hint, +// AnalysisDisableKeyword = "RedundantBlockInDifferentBranches")] public class RedundantBlockInDifferentBranchesIssue : GatherVisitorCodeIssueProvider { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/RedundantNotNullAttributeInNonNullableTypeIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/RedundantNotNullAttributeInNonNullableTypeIssue.cs index 33d0a9b63f..56653b847e 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/RedundantNotNullAttributeInNonNullableTypeIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/RedundantNotNullAttributeInNonNullableTypeIssue.cs @@ -33,10 +33,10 @@ using ICSharpCode.NRefactory.TypeSystem; namespace ICSharpCode.NRefactory.CSharp.Refactoring { - [IssueDescription("Use of NotNullAttribute in non-nullable type is redundant.", - Description = "Detects unnecessary usages of the NotNullAttribute.", - Category = IssueCategories.RedundanciesInDeclarations, - Severity = Severity.Warning)] +// [IssueDescription("Use of NotNullAttribute in non-nullable type is redundant.", +// Description = "Detects unnecessary usages of the NotNullAttribute.", +// Category = IssueCategories.RedundanciesInDeclarations, +// Severity = Severity.Warning)] public class RedundantNotNullAttributeInNonNullableTypeIssue : GatherVisitorCodeIssueProvider { protected override IGatherVisitor CreateVisitor(BaseRefactoringContext context) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/ResultOfAsyncCallShouldNotBeIgnoredIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/ResultOfAsyncCallShouldNotBeIgnoredIssue.cs index 957178e806..97b678e326 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/ResultOfAsyncCallShouldNotBeIgnoredIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/ResultOfAsyncCallShouldNotBeIgnoredIssue.cs @@ -24,11 +24,11 @@ using ICSharpCode.NRefactory.Refactoring; namespace ICSharpCode.NRefactory.CSharp.Refactoring { - [IssueDescription("Result of async call is ignored", - Description = "Warns when the task returned by an async call is ignored, which causes exceptions" + - " thrown by the call to be silently ignored.", - Category = IssueCategories.CodeQualityIssues, - Severity = Severity.Warning)] +// [IssueDescription("Result of async call is ignored", +// Description = "Warns when the task returned by an async call is ignored, which causes exceptions" + +// " thrown by the call to be silently ignored.", +// Category = IssueCategories.CodeQualityIssues, +// Severity = Severity.Warning)] public class ResultOfAsyncCallShouldNotBeIgnoredIssue : GatherVisitorCodeIssueProvider { protected override IGatherVisitor CreateVisitor(BaseRefactoringContext context) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/SameGuardConditionExpressionInIfelseBranchesIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/SameGuardConditionExpressionInIfelseBranchesIssue.cs index 85192da445..5b8f77193d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/SameGuardConditionExpressionInIfelseBranchesIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/SameGuardConditionExpressionInIfelseBranchesIssue.cs @@ -30,10 +30,10 @@ using ICSharpCode.NRefactory.Refactoring; namespace ICSharpCode.NRefactory.CSharp.Refactoring { - [IssueDescription("Same guard condition expression in different if else branch", - Description = "A warning should be given for the case: if (condition) {…} else if (condition) {…}.", - Category = IssueCategories.Notifications, - Severity = Severity.Warning)] +// [IssueDescription("Same guard condition expression in different if else branch", +// Description = "A warning should be given for the case: if (condition) {…} else if (condition) {…}.", +// Category = IssueCategories.Notifications, +// Severity = Severity.Warning)] public class SameGuardConditionExpressionInIfelseBranchesIssue : GatherVisitorCodeIssueProvider { protected override IGatherVisitor CreateVisitor(BaseRefactoringContext context) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/UnmatchedSizeSpecificationInArrayCreationIssue.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/UnmatchedSizeSpecificationInArrayCreationIssue.cs index c041cede50..3a42ea4e75 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/UnmatchedSizeSpecificationInArrayCreationIssue.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/UnmatchedSizeSpecificationInArrayCreationIssue.cs @@ -33,11 +33,11 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring /// /// When array initializer has the different number of elements as specified in size creation, it is an error. /// - [IssueDescription("Correct size specification in array creation", - Description= "When array initializer has the different number of elements as specified in size creation, it is an error.", - Category = IssueCategories.CompilerErrors, - Severity = Severity.Error, - AnalysisDisableKeyword = "UnmatchedSizeSpecificationInArrayCreation")] +// [IssueDescription("Correct size specification in array creation", +// Description= "When array initializer has the different number of elements as specified in size creation, it is an error.", +// Category = IssueCategories.CompilerErrors, +// Severity = Severity.Error, +// AnalysisDisableKeyword = "UnmatchedSizeSpecificationInArrayCreation")] public class UnmatchedSizeSpecificationInArrayCreationIssue : GatherVisitorCodeIssueProvider { protected override IGatherVisitor CreateVisitor(BaseRefactoringContext context) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/UseOfMemberOfNullReference.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/UseOfMemberOfNullReference.cs index ab941fa33a..905f761268 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/UseOfMemberOfNullReference.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/UseOfMemberOfNullReference.cs @@ -34,10 +34,10 @@ using ICSharpCode.NRefactory.CSharp.Analysis; namespace ICSharpCode.NRefactory.CSharp.Refactoring { - [IssueDescription("Use of (non-extension method) member of null value will cause a NullReferenceException", - Description = "Detects when a member of a null value is used", - Category = IssueCategories.CodeQualityIssues, - Severity = Severity.Warning)] +// [IssueDescription("Use of (non-extension method) member of null value will cause a NullReferenceException", +// Description = "Detects when a member of a null value is used", +// Category = IssueCategories.CodeQualityIssues, +// Severity = Severity.Warning)] public class UseOfMemberOfNullReference : GatherVisitorCodeIssueProvider { static readonly ISet ProblematicNullStates = new HashSet { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/ICSharpCode.NRefactory.CSharp.Refactoring.csproj b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/ICSharpCode.NRefactory.CSharp.Refactoring.csproj index 71d8f5599a..02e165f0c0 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/ICSharpCode.NRefactory.CSharp.Refactoring.csproj +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/ICSharpCode.NRefactory.CSharp.Refactoring.csproj @@ -427,6 +427,10 @@ + + + + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs index 235ee5501b..613d13262c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs @@ -349,6 +349,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion return contextList.Result; } var lookup = new MemberLookup(ctx.CurrentTypeDefinition, Compilation.MainAssembly); + var list = typeof(System.Collections.IList).ToTypeReference().Resolve(Compilation); + var list1 = typeof(System.Collections.Generic.IList<>).ToTypeReference().Resolve(Compilation); bool isProtectedAllowed = ctx.CurrentTypeDefinition != null && initializerType.GetDefinition() != null ? ctx.CurrentTypeDefinition.IsDerivedFrom(initializerType.GetDefinition()) : false; @@ -364,7 +366,9 @@ namespace ICSharpCode.NRefactory.CSharp.Completion } foreach (IProperty m in initializerType.GetMembers (m => m.SymbolKind == SymbolKind.Property)) { - if (m.CanSet && lookup.IsAccessible(m.Setter, isProtectedAllowed)) { + if (m.CanSet && lookup.IsAccessible(m.Setter, isProtectedAllowed) || + m.CanGet && lookup.IsAccessible(m.Getter, isProtectedAllowed) && m.ReturnType.GetDefinition() != null && + (m.ReturnType.GetDefinition().IsDerivedFrom(list.GetDefinition()) || m.ReturnType.GetDefinition().IsDerivedFrom(list1.GetDefinition()))) { var data = contextList.AddMember(m); if (data != null) data.DisplayFlags |= DisplayFlags.NamedArgument; @@ -379,10 +383,9 @@ namespace ICSharpCode.NRefactory.CSharp.Completion // case 1) // check if the object is a list, if not only provide object initalizers - var list = typeof(System.Collections.IList).ToTypeReference().Resolve(Compilation); if (initializerType.Kind != TypeKind.Array && list != null) { var def = initializerType.GetDefinition(); - if (def != null && !def.IsDerivedFrom(list.GetDefinition())) + if (def != null && !def.IsDerivedFrom(list.GetDefinition()) && !def.IsDerivedFrom(list1.GetDefinition())) return contextList.Result; } @@ -2354,7 +2357,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion return null; } // check for valid constructors - if (t.GetConstructors().Count() > 0) { + if (t.GetConstructors().Any()) { bool isProtectedAllowed = currentType != null ? currentType.Resolve(ctx).GetDefinition().IsDerivedFrom(t.GetDefinition()) : false; if (!t.GetConstructors().Any(m => 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 14a8dfdb42..c61f77bc5a 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngineBase.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngineBase.cs @@ -340,12 +340,27 @@ namespace ICSharpCode.NRefactory.CSharp.Completion this.text = text; } - public void Parse(Action act = null) + /// + /// Parsing all text and calling act delegate on almost every character. + /// Skipping begining of comments, begining of verbatim strings and escaped characters. + /// + /// Return true to abort parsing. Integer argument represent offset in text. + /// True if aborted. + public bool Parse(Func act = null) { - Parse(0, text.Length, act); + return Parse(0, text.Length, act); } - public void Parse(int start, int length, Action act = null) + + /// + /// Parsing text from start to start+length and calling act delegate on almost every character. + /// Skipping begining of comments, begining of verbatim strings and escaped characters. + /// + /// Start offset. + /// Lenght to parse. + /// Return true to abort parsing. Integer argument represent offset in text. + /// True if aborted. + public bool Parse(int start, int length, Func act = null) { for (int i = start; i < length; i++) { char ch = text [i]; @@ -416,9 +431,11 @@ namespace ICSharpCode.NRefactory.CSharp.Completion break; } if (act != null) - act(ch); + if (act (ch, i)) + return true; IsFistNonWs &= ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r'; } + return false; } } @@ -677,7 +694,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion while (o >= "try".Length) { char ch = memberText [o]; if (!char.IsWhiteSpace (ch)) { - if (ch == 'y' && memberText [o - 1] == 'r' && memberText [o - 2] == 't') { + if (ch == 'y' && memberText [o - 1] == 'r' && memberText [o - 2] == 't' && (o - 3 < 0 || !char.IsLetterOrDigit(memberText [o - 3]))) { wrapper.Append ("} catch {}"); didAppendCatch = true; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpParameterCompletionEngine.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpParameterCompletionEngine.cs index b86c9bb489..e5919834e1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpParameterCompletionEngine.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpParameterCompletionEngine.cs @@ -57,7 +57,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (currentMember == null && currentType == null) { return null; } - baseUnit = ParseStub("x] = a[1"); + baseUnit = ParseStub("x]"); //var memberLocation = currentMember != null ? currentMember.Region.Begin : currentType.Region.Begin; var mref = baseUnit.GetNodeAt(location, n => n is IndexerExpression); @@ -183,20 +183,93 @@ namespace ICSharpCode.NRefactory.CSharp.Completion public IParameterDataProvider GetParameterDataProvider(int offset, char completionChar) { - if (offset <= 0) { + //Ignoring completionChar == '\0' because it usually means moving with arrow keys, tab or enter + //we don't want to trigger on those events but it probably should be handled somewhere else + //since our job is to resolve method and not to decide when to display tooltip or not + if (offset <= 0 || completionChar == '\0') { return null; } - if (completionChar != '(' && completionChar != '<' && completionChar != '[' && completionChar != ',') { - return null; + SetOffset (offset); + int startOffset; + string text; + if (currentMember == null && currentType == null) { + //In case of attributes parse all file + startOffset = 0; + text = document.Text; + } else { + var memberText = GetMemberTextToCaret (); + text = memberText.Item1; + startOffset = document.GetOffset (memberText.Item2); } - - SetOffset(offset); - if (IsInsideCommentStringOrDirective()) { + + var parenStack = new Stack (); + var chevronStack = new Stack (); + var squareStack = new Stack (); + var bracketStack = new Stack (); + + var lex = new MiniLexer (text); + bool failed = lex.Parse ((ch, off) => { + if (lex.IsInString || lex.IsInChar || lex.IsInVerbatimString || lex.IsInSingleComment || lex.IsInMultiLineComment || lex.IsInPreprocessorDirective) + return false; + switch (ch) { + case '(': + parenStack.Push (startOffset + off); + break; + case ')': + if (parenStack.Count == 0) { + return true; + } + parenStack.Pop (); + break; + case '<': + chevronStack.Push (startOffset + off); + break; + case '>': + //Don't abort if we don't have macthing '<' for '>' it could be if (i > 0) Foo($ + if (chevronStack.Count == 0) { + return false; + } + chevronStack.Pop (); + break; + case '[': + squareStack.Push (startOffset + off); + break; + case ']': + if (squareStack.Count == 0) { + return true; + } + squareStack.Pop (); + break; + case '{': + bracketStack.Push (startOffset + off); + break; + case '}': + if (bracketStack.Count == 0) { + return true; + } + bracketStack.Pop (); + break; + } + return false; + }); + if (failed) return null; - } + int result = -1; + if (parenStack.Count > 0) + result = parenStack.Pop (); + if (squareStack.Count > 0) + result = Math.Max (result, squareStack.Pop ()); + if (chevronStack.Count > 0) + result = Math.Max (result, chevronStack.Pop ()); + //If we are inside { bracket we don't want to display anything + if (bracketStack.Count > 0 && bracketStack.Pop () > result) + return null; + if (result == -1) + return null; + SetOffset (result + 1); ResolveResult resolveResult; - switch (completionChar) { + switch (document.GetCharAt (result)) { case '(': var invoke = GetInvocationBeforeCursor(true) ?? GetConstructorInitializerBeforeCursor(); if (invoke == null) { @@ -259,62 +332,6 @@ namespace ICSharpCode.NRefactory.CSharp.Completion // return new NRefactoryParameterDataProvider (textEditorData, result.Expression, resolvedType); // } break; - case ',': - invoke = GetInvocationBeforeCursor(true) ?? GetIndexerBeforeCursor(); - if (invoke == null) { - invoke = GetTypeBeforeCursor(); - if (invoke != null) { - if (GetCurrentParameterIndex(document.GetOffset(invoke.Node.StartLocation), offset) < 0) - return null; - var typeExpression = ResolveExpression(invoke); - if (typeExpression == null || typeExpression.Result == null || typeExpression.Result.IsError) { - return null; - } - - return factory.CreateTypeParameterDataProvider(document.GetOffset(invoke.Node.StartLocation), CollectAllTypes(typeExpression.Result.Type)); - } - return null; - } - 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.Result.Type); - } - - if (invoke.Node is ICSharpCode.NRefactory.CSharp.Attribute) { - var attribute = ResolveExpression(invoke); - if (attribute == null || attribute.Result == null) { - return null; - } - return factory.CreateConstructorProvider(document.GetOffset(invoke.Node.StartLocation), attribute.Result.Type); - } - - invocationExpression = ResolveExpression(invoke); - - if (invocationExpression == null || invocationExpression.Result == null || invocationExpression.Result.IsError) { - return null; - } - - resolveResult = invocationExpression.Result; - if (resolveResult is MethodGroupResolveResult) { - return factory.CreateMethodDataProvider(document.GetOffset(invoke.Node.StartLocation), CollectMethods(invoke.Node, resolveResult as MethodGroupResolveResult)); - } - if (resolveResult is MemberResolveResult) { - if (resolveResult.Type.Kind == TypeKind.Delegate) { - return factory.CreateDelegateDataProvider(document.GetOffset(invoke.Node.StartLocation), resolveResult.Type); - } - var mr = resolveResult as MemberResolveResult; - if (mr.Member is IMethod) { - return factory.CreateMethodDataProvider(document.GetOffset(invoke.Node.StartLocation), new [] { (IMethod)mr.Member }); - } - } - if (resolveResult != null) { - return factory.CreateIndexerParameterDataProvider(document.GetOffset(invoke.Node.StartLocation), resolveResult.Type, GetAccessibleIndexers (resolveResult.Type), invoke.Node); - } - break; case '<': invoke = GetMethodTypeArgumentInvocationBeforeCursor(); if (invoke != null) { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/ICompletionContextProvider.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/ICompletionContextProvider.cs index ed70580e66..b6e9822eec 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/ICompletionContextProvider.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/ICompletionContextProvider.cs @@ -124,6 +124,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion bool IsInsideType (IUnresolvedEntity currentType, TextLocation location) { + if (currentType.Region.IsEmpty) + return false; int startOffset = document.GetOffset (currentType.Region.Begin); int endOffset = document.GetOffset (location); //bool foundEndBracket = false; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/IndentEngine/IndentState.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/IndentEngine/IndentState.cs index 1e230e0918..6b05ce36cf 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/IndentEngine/IndentState.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/IndentEngine/IndentState.cs @@ -516,10 +516,8 @@ namespace ICSharpCode.NRefactory.CSharp var parent = Parent as BracesBodyState; if (parent == null || parent.LastBlockIndent == null || !Engine.EnableCustomIndentLevels) { - if (!Engine.formattingOptions.IndentBlocksInsideExpressions) { - NextLineIndent.RemoveAlignment(); - NextLineIndent.PopIf(IndentType.Continuation); - } + NextLineIndent.RemoveAlignment(); + NextLineIndent.PopIf(IndentType.Continuation); } else { @@ -545,7 +543,7 @@ namespace ICSharpCode.NRefactory.CSharp public override void OnExit() { - if (Parent is BracesBodyState) + if (Parent is BracesBodyState && !((BracesBodyState)Parent).IsRightHandExpression) { ((BracesBodyState)Parent).OnStatementExit(); } @@ -878,8 +876,16 @@ namespace ICSharpCode.NRefactory.CSharp /// void AddIndentation(Body body) { + var isExpression = Parent is ParenthesesBodyState || Parent is SquareBracketsBodyState || + (Parent is BracesBodyState && ((BracesBodyState)Parent).IsRightHandExpression); + if (isExpression && Engine.formattingOptions.IndentBlocksInsideExpressions && Engine.isLineStart) + { + AddIndentation(BraceStyle.NextLineShifted); + } + BraceStyle style; - if (TryGetBraceStyle (body, out style)) { + if (TryGetBraceStyle(body, out style)) + { AddIndentation(style); } else { NextLineIndent.Push(IndentType.Empty); @@ -973,6 +979,8 @@ namespace ICSharpCode.NRefactory.CSharp if (ch == ClosedBracket) { ExitState(); + if (Parent is BracesBodyState) + Parent.OnExit(); } base.Push(ch); @@ -1031,9 +1039,10 @@ namespace ICSharpCode.NRefactory.CSharp base.CheckKeyword(keyword); } + public override void OnExit() { - Parent.OnExit(); + //Parent.OnExit(); } public override IndentState Clone(CSharpIndentEngine engine) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertMissingTokensDecorator.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertMissingTokensDecorator.cs index 4f390d92dc..3f92001457 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertMissingTokensDecorator.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertMissingTokensDecorator.cs @@ -61,6 +61,7 @@ namespace ICSharpCode.NRefactory.CSharp public override void WriteToken(Role role, string token) { CSharpTokenNode t = new CSharpTokenNode(locationProvider.Location, (TokenRole)role); + t.Role = role; EmptyStatement node = nodes.Peek().LastOrDefault() as EmptyStatement; if (node == null) currentList.Add(t); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/TextWriterOutputFormatter.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/TextWriterOutputFormatter.cs index bb9db71277..7e14ea190c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/TextWriterOutputFormatter.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/TextWriterOutputFormatter.cs @@ -321,7 +321,11 @@ namespace ICSharpCode.NRefactory.CSharp } } - static string ConvertCharLiteral(char ch) + /// + /// Gets the escape sequence for the specified character within a char literal. + /// Does not include the single quotes surrounding the char literal. + /// + public static string ConvertCharLiteral(char ch) { if (ch == '\'') { return "\\'"; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs index 7b20fcf590..0eb2ff70c4 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs @@ -207,6 +207,7 @@ namespace ICSharpCode.NRefactory.CSharp memberType.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.DoubleColon), Roles.DoubleColon); memberType.MemberNameToken = Identifier.Create(qam.Name, loc != null ? Convert(loc [1]) : TextLocation.Empty); + AddTypeArguments(qam, memberType); return memberType; } @@ -2167,6 +2168,7 @@ namespace ICSharpCode.NRefactory.CSharp if (location != null && location.Count > 0) result.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.DoubleColon), Roles.DoubleColon); + AddTypeArguments(result, qualifiedAliasMember); result.AddChild(Identifier.Create(qualifiedAliasMember.Name, location != null && location.Count > 1 ? Convert(location [1]) : TextLocation.Empty), Roles.Identifier); return new TypeReferenceExpression { Type = result }; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/MonoSymbolTable.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/MonoSymbolTable.cs index 2b43442680..277f25a7f6 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/MonoSymbolTable.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/MonoSymbolTable.cs @@ -184,6 +184,7 @@ namespace Mono.CompilerServices.SymbolWriter #region This is actually written to the symbol file public readonly int Row; public int Column; + public int EndRow, EndColumn; public readonly int File; public readonly int Offset; public readonly bool IsHidden; // Obsolete is never used @@ -214,17 +215,24 @@ namespace Mono.CompilerServices.SymbolWriter } public LineNumberEntry (int file, int row, int column, int offset, bool is_hidden) + : this (file, row, column, -1, -1, offset, is_hidden) + { + } + + public LineNumberEntry (int file, int row, int column, int end_row, int end_column, int offset, bool is_hidden) { this.File = file; this.Row = row; this.Column = column; + this.EndRow = end_row; + this.EndColumn = end_column; this.Offset = offset; this.IsHidden = is_hidden; } public override string ToString () { - return String.Format ("[Line {0}:{1,2}:{3}]", File, Row, Column, Offset); + return String.Format ("[Line {0}:{1,2}-{3,4}:{5}]", File, Row, Column, EndRow, EndColumn, Offset); } } @@ -836,7 +844,7 @@ namespace Mono.CompilerServices.SymbolWriter this._line_numbers = lines; } - internal void Write (MonoSymbolFile file, MyBinaryWriter bw, bool readColumnsInfo) + internal void Write (MonoSymbolFile file, MyBinaryWriter bw, bool hasColumnsInfo, bool hasEndInfo) { int start = (int) bw.BaseStream.Position; @@ -893,23 +901,37 @@ namespace Mono.CompilerServices.SymbolWriter bw.Write ((byte) 1); bw.Write (DW_LNE_end_sequence); - for (int i = 0; i < LineNumbers.Length; i++) { - var ln = LineNumbers [i]; - if (ln.Row >= 0) - bw.WriteLeb128 (ln.Column); + if (hasColumnsInfo) { + for (int i = 0; i < LineNumbers.Length; i++) { + var ln = LineNumbers [i]; + if (ln.Row >= 0) + bw.WriteLeb128 (ln.Column); + } + } + + if (hasEndInfo) { + for (int i = 0; i < LineNumbers.Length; i++) { + var ln = LineNumbers [i]; + if (ln.EndRow == -1 || ln.EndColumn == -1 || ln.Row > ln.EndRow) { + bw.WriteLeb128 (0xffffff); + } else { + bw.WriteLeb128 (ln.EndRow - ln.Row); + bw.WriteLeb128 (ln.EndColumn); + } + } } file.ExtendedLineNumberSize += (int) bw.BaseStream.Position - start; } - internal static LineNumberTable Read (MonoSymbolFile file, MyBinaryReader br, bool readColumnsInfo) + internal static LineNumberTable Read (MonoSymbolFile file, MyBinaryReader br, bool readColumnsInfo, bool readEndInfo) { LineNumberTable lnt = new LineNumberTable (file); - lnt.DoRead (file, br, readColumnsInfo); + lnt.DoRead (file, br, readColumnsInfo, readEndInfo); return lnt; } - void DoRead (MonoSymbolFile file, MyBinaryReader br, bool includesColumns) + void DoRead (MonoSymbolFile file, MyBinaryReader br, bool includesColumns, bool includesEnds) { var lines = new List (); @@ -988,6 +1010,20 @@ namespace Mono.CompilerServices.SymbolWriter ln.Column = br.ReadLeb128 (); } } + if (includesEnds) { + for (int i = 0; i < _line_numbers.Length; ++i) { + var ln = _line_numbers[i]; + + int row = br.ReadLeb128 (); + if (row == 0xffffff) { + ln.EndRow = -1; + ln.EndColumn = -1; + } else { + ln.EndRow = ln.Row + row; + ln.EndColumn = br.ReadLeb128 (); + } + } + } } public bool GetMethodBounds (out LineNumberEntry start, out LineNumberEntry end) @@ -1045,7 +1081,8 @@ namespace Mono.CompilerServices.SymbolWriter public enum Flags { LocalNamesAmbiguous = 1, - ColumnsInfoIncluded = 1 << 1 + ColumnsInfoIncluded = 1 << 1, + EndInfoIncluded = 1 << 2 } public const int Size = 12; @@ -1198,8 +1235,13 @@ namespace Mono.CompilerServices.SymbolWriter bw.Write (real_name); } + foreach (var lne in lnt.LineNumbers) { + if (lne.EndRow != -1 || lne.EndColumn != -1) + flags |= Flags.EndInfoIncluded; + } + LineNumberTableOffset = (int) bw.BaseStream.Position; - lnt.Write (file, bw, (flags & Flags.ColumnsInfoIncluded) != 0); + lnt.Write (file, bw, (flags & Flags.ColumnsInfoIncluded) != 0, (flags & Flags.EndInfoIncluded) != 0); DataOffset = (int) bw.BaseStream.Position; @@ -1236,7 +1278,7 @@ namespace Mono.CompilerServices.SymbolWriter long old_pos = reader.BaseStream.Position; reader.BaseStream.Position = LineNumberTableOffset; - lnt = LineNumberTable.Read (SymbolFile, reader, (flags & Flags.ColumnsInfoIncluded) != 0); + lnt = LineNumberTable.Read (SymbolFile, reader, (flags & Flags.ColumnsInfoIncluded) != 0, (flags & Flags.EndInfoIncluded) != 0); reader.BaseStream.Position = old_pos; return lnt; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/SourceMethodBuilder.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/SourceMethodBuilder.cs index 75e6a6c608..bd801f657b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/SourceMethodBuilder.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/SourceMethodBuilder.cs @@ -58,9 +58,14 @@ namespace Mono.CompilerServices.SymbolWriter } public void MarkSequencePoint (int offset, SourceFileEntry file, int line, int column, bool is_hidden) + { + MarkSequencePoint (offset, file, line, column, -1, -1, is_hidden); + } + + public void MarkSequencePoint (int offset, SourceFileEntry file, int line, int column, int end_line, int end_column, bool is_hidden) { int file_idx = file != null ? file.Index : 0; - var lne = new LineNumberEntry (file_idx, line, column, offset, is_hidden); + var lne = new LineNumberEntry (file_idx, line, column, end_line, end_column, offset, is_hidden); if (method_lines.Count > 0) { var prev = method_lines[method_lines.Count - 1]; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs index 2f814773cf..64ea6fa4df 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs @@ -1273,7 +1273,7 @@ namespace Mono.CSharp { throw new InternalErrorException (e, loc); } - if (!ec.IsInProbingMode) { + if (!ec.IsInProbingMode && !etree_conversion) { compatibles.Add (type, am ?? EmptyExpression.Null); } @@ -1363,9 +1363,12 @@ namespace Mono.CSharp { // nothing, as we only exist to not do anything. } - public static void Error_AddressOfCapturedVar (ResolveContext ec, IVariableReference var, Location loc) + public static void Error_AddressOfCapturedVar (ResolveContext rc, IVariableReference var, Location loc) { - ec.Report.Error (1686, loc, + if (rc.CurrentAnonymousMethod is AsyncInitializer) + return; + + rc.Report.Error (1686, loc, "Local variable or parameter `{0}' cannot have their address taken and be used inside an anonymous method, lambda expression or query expression", var.Name); } @@ -1605,6 +1608,7 @@ namespace Mono.CSharp { var da_ontrue = fc.DefiniteAssignmentOnTrue; var da_onfalse = fc.DefiniteAssignmentOnFalse; + fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = null; block.FlowAnalysis (fc); fc.ParametersBlock = prev_pb; @@ -1727,6 +1731,7 @@ namespace Mono.CSharp { Modifiers modifiers; TypeDefinition parent = null; + TypeParameters hoisted_tparams = null; var src_block = Block.Original.Explicit; if (src_block.HasCapturedVariable || src_block.HasCapturedThis) { @@ -1758,6 +1763,7 @@ namespace Mono.CSharp { // use ldftn on non-boxed instances either to share mutated state // parent = sm_parent.Parent.PartialContainer; + hoisted_tparams = sm_parent.OriginalTypeParameters; } else if (sm is IteratorStorey) { // // For iterators we can host everything in one class @@ -1775,6 +1781,9 @@ namespace Mono.CSharp { modifiers = Modifiers.STATIC | Modifiers.PRIVATE; } + if (storey == null && hoisted_tparams == null) + hoisted_tparams = ec.CurrentTypeParameters; + if (parent == null) parent = ec.CurrentTypeDefinition.Parent.PartialContainer; @@ -1782,9 +1791,7 @@ namespace Mono.CSharp { "m", null, parent.PartialContainer.CounterAnonymousMethods++); MemberName member_name; - if (storey == null && ec.CurrentTypeParameters != null) { - - var hoisted_tparams = ec.CurrentTypeParameters; + if (hoisted_tparams != null) { var type_params = new TypeParameters (hoisted_tparams.Count); for (int i = 0; i < hoisted_tparams.Count; ++i) { type_params.Add (hoisted_tparams[i].CreateHoistedCopy (null)); @@ -1905,8 +1912,17 @@ namespace Mono.CSharp { ec.Emit (OpCodes.Ldftn, TypeBuilder.GetMethod (t.GetMetaInfo (), (MethodInfo) delegate_method.GetMetaInfo ())); } else { - if (delegate_method.IsGeneric) - delegate_method = delegate_method.MakeGenericMethod (ec.MemberContext, method.TypeParameters); + if (delegate_method.IsGeneric) { + TypeParameterSpec[] tparams; + var sm = ec.CurrentAnonymousMethod == null ? null : ec.CurrentAnonymousMethod.Storey as StateMachine; + if (sm != null && sm.OriginalTypeParameters != null) { + tparams = sm.CurrentTypeParameters.Types; + } else { + tparams = method.TypeParameters; + } + + delegate_method = delegate_method.MakeGenericMethod (ec.MemberContext, tparams); + } ec.Emit (OpCodes.Ldftn, delegate_method); } @@ -2167,7 +2183,6 @@ namespace Mono.CSharp { equals.Block = equals_block; equals.Define (); - equals.PrepareEmit (); Members.Add (equals); // @@ -2222,7 +2237,6 @@ namespace Mono.CSharp { hashcode_block.AddStatement (new Return (hash_variable, loc)); hashcode.Block = hashcode_top; hashcode.Define (); - hashcode.PrepareEmit (); Members.Add (hashcode); // @@ -2233,7 +2247,6 @@ namespace Mono.CSharp { tostring_block.AddStatement (new Return (string_concat, loc)); tostring.Block = tostring_block; tostring.Define (); - tostring.PrepareEmit (); Members.Add (tostring); return true; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assembly.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assembly.cs index 6c99245480..f93c038396 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assembly.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assembly.cs @@ -207,7 +207,7 @@ namespace Mono.CSharp return; if (Compiler.Settings.Target == Target.Exe) { - a.Error_AttributeEmitError ("The executables cannot be satelite assemblies, remove the attribute or keep it empty"); + Report.Error (7059, a.Location, "Executables cannot be satellite assemblies. Remove the attribute or keep it empty"); return; } @@ -231,7 +231,8 @@ namespace Mono.CSharp var vinfo = IsValidAssemblyVersion (value, true); if (vinfo == null) { - a.Error_AttributeEmitError (string.Format ("Specified version `{0}' is not valid", value)); + Report.Error (7034, a.Location, "The specified version string `{0}' does not conform to the required format - major[.minor[.build[.revision]]]", + value); return; } @@ -322,13 +323,18 @@ namespace Mono.CSharp if (a.Type == pa.InternalsVisibleTo) { string assembly_name = a.GetString (); + if (assembly_name == null) { + Report.Error (7030, a.Location, "Friend assembly reference cannot have `null' value"); + return; + } + if (assembly_name.Length == 0) return; #if STATIC ParsedAssemblyName aname; ParseAssemblyResult r = Fusion.ParseAssemblyName (assembly_name, out aname); if (r != ParseAssemblyResult.OK) { - Report.Warning (1700, 3, a.Location, "Assembly reference `{0}' is invalid and cannot be resolved", + Report.Warning (1700, 3, a.Location, "Friend assembly reference `{0}' is invalid and cannot be resolved", assembly_name); return; } @@ -353,10 +359,15 @@ namespace Mono.CSharp } else if (a.Type == pa.AssemblyFileVersion) { vi_product_version = a.GetString (); if (string.IsNullOrEmpty (vi_product_version) || IsValidAssemblyVersion (vi_product_version, false) == null) { - Report.Warning (1607, 1, a.Location, "The version number `{0}' specified for `{1}' is invalid", + Report.Warning (7035, 1, a.Location, "The specified version string `{0}' does not conform to the recommended format major.minor.build.revision", vi_product_version, a.Name); return; } + + // File version info decoding from blob is not supported + var cab = new CustomAttributeBuilder ((ConstructorInfo) ctor.GetMetaInfo (), new object[] { vi_product_version }); + Builder.SetCustomAttribute (cab); + return; } else if (a.Type == pa.AssemblyProduct) { vi_product = a.GetString (); } else if (a.Type == pa.AssemblyCompany) { @@ -394,8 +405,8 @@ namespace Mono.CSharp } var ci = a.Assembly.GetName ().CultureInfo; - if (!ci.Equals (System.Globalization.CultureInfo.InvariantCulture)) { - Report.Warning (1607, 1, "Referenced assembly `{0}' has different culture setting of `{1}'", + if (!ci.Equals (CultureInfo.InvariantCulture)) { + Report.Warning (8009, 1, "Referenced assembly `{0}' has different culture setting of `{1}'", a.Name, ci.Name); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assign.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assign.cs index d938f4da59..18c2d8ca7e 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assign.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assign.cs @@ -334,7 +334,7 @@ namespace Mono.CSharp { if (source == null) { ok = false; - source = EmptyExpression.Null; + source = ErrorExpression.Instance; } target = target.ResolveLValue (ec, source); @@ -569,6 +569,9 @@ namespace Mono.CSharp { { flags |= Options.FieldInitializerScope | Options.ConstructorScope; this.ctor_block = constructorContext.CurrentBlock.Explicit; + + if (ctor_block.IsCompilerGenerated) + CurrentBlock = ctor_block; } public override ExplicitBlock ConstructorBlock { @@ -594,6 +597,12 @@ namespace Mono.CSharp { public int AssignmentOffset { get; private set; } + public FieldBase Field { + get { + return mc; + } + } + public override Location StartLocation { get { return loc; @@ -606,8 +615,8 @@ namespace Mono.CSharp { if (source == null) return null; - var bc = (BlockContext) rc; if (resolved == null) { + var bc = (BlockContext) rc; var ctx = new FieldInitializerContext (mc, bc); resolved = base.DoResolve (ctx) as ExpressionStatement; AssignmentOffset = ctx.AssignmentInfoOffset - bc.AssignmentInfoOffset; @@ -661,6 +670,33 @@ namespace Mono.CSharp { } } + class PrimaryConstructorAssign : SimpleAssign + { + readonly Field field; + readonly Parameter parameter; + + public PrimaryConstructorAssign (Field field, Parameter parameter) + : base (null, null, parameter.Location) + { + this.field = field; + this.parameter = parameter; + } + + protected override Expression DoResolve (ResolveContext rc) + { + target = new FieldExpr (field, loc); + source = rc.CurrentBlock.ParametersBlock.GetParameterInfo (parameter).CreateReferenceExpression (rc, loc); + return base.DoResolve (rc); + } + + public override void EmitStatement (EmitContext ec) + { + using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) { + base.EmitStatement (ec); + } + } + } + // // This class is used for compound assignments. // diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/async.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/async.cs index fb627fc54f..671e53a550 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/async.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/async.cs @@ -80,10 +80,6 @@ namespace Mono.CSharp protected override Expression DoResolve (ResolveContext rc) { - if (rc.HasSet (ResolveContext.Options.FinallyScope)) { - rc.Report.Error (1984, loc, "The `await' operator cannot be used in the body of a finally clause"); - } - if (rc.HasSet (ResolveContext.Options.LockScope)) { rc.Report.Error (1996, loc, "The `await' operator cannot be used in the body of a lock statement"); @@ -250,7 +246,7 @@ namespace Mono.CSharp var fe_awaiter = new FieldExpr (awaiter, loc); fe_awaiter.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc); - Label skip_continuation = ec.DefineLabel (); + Label skip_continuation = ec.DefineLabel (); using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) { // @@ -330,10 +326,6 @@ namespace Mono.CSharp return false; } - if (bc.HasSet (ResolveContext.Options.CatchScope)) { - bc.Report.Error (1985, loc, "The `await' operator cannot be used in the body of a catch clause"); - } - if (!base.Resolve (bc)) return false; @@ -453,6 +445,10 @@ namespace Mono.CSharp get; set; } + public StackFieldExpr HoistedReturnState { + get; set; + } + public override bool IsIterator { get { return false; @@ -470,9 +466,9 @@ namespace Mono.CSharp protected override BlockContext CreateBlockContext (BlockContext bc) { var ctx = base.CreateBlockContext (bc); - var lambda = bc.CurrentAnonymousMethod as LambdaMethod; - if (lambda != null) - return_inference = lambda.ReturnTypeInference; + var am = bc.CurrentAnonymousMethod as AnonymousMethodBody; + if (am != null) + return_inference = am.ReturnTypeInference; ctx.Set (ResolveContext.Options.TryScope); @@ -515,7 +511,6 @@ namespace Mono.CSharp MethodSpec builder_factory; MethodSpec builder_start; PropertySpec task; - LocalVariable hoisted_return; int locals_captured; Dictionary> stack_fields; Dictionary> awaiter_fields; @@ -529,11 +524,7 @@ namespace Mono.CSharp #region Properties - public LocalVariable HoistedReturn { - get { - return hoisted_return; - } - } + public Expression HoistedReturnValue { get; set; } public TypeSpec ReturnType { get { @@ -582,7 +573,7 @@ namespace Mono.CSharp return field; } - public Field AddCapturedLocalVariable (TypeSpec type) + public Field AddCapturedLocalVariable (TypeSpec type, bool requiresUninitialized = false) { if (mutator != null) type = mutator.Mutate (type); @@ -590,7 +581,7 @@ namespace Mono.CSharp List existing_fields = null; if (stack_fields == null) { stack_fields = new Dictionary> (); - } else if (stack_fields.TryGetValue (type, out existing_fields)) { + } else if (stack_fields.TryGetValue (type, out existing_fields) && !requiresUninitialized) { foreach (var f in existing_fields) { if (f.IsAvailableForReuse) { f.IsAvailableForReuse = false; @@ -723,7 +714,7 @@ namespace Mono.CSharp set_state_machine.Block.AddStatement (new StatementExpression (new Invocation (mg, args))); if (has_task_return_type) { - hoisted_return = LocalVariable.CreateCompilerGenerated (bt.TypeArguments[0], StateMachineMethod.Block, Location); + HoistedReturnValue = TemporaryVariableReference.Create (bt.TypeArguments [0], StateMachineMethod.Block, Location); } return true; @@ -910,11 +901,11 @@ namespace Mono.CSharp }; Arguments args; - if (hoisted_return == null) { + if (HoistedReturnValue == null) { args = new Arguments (0); } else { args = new Arguments (1); - args.Add (new Argument (new LocalVariableReference (hoisted_return, Location))); + args.Add (new Argument (HoistedReturnValue)); } using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/attribute.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/attribute.cs index b7f36b0f2c..9e04374923 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/attribute.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/attribute.cs @@ -257,19 +257,22 @@ namespace Mono.CSharp { Report.Error (1970, loc, "Do not use `{0}' directly. Use `dynamic' keyword instead", GetSignatureForError ()); } - /// - /// This is rather hack. We report many emit attribute error with same error to be compatible with - /// csc. But because csc has to report them this way because error came from ilasm we needn't. - /// - public void Error_AttributeEmitError (string inner) + void Error_AttributeEmitError (string inner) { Report.Error (647, Location, "Error during emitting `{0}' attribute. The reason is `{1}'", Type.GetSignatureForError (), inner); } + public void Error_InvalidArgumentValue (TypeSpec attributeType) + { + Report.Error (591, Location, "Invalid value for argument to `{0}' attribute", attributeType.GetSignatureForError ()); + } + public void Error_InvalidSecurityParent () { - Error_AttributeEmitError ("it is attached to invalid parent"); + Report.Error (7070, Location, + "Security attribute `{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations", + Type.GetSignatureForError ()); } Attributable Owner { @@ -411,7 +414,7 @@ namespace Mono.CSharp { return ((MethodImplOptions) value | all) == all; } - static bool IsValidArgumentType (TypeSpec t) + public static bool IsValidArgumentType (TypeSpec t) { if (t.IsArray) { var ac = (ArrayContainer) t; @@ -836,6 +839,7 @@ namespace Mono.CSharp { { SecurityAction action = GetSecurityActionValue (); bool for_assembly = Target == AttributeTargets.Assembly || Target == AttributeTargets.Module; + var c = (Constant)pos_args [0].Expr; switch (action) { #pragma warning disable 618 @@ -858,11 +862,22 @@ namespace Mono.CSharp { #pragma warning restore 618 default: - Error_AttributeEmitError ("SecurityAction is out of range"); + Report.Error (7049, c.Location, "Security attribute `{0}' has an invalid SecurityAction value `{1}'", + Type.GetSignatureForError (), c.GetValueAsLiteral()); return false; } - Error_AttributeEmitError (String.Concat ("SecurityAction `", action, "' is not valid for this declaration")); + switch (Target) { + case AttributeTargets.Assembly: + Report.Error (7050, c.Location, "SecurityAction value `{0}' is invalid for security attributes applied to an assembly", + c.GetSignatureForError ()); + break; + default: + Report.Error (7051, c.Location, "SecurityAction value `{0}' is invalid for security attributes applied to a type or a method", + c.GetSignatureForError ()); + break; + } + return false; } @@ -1031,44 +1046,42 @@ namespace Mono.CSharp { return; } } else if (Type == predefined.Guid) { + string v = ((StringConstant) arg_expr).Value; try { - string v = ((StringConstant) arg_expr).Value; new Guid (v); - } catch (Exception e) { - Error_AttributeEmitError (e.Message); + } catch { + Error_InvalidArgumentValue (Type); return; } } else if (Type == predefined.AttributeUsage) { int v = ((IntConstant) ((EnumConstant) arg_expr).Child).Value; - if (v == 0) { - context.Module.Compiler.Report.Error (591, Location, "Invalid value for argument to `{0}' attribute", - "System.AttributeUsage"); - } + if (v == 0) + Error_InvalidArgumentValue (Type); } else if (Type == predefined.MarshalAs) { if (pos_args.Count == 1) { var u_type = (UnmanagedType) System.Enum.Parse (typeof (UnmanagedType), ((Constant) pos_args[0].Expr).GetValue ().ToString ()); if (u_type == UnmanagedType.ByValArray && !(Owner is FieldBase)) { - Error_AttributeEmitError ("Specified unmanaged type is only valid on fields"); + Report.Error (7055, pos_args [0].Expr.Location, "Unmanaged type `ByValArray' is only valid for fields"); } } } else if (Type == predefined.DllImport) { if (pos_args.Count == 1 && pos_args[0].Expr is Constant) { var value = ((Constant) pos_args[0].Expr).GetValue () as string; if (string.IsNullOrEmpty (value)) - Error_AttributeEmitError ("DllName cannot be empty or null"); + Error_InvalidArgumentValue (Type); } } else if (Type == predefined.MethodImpl) { if (pos_args.Count == 1) { var value = (int) ((Constant) arg_expr).GetValueAsLong (); if (!IsValidMethodImplOption (value)) { - Error_AttributeEmitError ("Incorrect argument value"); + Error_InvalidArgumentValue (Type); } } } } - arg_expr.EncodeAttributeValue (context, encoder, pt); + arg_expr.EncodeAttributeValue (context, encoder, pt, pt); } } @@ -1082,7 +1095,7 @@ namespace Mono.CSharp { encoder.Encode (na.Key.Type); encoder.Encode (na.Value.Name); - na.Value.Expr.EncodeAttributeValue (context, encoder, na.Key.Type); + na.Value.Expr.EncodeAttributeValue (context, encoder, na.Key.Type, na.Key.Type); } } else { encoder.EncodeEmptyNamedArguments (); @@ -1546,7 +1559,7 @@ namespace Mono.CSharp { Encode ((byte) 0x54); // property Encode (property.MemberType); Encode (property.Name); - value.EncodeAttributeValue (null, this, property.MemberType); + value.EncodeAttributeValue (null, this, property.MemberType, property.MemberType); } // @@ -1558,7 +1571,7 @@ namespace Mono.CSharp { Encode ((byte) 0x53); // field Encode (field.MemberType); Encode (field.Name); - value.EncodeAttributeValue (null, this, field.MemberType); + value.EncodeAttributeValue (null, this, field.MemberType, field.MemberType); } public void EncodeNamedArguments (T[] members, Constant[] values) where T : MemberSpec, IInterfaceMemberSpec @@ -1578,7 +1591,7 @@ namespace Mono.CSharp { Encode (member.MemberType); Encode (member.Name); - values [i].EncodeAttributeValue (null, this, member.MemberType); + values [i].EncodeAttributeValue (null, this, member.MemberType, member.MemberType); } } 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 bea0ee06df..72f3a9c362 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cfold.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cfold.cs @@ -367,8 +367,8 @@ namespace Mono.CSharp { return null; result = result.Reduce (ec, lt); - if (result == null) - return null; + if (result == null || lt.IsEnum) + return result; return new EnumConstant (result, lt); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs index 2b8b8d0e14..02f1b654c9 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs @@ -424,7 +424,7 @@ namespace Mono.CSharp } public TypeSpec CurrentType { - get { return tc.Parent.CurrentType; } + get { return tc.PartialContainer.CurrentType; } } public TypeParameters CurrentTypeParameters { @@ -736,6 +736,8 @@ namespace Mono.CSharp } } + public ParametersCompiled PrimaryConstructorParameters { get; set; } + public TypeParameters TypeParametersAll { get { return all_type_parameters; @@ -833,6 +835,9 @@ namespace Mono.CSharp if (symbol is TypeParameter) { Report.Error (692, symbol.Location, "Duplicate type parameter `{0}'", symbol.GetSignatureForError ()); + } else if (symbol is PrimaryConstructorField && mc is TypeParameter) { + Report.Error (9003, symbol.Location, "Primary constructor of type `{0}' has parameter of same name as type parameter `{1}'", + symbol.Parent.GetSignatureForError (), symbol.GetSignatureForError ()); } else { Report.Error (102, symbol.Location, "The type `{0}' already contains a definition for `{1}'", @@ -1033,9 +1038,20 @@ namespace Mono.CSharp for (int i = 0; i < initialized_fields.Count; ++i) { FieldInitializer fi = initialized_fields [i]; + + // + // Clone before resolving otherwise when field initializer is needed + // in more than 1 constructor any resolve after the initial one would + // only took the resolved expression which is problem for expressions + // that generate extra expressions or code during Resolve phase + // + var cloned = fi.Clone (new CloneContext ()); + ExpressionStatement s = fi.ResolveStatement (ec); - if (s == null) + if (s == null) { + initialized_fields [i] = new FieldInitializer (fi.Field, ErrorExpression.Instance, Location.Null); continue; + } // // Field is re-initialized to its default value => removed @@ -1045,6 +1061,7 @@ namespace Mono.CSharp ec.AssignmentInfoOffset += fi.AssignmentOffset; ec.CurrentBlock.AddScopeStatement (new StatementExpression (s)); + initialized_fields [i] = (FieldInitializer) cloned; } } @@ -1530,6 +1547,14 @@ namespace Mono.CSharp PartialContainer.containers.AddRange (containers); } + if (PrimaryConstructorParameters != null) { + if (PartialContainer.PrimaryConstructorParameters != null) { + Report.Error (9001, Location, "Only one part of a partial type can declare primary constructor parameters"); + } else { + PartialContainer.PrimaryConstructorParameters = PrimaryConstructorParameters; + } + } + members_defined = members_defined_ok = true; caching_flags |= Flags.CloseTypeCreated; } else { @@ -1682,6 +1707,10 @@ namespace Mono.CSharp return; foreach (var member in members) { + var pbm = member as PropertyBasedMember; + if (pbm != null) + pbm.PrepareEmit (); + var pm = member as IParametersMember; if (pm != null) { var mc = member as MethodOrOperator; @@ -1694,6 +1723,7 @@ namespace Mono.CSharp continue; ((ParametersCompiled) p).ResolveDefaultValues (member); + continue; } var c = member as Const; @@ -2033,10 +2063,10 @@ namespace Mono.CSharp foreach (var member in members) { if (member is Event) { // - // An event can be assigned from same class only, so we can report + // An event can be assigned from same class only, report // this warning for all accessibility modes // - if (!member.IsUsed) + if (!member.IsUsed && !PartialContainer.HasStructLayout) Report.Warning (67, 3, member.Location, "The event `{0}' is never used", member.GetSignatureForError ()); continue; @@ -2054,12 +2084,15 @@ namespace Mono.CSharp continue; if (!member.IsUsed) { - if ((member.caching_flags & Flags.IsAssigned) == 0) { - Report.Warning (169, 3, member.Location, "The private field `{0}' is never used", member.GetSignatureForError ()); - } else { - Report.Warning (414, 3, member.Location, "The private field `{0}' is assigned but its value is never used", - member.GetSignatureForError ()); + if (!PartialContainer.HasStructLayout) { + if ((member.caching_flags & Flags.IsAssigned) == 0) { + Report.Warning (169, 3, member.Location, "The private field `{0}' is never used", member.GetSignatureForError ()); + } else { + Report.Warning (414, 3, member.Location, "The private field `{0}' is assigned but its value is never used", + member.GetSignatureForError ()); + } } + continue; } @@ -2522,12 +2555,15 @@ namespace Mono.CSharp public const TypeAttributes StaticClassAttribute = TypeAttributes.Abstract | TypeAttributes.Sealed; SecurityType declarative_security; + protected Constructor generated_primary_constructor; protected ClassOrStruct (TypeContainer parent, MemberName name, Attributes attrs, MemberKind kind) : base (parent, name, attrs, kind) { } + public Arguments PrimaryConstructorBaseArguments { get; set; } + protected override TypeAttributes TypeAttr { get { TypeAttributes ta = base.TypeAttr; @@ -2555,6 +2591,12 @@ namespace Mono.CSharp symbol.GetSignatureForError ()); return; } + + if (symbol is PrimaryConstructorField) { + Report.Error (9004, symbol.Location, "Primary constructor of type `{0}' has parameter of same name as containing type", + symbol.Parent.GetSignatureForError ()); + return; + } InterfaceMemberBase imb = symbol as InterfaceMemberBase; if (imb == null || !imb.IsExplicitImpl) { @@ -2605,11 +2647,15 @@ namespace Mono.CSharp mods = ((ModFlags & Modifiers.ABSTRACT) != 0) ? Modifiers.PROTECTED : Modifiers.PUBLIC; } - var c = new Constructor (this, MemberName.Name, mods, null, ParametersCompiled.EmptyReadOnlyParameters, Location); - c.Initializer = new GeneratedBaseInitializer (Location); + var c = new Constructor (this, MemberName.Name, mods, null, PrimaryConstructorParameters ?? ParametersCompiled.EmptyReadOnlyParameters, Location); + if (Kind == MemberKind.Class) + c.Initializer = new GeneratedBaseInitializer (Location, PrimaryConstructorBaseArguments); + + if (PrimaryConstructorParameters != null) + c.IsPrimaryConstructor = true; AddConstructor (c, true); - c.Block = new ToplevelBlock (Compiler, ParametersCompiled.EmptyReadOnlyParameters, Location) { + c.Block = new ToplevelBlock (Compiler, c.ParameterInfo, Location) { IsCompilerGenerated = true }; @@ -2620,6 +2666,19 @@ namespace Mono.CSharp { CheckProtectedModifier (); + if (PrimaryConstructorParameters != null) { + foreach (Parameter p in PrimaryConstructorParameters.FixedParameters) { + if ((p.ModFlags & Parameter.Modifier.RefOutMask) != 0) + continue; + + var f = new PrimaryConstructorField (this, p); + AddField (f); + + generated_primary_constructor.Block.AddStatement ( + new StatementExpression (new PrimaryConstructorAssign (f, p), p.Location)); + } + } + base.DoDefineMembers (); return true; @@ -2659,7 +2718,7 @@ namespace Mono.CSharp Modifiers.SEALED | Modifiers.STATIC | Modifiers.UNSAFE; - + public Class (TypeContainer parent, MemberName name, Modifiers mod, Attributes attrs) : base (parent, name, attrs, MemberKind.Class) { @@ -2729,6 +2788,11 @@ namespace Mono.CSharp } if (IsStatic) { + if (PrimaryConstructorParameters != null) { + Report.Error (-800, Location, "`{0}': Static classes cannot have primary constructor", GetSignatureForError ()); + PrimaryConstructorParameters = null; + } + foreach (var m in Members) { if (m is Operator) { Report.Error (715, m.Location, "`{0}': Static classes cannot contain user-defined operators", m.GetSignatureForError ()); @@ -2756,8 +2820,8 @@ namespace Mono.CSharp Report.Error (708, m.Location, "`{0}': cannot declare instance members in a static class", m.GetSignatureForError ()); } } else { - if (!PartialContainer.HasInstanceConstructor) - DefineDefaultConstructor (false); + if (!PartialContainer.HasInstanceConstructor || PrimaryConstructorParameters != null) + generated_primary_constructor = DefineDefaultConstructor (false); } return base.DoDefineMembers (); @@ -2979,6 +3043,14 @@ namespace Mono.CSharp return fts.CheckStructCycles (); } + protected override bool DoDefineMembers () + { + if (PrimaryConstructorParameters != null) + generated_primary_constructor = DefineDefaultConstructor (false); + + return base.DoDefineMembers (); + } + public override void Emit () { CheckStructCycles (); @@ -3687,25 +3759,29 @@ namespace Mono.CSharp Report.SymbolRelatedToPreviousError (MemberType); if (this is Property) Report.Error (53, Location, - "Inconsistent accessibility: property type `" + - MemberType.GetSignatureForError () + "' is less " + - "accessible than property `" + GetSignatureForError () + "'"); + "Inconsistent accessibility: property type `" + + MemberType.GetSignatureForError () + "' is less " + + "accessible than property `" + GetSignatureForError () + "'"); else if (this is Indexer) Report.Error (54, Location, - "Inconsistent accessibility: indexer return type `" + - MemberType.GetSignatureForError () + "' is less " + - "accessible than indexer `" + GetSignatureForError () + "'"); + "Inconsistent accessibility: indexer return type `" + + MemberType.GetSignatureForError () + "' is less " + + "accessible than indexer `" + GetSignatureForError () + "'"); else if (this is MethodCore) { if (this is Operator) Report.Error (56, Location, - "Inconsistent accessibility: return type `" + - MemberType.GetSignatureForError () + "' is less " + - "accessible than operator `" + GetSignatureForError () + "'"); + "Inconsistent accessibility: return type `" + + MemberType.GetSignatureForError () + "' is less " + + "accessible than operator `" + GetSignatureForError () + "'"); else Report.Error (50, Location, - "Inconsistent accessibility: return type `" + - MemberType.GetSignatureForError () + "' is less " + - "accessible than method `" + GetSignatureForError () + "'"); + "Inconsistent accessibility: return type `" + + MemberType.GetSignatureForError () + "' is less " + + "accessible than method `" + GetSignatureForError () + "'"); + } else if (this is Event) { + Report.Error (7025, Location, + "Inconsistent accessibility: event type `{0}' is less accessible than event `{1}'", + MemberType.GetSignatureForError (), GetSignatureForError ()); } else { Report.Error (52, Location, "Inconsistent accessibility: field type `" + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/codegen.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/codegen.cs index bb65071203..7f7ccb3323 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/codegen.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/codegen.cs @@ -175,6 +175,12 @@ namespace Mono.CSharp } } + public bool NotifyEvaluatorOnStore { + get { + return Module.Evaluator != null && Module.Evaluator.ModificationListener != null; + } + } + // Has to be used for specific emitter errors only any // possible resolver errors have to be reported during Resolve public Report Report { @@ -204,6 +210,10 @@ namespace Mono.CSharp } } + public LocalVariable AsyncThrowVariable { get; set; } + + public List TryFinallyUnwind { get; set; } + #endregion public void AddStatementEpilog (IExpressionCleanup cleanupExpression) @@ -279,11 +289,21 @@ namespace Mono.CSharp ig.BeginCatchBlock (type.GetMetaInfo ()); } + public void BeginFilterHandler () + { + ig.BeginCatchBlock (null); + } + public void BeginExceptionBlock () { ig.BeginExceptionBlock (); } + public void BeginExceptionFilterBlock () + { + ig.BeginExceptFilterBlock (); + } + public void BeginFinallyBlock () { ig.BeginFinallyBlock (); @@ -370,9 +390,9 @@ namespace Mono.CSharp // // Creates temporary field in current async storey // - public StackFieldExpr GetTemporaryField (TypeSpec type) + public StackFieldExpr GetTemporaryField (TypeSpec type, bool initializedFieldRequired = false) { - var f = AsyncTaskStorey.AddCapturedLocalVariable (type); + var f = AsyncTaskStorey.AddCapturedLocalVariable (type, initializedFieldRequired); var fexpr = new StackFieldExpr (f); fexpr.InstanceExpression = new CompilerGeneratedThis (CurrentType, Location.Null); return fexpr; @@ -508,8 +528,16 @@ namespace Mono.CSharp type = EnumSpec.GetUnderlyingType (type); switch (type.BuiltinType) { - case BuiltinTypeSpec.Type.Byte: case BuiltinTypeSpec.Type.Bool: + // + // Workaround MSIL limitation. Load bool element as single bit, + // bool array can actually store any byte value + // + ig.Emit (OpCodes.Ldelem_U1); + ig.Emit (OpCodes.Ldc_I4_1); + ig.Emit (OpCodes.And); + break; + case BuiltinTypeSpec.Type.Byte: ig.Emit (OpCodes.Ldelem_U1); break; case BuiltinTypeSpec.Type.SByte: @@ -724,8 +752,12 @@ namespace Mono.CSharp ig.Emit (OpCodes.Ldind_U1); break; case BuiltinTypeSpec.Type.SByte: + ig.Emit (OpCodes.Ldind_I1); + break; case BuiltinTypeSpec.Type.Bool: ig.Emit (OpCodes.Ldind_I1); + ig.Emit (OpCodes.Ldc_I4_1); + ig.Emit (OpCodes.And); break; case BuiltinTypeSpec.Type.ULong: case BuiltinTypeSpec.Type.Long: @@ -1026,7 +1058,7 @@ namespace Mono.CSharp } } - if (call_op == OpCodes.Callvirt && (InstanceExpression.Type.IsGenericParameter || InstanceExpression.Type.IsStruct)) { + if (call_op == OpCodes.Callvirt && (InstanceExpression.Type.IsGenericParameter || InstanceExpression.Type.IsStructOrEnum)) { ec.Emit (OpCodes.Constrained, InstanceExpression.Type); } @@ -1066,7 +1098,7 @@ namespace Mono.CSharp // // Push the instance expression // - if ((instance_type.IsStruct && (callOpcode == OpCodes.Callvirt || (callOpcode == OpCodes.Call && declaringType.IsStruct))) || + if ((instance_type.IsStructOrEnum && (callOpcode == OpCodes.Callvirt || (callOpcode == OpCodes.Call && declaringType.IsStruct))) || instance_type.IsGenericParameter || declaringType.IsNullableType) { // // If the expression implements IMemoryLocation, then @@ -1088,7 +1120,7 @@ namespace Mono.CSharp return ReferenceContainer.MakeType (ec.Module, instance_type); } - if (instance_type.IsEnum || instance_type.IsStruct) { + if (instance_type.IsStructOrEnum) { instance.Emit (ec); ec.Emit (OpCodes.Box, instance_type); return ec.BuiltinTypes.Object; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/complete.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/complete.cs index f66a7bd9fb..3504302d58 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/complete.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/complete.cs @@ -210,5 +210,17 @@ namespace Mono.CSharp { // Nothing } } + + public class EmptyCompletion : CompletingExpression + { + protected override void CloneTo (CloneContext clonectx, Expression target) + { + } + + protected override Expression DoResolve (ResolveContext rc) + { + throw new CompletionResult ("", new string [0]); + } + } } 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 ec2ee12f71..36f4a62a95 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/constant.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/constant.cs @@ -528,7 +528,7 @@ namespace Mono.CSharp { return Value ? 1 : 0; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { enc.Encode (Value); } @@ -579,7 +579,7 @@ namespace Mono.CSharp { Value = v; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { enc.Encode (Value); } @@ -679,7 +679,7 @@ namespace Mono.CSharp { Value = v; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { enc.Encode ((ushort) Value); } @@ -807,7 +807,7 @@ namespace Mono.CSharp { Value = v; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { enc.Encode (Value); } @@ -910,7 +910,7 @@ namespace Mono.CSharp { Value = v; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { enc.Encode (Value); } @@ -1023,7 +1023,7 @@ namespace Mono.CSharp { Value = v; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { enc.Encode (Value); } @@ -1132,7 +1132,7 @@ namespace Mono.CSharp { Value = v; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { enc.Encode (Value); } @@ -1308,7 +1308,7 @@ namespace Mono.CSharp { Value = v; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { enc.Encode (Value); } @@ -1425,7 +1425,7 @@ namespace Mono.CSharp { Value = v; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { enc.Encode (Value); } @@ -1556,7 +1556,7 @@ namespace Mono.CSharp { Value = v; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { enc.Encode (Value); } @@ -1680,7 +1680,7 @@ namespace Mono.CSharp { return base.ConvertImplicitly (type); } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { enc.Encode (Value); } @@ -1809,7 +1809,7 @@ namespace Mono.CSharp { Value = v; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { enc.Encode (Value); } @@ -2094,7 +2094,7 @@ namespace Mono.CSharp { ec.Emit (OpCodes.Ldstr, Value); } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { // cast to object if (type != targetType) @@ -2159,7 +2159,7 @@ namespace Mono.CSharp { return base.CreateExpressionTree (ec); } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { switch (targetType.BuiltinType) { case BuiltinTypeSpec.Type.Object: @@ -2180,7 +2180,7 @@ namespace Mono.CSharp { break; } - base.EncodeAttributeValue (rc, enc, targetType); + base.EncodeAttributeValue (rc, enc, targetType, parameterType); } public override void Emit (EmitContext ec) @@ -2320,6 +2320,11 @@ namespace Mono.CSharp { } } + public override bool ContainsEmitWithAwait () + { + return side_effect.ContainsEmitWithAwait (); + } + public override object GetValue () { return value.GetValue (); @@ -2347,6 +2352,11 @@ namespace Mono.CSharp { value.EmitSideEffect (ec); } + public override void FlowAnalysis (FlowAnalysisContext fc) + { + side_effect.FlowAnalysis (fc); + } + public override bool IsDefaultValue { get { return value.IsDefaultValue; } } 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 8cbaeff0c5..873c92d24e 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/context.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/context.cs @@ -664,7 +664,7 @@ namespace Mono.CSharp ConstructorScope = 1 << 3, - AsyncBody = 1 << 4 + AsyncBody = 1 << 4, } // utility helper for CheckExpr, UnCheckExpr, Checked and Unchecked statements 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 6fc03b11d9..00be96b40a 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/convert.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/convert.cs @@ -71,19 +71,14 @@ namespace Mono.CSharp { // From T to a type parameter U, provided T depends on U // if (target_type.IsGenericParameter) { - if (expr_type.TypeArguments != null) { - foreach (var targ in expr_type.TypeArguments) { - if (!TypeSpecComparer.Override.IsEqual (target_type, targ)) - continue; - - if (expr == null) - return EmptyExpression.Null; + if (expr_type.TypeArguments != null && expr_type.HasDependencyOn (target_type)) { + if (expr == null) + return EmptyExpression.Null; - if (expr_type.IsReferenceType && !((TypeParameterSpec)target_type).IsReferenceType) - return new BoxedCast (expr, target_type); + if (expr_type.IsReferenceType && !((TypeParameterSpec) target_type).IsReferenceType) + return new BoxedCast (expr, target_type); - return new ClassCast (expr, target_type); - } + return new ClassCast (expr, target_type); } return null; @@ -131,38 +126,39 @@ namespace Mono.CSharp { return null; } - static Expression ExplicitTypeParameterConversion (Expression source, TypeSpec source_type, TypeSpec target_type) + static Expression ExplicitTypeParameterConversionFromT (Expression source, TypeSpec source_type, TypeSpec target_type) { var target_tp = target_type as TypeParameterSpec; if (target_tp != null) { - if (target_tp.TypeArguments != null) { - foreach (var targ in target_tp.TypeArguments) { - if (!TypeSpecComparer.Override.IsEqual (source_type, targ)) - continue; - - return source == null ? EmptyExpression.Null : new ClassCast (source, target_type); - } - } -/* - if (target_tp.Interfaces != null) { - foreach (TypeSpec iface in target_tp.Interfaces) { - if (!TypeManager.IsGenericParameter (iface)) - continue; - - if (TypeManager.IsSubclassOf (source_type, iface)) - return source == null ? EmptyExpression.Null : new ClassCast (source, target_type, true); - } + // + // From a type parameter U to T, provided T depends on U + // + if (target_tp.TypeArguments != null && target_tp.HasDependencyOn (source_type)) { + return source == null ? EmptyExpression.Null : new ClassCast (source, target_type); } -*/ - return null; } + // + // From T to any interface-type I provided there is not already an implicit conversion from T to I + // if (target_type.IsInterface) return source == null ? EmptyExpression.Null : new ClassCast (source, target_type, true); return null; } + static Expression ExplicitTypeParameterConversionToT (Expression source, TypeSpec source_type, TypeParameterSpec target_type) + { + // + // From the effective base class C of T to T and from any base class of C to T + // + var effective = target_type.GetEffectiveBase (); + if (TypeSpecComparer.IsEqual (effective, source_type) || TypeSpec.IsBaseClass (effective, source_type, false)) + return source == null ? EmptyExpression.Null : new ClassCast (source, target_type); + + return null; + } + public static Expression ImplicitReferenceConversion (Expression expr, TypeSpec target_type, bool explicit_cast) { TypeSpec expr_type = expr.Type; @@ -1467,6 +1463,7 @@ namespace Mono.CSharp { return e; source.Error_ValueCannotBeConverted (ec, target_type, false); + return null; } @@ -1820,10 +1817,10 @@ namespace Mono.CSharp { return source == null ? EmptyExpression.Null : new UnboxCast (source, target_type); // - // Explicit type parameter conversion. + // Explicit type parameter conversion from T // if (source_type.Kind == MemberKind.TypeParameter) - return ExplicitTypeParameterConversion (source, source_type, target_type); + return ExplicitTypeParameterConversionFromT (source, source_type, target_type); bool target_is_value_type = target_type.Kind == MemberKind.Struct || target_type.Kind == MemberKind.Enum; @@ -1857,6 +1854,9 @@ namespace Mono.CSharp { // From any interface-type S to to any class type T, provided T is not // sealed, or provided T implements S. // + // This also covers Explicit conversions involving type parameters + // section From any interface type to T + // if (source_type.Kind == MemberKind.Interface) { if (!target_type.IsSealed || target_type.ImplementsInterface (source_type, true)) { if (source == null) @@ -1901,10 +1901,23 @@ namespace Mono.CSharp { if (source_array.Rank == target_array.Rank) { source_type = source_array.Element; - if (!TypeSpec.IsReferenceType (source_type)) - return null; - var target_element = target_array.Element; + + // + // LAMESPEC: Type parameters are special cased somehow but + // only when both source and target elements are type parameters + // + if ((source_type.Kind & target_element.Kind & MemberKind.TypeParameter) == MemberKind.TypeParameter) { + // + // Conversion is allowed unless source element type has struct constrain + // + if (TypeSpec.IsValueType (source_type)) + return null; + } else { + if (!TypeSpec.IsReferenceType (source_type)) + return null; + } + if (!TypeSpec.IsReferenceType (target_element)) return null; @@ -1979,6 +1992,10 @@ namespace Mono.CSharp { return source == null ? EmptyExpression.Null : new ClassCast (source, target_type); } + var tps = target_type as TypeParameterSpec; + if (tps != null) + return ExplicitTypeParameterConversionToT (source, source_type, tps); + return null; } 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 e8e4cfa0f7..64b8c1f09d 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 @@ -37,7 +37,8 @@ namespace Mono.CSharp Arglist = 1 << 5, DefaultValue = 1 << 6, - All = Ref | Out | This | Params | Arglist | DefaultValue + All = Ref | Out | This | Params | Arglist | DefaultValue, + PrimaryConstructor = Ref | Out | Params | DefaultValue } static readonly object ModifierNone = 0; @@ -302,7 +303,7 @@ namespace Mono.CSharp //t "$$10 :", //t "$$11 :", //t "$$12 :", -//t "struct_declaration : opt_attributes opt_modifiers opt_partial STRUCT $$8 type_declaration_name $$9 opt_class_base opt_type_parameter_constraints_clauses $$10 OPEN_BRACE $$11 opt_class_member_declarations CLOSE_BRACE $$12 opt_semicolon", +//t "struct_declaration : opt_attributes opt_modifiers opt_partial STRUCT $$8 type_declaration_name $$9 opt_primary_parameters opt_class_base opt_type_parameter_constraints_clauses $$10 OPEN_BRACE $$11 opt_class_member_declarations CLOSE_BRACE $$12 opt_semicolon", //t "struct_declaration : opt_attributes opt_modifiers opt_partial STRUCT error", //t "$$13 :", //t "constant_declaration : opt_attributes opt_modifiers CONST type IDENTIFIER $$13 constant_initializer opt_constant_declarators SEMICOLON", @@ -634,6 +635,7 @@ namespace Mono.CSharp //t "member_access : primary_expression DOT identifier_inside_body opt_type_argument_list", //t "member_access : builtin_types DOT identifier_inside_body opt_type_argument_list", //t "member_access : BASE DOT identifier_inside_body opt_type_argument_list", +//t "member_access : AWAIT DOT identifier_inside_body opt_type_argument_list", //t "member_access : qualified_alias_member identifier_inside_body opt_type_argument_list", //t "member_access : primary_expression DOT GENERATE_COMPLETION", //t "member_access : primary_expression DOT IDENTIFIER GENERATE_COMPLETION", @@ -699,12 +701,15 @@ namespace Mono.CSharp //t "$$64 :", //t "new_expr_type : $$64 simple_type", //t "anonymous_type_expression : NEW OPEN_BRACE anonymous_type_parameters_opt_comma CLOSE_BRACE", +//t "anonymous_type_expression : NEW OPEN_BRACE GENERATE_COMPLETION", //t "anonymous_type_parameters_opt_comma : anonymous_type_parameters_opt", //t "anonymous_type_parameters_opt_comma : anonymous_type_parameters COMMA", //t "anonymous_type_parameters_opt :", //t "anonymous_type_parameters_opt : anonymous_type_parameters", //t "anonymous_type_parameters : anonymous_type_parameter", //t "anonymous_type_parameters : anonymous_type_parameters COMMA anonymous_type_parameter", +//t "anonymous_type_parameters : COMPLETE_COMPLETION", +//t "anonymous_type_parameters : anonymous_type_parameter COMPLETE_COMPLETION", //t "anonymous_type_parameter : identifier_inside_body ASSIGN variable_initializer", //t "anonymous_type_parameter : identifier_inside_body", //t "anonymous_type_parameter : member_access", @@ -789,6 +794,8 @@ namespace Mono.CSharp //t "additive_expression : additive_expression MINUS error", //t "additive_expression : additive_expression AS error", //t "additive_expression : additive_expression IS error", +//t "additive_expression : AWAIT IS type", +//t "additive_expression : AWAIT AS type", //t "shift_expression : additive_expression", //t "shift_expression : shift_expression OP_SHIFT_LEFT additive_expression", //t "shift_expression : shift_expression OP_SHIFT_RIGHT additive_expression", @@ -878,11 +885,19 @@ namespace Mono.CSharp //t "undocumented_expressions : MAKEREF open_parens_any expression CLOSE_PARENS", //t "constant_expression : expression", //t "boolean_expression : expression", +//t "opt_primary_parameters :", +//t "opt_primary_parameters : primary_parameters", +//t "primary_parameters : OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS", +//t "opt_primary_parameters_with_class_base :", +//t "opt_primary_parameters_with_class_base : class_base", +//t "opt_primary_parameters_with_class_base : primary_parameters", //t "$$77 :", +//t "opt_primary_parameters_with_class_base : primary_parameters class_base OPEN_PARENS $$77 opt_argument_list CLOSE_PARENS", //t "$$78 :", //t "$$79 :", //t "$$80 :", -//t "class_declaration : opt_attributes opt_modifiers opt_partial CLASS $$77 type_declaration_name $$78 opt_class_base opt_type_parameter_constraints_clauses $$79 OPEN_BRACE opt_class_member_declarations CLOSE_BRACE $$80 opt_semicolon", +//t "$$81 :", +//t "class_declaration : opt_attributes opt_modifiers opt_partial CLASS $$78 type_declaration_name $$79 opt_primary_parameters_with_class_base opt_type_parameter_constraints_clauses $$80 OPEN_BRACE opt_class_member_declarations CLOSE_BRACE $$81 opt_semicolon", //t "opt_partial :", //t "opt_partial : PARTIAL", //t "opt_modifiers :", @@ -905,8 +920,9 @@ namespace Mono.CSharp //t "modifier : UNSAFE", //t "modifier : ASYNC", //t "opt_class_base :", -//t "opt_class_base : COLON type_list", -//t "opt_class_base : COLON type_list error", +//t "opt_class_base : class_base", +//t "class_base : COLON type_list", +//t "class_base : COLON type_list error", //t "opt_type_parameter_constraints_clauses :", //t "opt_type_parameter_constraints_clauses : type_parameter_constraints_clauses", //t "type_parameter_constraints_clauses : type_parameter_constraints_clause", @@ -923,15 +939,15 @@ namespace Mono.CSharp //t "opt_type_parameter_variance : type_parameter_variance", //t "type_parameter_variance : OUT", //t "type_parameter_variance : IN", -//t "$$81 :", -//t "block : OPEN_BRACE $$81 opt_statement_list block_end", +//t "$$82 :", +//t "block : OPEN_BRACE $$82 opt_statement_list block_end", //t "block_end : CLOSE_BRACE", //t "block_end : COMPLETE_COMPLETION", -//t "$$82 :", -//t "block_prepared : OPEN_BRACE $$82 opt_statement_list CLOSE_BRACE", -//t "block_prepared : CLOSE_BRACE", //t "$$83 :", -//t "block_prepared_strict : OPEN_BRACE $$83 opt_statement_list CLOSE_BRACE", +//t "block_prepared : OPEN_BRACE $$83 opt_statement_list CLOSE_BRACE", +//t "block_prepared : CLOSE_BRACE", +//t "$$84 :", +//t "block_prepared_strict : OPEN_BRACE $$84 opt_statement_list CLOSE_BRACE", //t "opt_statement_list :", //t "opt_statement_list : statement_list", //t "statement_list : statement", @@ -977,8 +993,8 @@ namespace Mono.CSharp //t "embedded_statement : labeled_statement", //t "embedded_statement : error", //t "empty_statement : SEMICOLON", -//t "$$84 :", -//t "labeled_statement : identifier_inside_body COLON $$84 statement", +//t "$$85 :", +//t "labeled_statement : identifier_inside_body COLON $$85 statement", //t "variable_type : variable_type_simple", //t "variable_type : variable_type_simple rank_specifiers", //t "variable_type_simple : primary_expression_or_type opt_nullable", @@ -992,10 +1008,10 @@ namespace Mono.CSharp //t "pointer_star : STAR", //t "identifier_inside_body : IDENTIFIER", //t "identifier_inside_body : AWAIT", -//t "$$85 :", -//t "block_variable_declaration : variable_type identifier_inside_body $$85 opt_local_variable_initializer opt_variable_declarators semicolon_or_handle_error_close_brace", //t "$$86 :", -//t "block_variable_declaration : CONST variable_type identifier_inside_body $$86 const_variable_initializer opt_const_declarators SEMICOLON", +//t "block_variable_declaration : variable_type identifier_inside_body $$86 opt_local_variable_initializer opt_variable_declarators semicolon_or_handle_error_close_brace", +//t "$$87 :", +//t "block_variable_declaration : CONST variable_type identifier_inside_body $$87 const_variable_initializer opt_const_declarators SEMICOLON", //t "semicolon_or_handle_error_close_brace : SEMICOLON", //t "semicolon_or_handle_error_close_brace : CLOSE_BRACE", //t "opt_local_variable_initializer :", @@ -1032,8 +1048,8 @@ namespace Mono.CSharp //t "if_statement : IF open_parens_any boolean_expression CLOSE_PARENS embedded_statement", //t "if_statement : IF open_parens_any boolean_expression CLOSE_PARENS embedded_statement ELSE embedded_statement", //t "if_statement : IF open_parens_any boolean_expression error", -//t "$$87 :", -//t "switch_statement : SWITCH open_parens_any expression CLOSE_PARENS OPEN_BRACE $$87 opt_switch_sections CLOSE_BRACE", +//t "$$88 :", +//t "switch_statement : SWITCH open_parens_any expression CLOSE_PARENS OPEN_BRACE $$88 opt_switch_sections CLOSE_BRACE", //t "switch_statement : SWITCH open_parens_any expression error", //t "opt_switch_sections :", //t "opt_switch_sections : switch_sections", @@ -1055,20 +1071,20 @@ namespace Mono.CSharp //t "do_statement : DO embedded_statement WHILE open_parens_any boolean_expression CLOSE_PARENS SEMICOLON", //t "do_statement : DO embedded_statement error", //t "do_statement : DO embedded_statement WHILE open_parens_any boolean_expression error", -//t "$$88 :", -//t "for_statement : FOR open_parens_any $$88 for_statement_cont", //t "$$89 :", -//t "for_statement_cont : opt_for_initializer SEMICOLON $$89 for_statement_condition", -//t "for_statement_cont : opt_for_initializer CLOSE_PARENS", +//t "for_statement : FOR open_parens_any $$89 for_statement_cont", //t "$$90 :", -//t "for_statement_condition : opt_for_condition SEMICOLON $$90 for_statement_end", +//t "for_statement_cont : opt_for_initializer SEMICOLON $$90 for_statement_condition", +//t "for_statement_cont : opt_for_initializer CLOSE_PARENS", +//t "$$91 :", +//t "for_statement_condition : opt_for_condition SEMICOLON $$91 for_statement_end", //t "for_statement_condition : boolean_expression CLOSE_PARENS", //t "for_statement_end : opt_for_iterator CLOSE_PARENS embedded_statement", //t "for_statement_end : error", //t "opt_for_initializer :", //t "opt_for_initializer : for_initializer", -//t "$$91 :", -//t "for_initializer : variable_type identifier_inside_body $$91 opt_local_variable_initializer opt_variable_declarators", +//t "$$92 :", +//t "for_initializer : variable_type identifier_inside_body $$92 opt_local_variable_initializer opt_variable_declarators", //t "for_initializer : statement_expression_list", //t "opt_for_condition :", //t "opt_for_condition : boolean_expression", @@ -1079,8 +1095,8 @@ namespace Mono.CSharp //t "statement_expression_list : statement_expression_list COMMA statement_expression", //t "foreach_statement : FOREACH open_parens_any type error", //t "foreach_statement : FOREACH open_parens_any type identifier_inside_body error", -//t "$$92 :", -//t "foreach_statement : FOREACH open_parens_any type identifier_inside_body IN expression CLOSE_PARENS $$92 embedded_statement", +//t "$$93 :", +//t "foreach_statement : FOREACH open_parens_any type identifier_inside_body IN expression CLOSE_PARENS $$93 embedded_statement", //t "foreach_statement : FOREACH open_parens_any type identifier_inside_body error", //t "foreach_statement : FOREACH open_parens_any type error", //t "jump_statement : break_statement", @@ -1114,23 +1130,25 @@ namespace Mono.CSharp //t "catch_clauses : catch_clauses catch_clause", //t "opt_identifier :", //t "opt_identifier : identifier_inside_body", -//t "catch_clause : CATCH block", -//t "$$93 :", -//t "catch_clause : CATCH open_parens_any type opt_identifier CLOSE_PARENS $$93 block_prepared_strict", +//t "catch_clause : CATCH opt_catch_filter block", +//t "$$94 :", +//t "catch_clause : CATCH open_parens_any type opt_identifier CLOSE_PARENS $$94 opt_catch_filter block_prepared", //t "catch_clause : CATCH open_parens_any error", //t "catch_clause : CATCH open_parens_any type opt_identifier CLOSE_PARENS error", +//t "opt_catch_filter :", +//t "opt_catch_filter : IF open_parens_any expression CLOSE_PARENS", //t "checked_statement : CHECKED block", //t "unchecked_statement : UNCHECKED block", -//t "$$94 :", -//t "unsafe_statement : UNSAFE $$94 block", +//t "$$95 :", +//t "unsafe_statement : UNSAFE $$95 block", //t "lock_statement : LOCK open_parens_any expression CLOSE_PARENS embedded_statement", //t "lock_statement : LOCK open_parens_any expression error", -//t "$$95 :", //t "$$96 :", -//t "fixed_statement : FIXED open_parens_any variable_type identifier_inside_body $$95 using_or_fixed_variable_initializer opt_using_or_fixed_variable_declarators CLOSE_PARENS $$96 embedded_statement", //t "$$97 :", +//t "fixed_statement : FIXED open_parens_any variable_type identifier_inside_body $$96 using_or_fixed_variable_initializer opt_using_or_fixed_variable_declarators CLOSE_PARENS $$97 embedded_statement", //t "$$98 :", -//t "using_statement : USING open_parens_any variable_type identifier_inside_body $$97 using_initialization CLOSE_PARENS $$98 embedded_statement", +//t "$$99 :", +//t "using_statement : USING open_parens_any variable_type identifier_inside_body $$98 using_initialization CLOSE_PARENS $$99 embedded_statement", //t "using_statement : USING open_parens_any expression CLOSE_PARENS embedded_statement", //t "using_statement : USING open_parens_any expression error", //t "using_initialization : using_or_fixed_variable_initializer opt_using_or_fixed_variable_declarators", @@ -1145,20 +1163,20 @@ namespace Mono.CSharp //t "first_from_clause : FROM_FIRST type identifier_inside_body IN expression", //t "nested_from_clause : FROM identifier_inside_body IN expression", //t "nested_from_clause : FROM type identifier_inside_body IN expression", -//t "$$99 :", -//t "from_clause : FROM identifier_inside_body IN $$99 expression_or_error", //t "$$100 :", -//t "from_clause : FROM type identifier_inside_body IN $$100 expression_or_error", +//t "from_clause : FROM identifier_inside_body IN $$100 expression_or_error", +//t "$$101 :", +//t "from_clause : FROM type identifier_inside_body IN $$101 expression_or_error", //t "query_body : query_body_clauses select_or_group_clause opt_query_continuation", //t "query_body : select_or_group_clause opt_query_continuation", //t "query_body : query_body_clauses COMPLETE_COMPLETION", //t "query_body : query_body_clauses error", //t "query_body : error", -//t "$$101 :", -//t "select_or_group_clause : SELECT $$101 expression_or_error", //t "$$102 :", +//t "select_or_group_clause : SELECT $$102 expression_or_error", //t "$$103 :", -//t "select_or_group_clause : GROUP $$102 expression_or_error $$103 by_expression", +//t "$$104 :", +//t "select_or_group_clause : GROUP $$103 expression_or_error $$104 by_expression", //t "by_expression : BY expression_or_error", //t "by_expression : error", //t "query_body_clauses : query_body_clause", @@ -1168,28 +1186,28 @@ namespace Mono.CSharp //t "query_body_clause : where_clause", //t "query_body_clause : join_clause", //t "query_body_clause : orderby_clause", -//t "$$104 :", -//t "let_clause : LET identifier_inside_body ASSIGN $$104 expression_or_error", //t "$$105 :", -//t "where_clause : WHERE $$105 expression_or_error", +//t "let_clause : LET identifier_inside_body ASSIGN $$105 expression_or_error", //t "$$106 :", +//t "where_clause : WHERE $$106 expression_or_error", //t "$$107 :", //t "$$108 :", -//t "join_clause : JOIN identifier_inside_body IN $$106 expression_or_error ON $$107 expression_or_error EQUALS $$108 expression_or_error opt_join_into", //t "$$109 :", +//t "join_clause : JOIN identifier_inside_body IN $$107 expression_or_error ON $$108 expression_or_error EQUALS $$109 expression_or_error opt_join_into", //t "$$110 :", //t "$$111 :", -//t "join_clause : JOIN type identifier_inside_body IN $$109 expression_or_error ON $$110 expression_or_error EQUALS $$111 expression_or_error opt_join_into", +//t "$$112 :", +//t "join_clause : JOIN type identifier_inside_body IN $$110 expression_or_error ON $$111 expression_or_error EQUALS $$112 expression_or_error opt_join_into", //t "opt_join_into :", //t "opt_join_into : INTO identifier_inside_body", -//t "$$112 :", -//t "orderby_clause : ORDERBY $$112 orderings", -//t "orderings : order_by", //t "$$113 :", -//t "orderings : order_by COMMA $$113 orderings_then_by", -//t "orderings_then_by : then_by", +//t "orderby_clause : ORDERBY $$113 orderings", +//t "orderings : order_by", //t "$$114 :", -//t "orderings_then_by : orderings_then_by COMMA $$114 then_by", +//t "orderings : order_by COMMA $$114 orderings_then_by", +//t "orderings_then_by : then_by", +//t "$$115 :", +//t "orderings_then_by : orderings_then_by COMMA $$115 then_by", //t "order_by : expression", //t "order_by : expression ASCENDING", //t "order_by : expression DESCENDING", @@ -1197,12 +1215,12 @@ namespace Mono.CSharp //t "then_by : expression ASCENDING", //t "then_by : expression DESCENDING", //t "opt_query_continuation :", -//t "$$115 :", -//t "opt_query_continuation : INTO identifier_inside_body $$115 query_body", +//t "$$116 :", +//t "opt_query_continuation : INTO identifier_inside_body $$116 query_body", //t "interactive_parsing : EVAL_STATEMENT_PARSER EOF", //t "interactive_parsing : EVAL_USING_DECLARATIONS_UNIT_PARSER using_directives opt_COMPLETE_COMPLETION", -//t "$$116 :", -//t "interactive_parsing : EVAL_STATEMENT_PARSER $$116 interactive_statement_list opt_COMPLETE_COMPLETION", +//t "$$117 :", +//t "interactive_parsing : EVAL_STATEMENT_PARSER $$117 interactive_statement_list opt_COMPLETE_COMPLETION", //t "interactive_parsing : EVAL_COMPILATION_UNIT_PARSER interactive_compilation_unit", //t "interactive_compilation_unit : opt_extern_alias_directives opt_using_directives", //t "interactive_compilation_unit : opt_extern_alias_directives opt_using_directives namespace_or_type_declarations", @@ -1213,18 +1231,19 @@ namespace Mono.CSharp //t "documentation_parsing : DOC_SEE doc_cref", //t "doc_cref : doc_type_declaration_name opt_doc_method_sig", //t "doc_cref : builtin_types opt_doc_method_sig", +//t "doc_cref : VOID opt_doc_method_sig", //t "doc_cref : builtin_types DOT IDENTIFIER opt_doc_method_sig", //t "doc_cref : doc_type_declaration_name DOT THIS", -//t "$$117 :", -//t "doc_cref : doc_type_declaration_name DOT THIS OPEN_BRACKET $$117 opt_doc_parameters CLOSE_BRACKET", +//t "$$118 :", +//t "doc_cref : doc_type_declaration_name DOT THIS OPEN_BRACKET $$118 opt_doc_parameters CLOSE_BRACKET", //t "doc_cref : EXPLICIT OPERATOR type opt_doc_method_sig", //t "doc_cref : IMPLICIT OPERATOR type opt_doc_method_sig", //t "doc_cref : OPERATOR overloadable_operator opt_doc_method_sig", //t "doc_type_declaration_name : type_declaration_name", //t "doc_type_declaration_name : doc_type_declaration_name DOT type_declaration_name", //t "opt_doc_method_sig :", -//t "$$118 :", -//t "opt_doc_method_sig : OPEN_PARENS $$118 opt_doc_parameters CLOSE_PARENS", +//t "$$119 :", +//t "opt_doc_method_sig : OPEN_PARENS $$119 opt_doc_parameters CLOSE_PARENS", //t "opt_doc_parameters :", //t "opt_doc_parameters : doc_parameters", //t "doc_parameters : doc_parameter", @@ -1473,20 +1492,20 @@ namespace Mono.CSharp yyVal = yyV > yyTop ? null : yyVals[yyV]; // yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]); switch (yyN) { case 1: -#line 387 "cs-parser.jay" +#line 388 "cs-parser.jay" { Lexer.check_incorrect_doc_comment (); } break; case 2: -#line 388 "cs-parser.jay" +#line 389 "cs-parser.jay" { Lexer.CompleteOnEOF = false; } break; case 6: case_6(); break; case 7: -#line 407 "cs-parser.jay" +#line 408 "cs-parser.jay" { module.AddAttributes ((Attributes) yyVals[0+yyTop], current_namespace); } @@ -1498,7 +1517,7 @@ case 13: case_13(); break; case 14: -#line 452 "cs-parser.jay" +#line 453 "cs-parser.jay" { Error_SyntaxError (yyToken); } @@ -1543,7 +1562,7 @@ case 43: case_43(); break; case 44: -#line 636 "cs-parser.jay" +#line 637 "cs-parser.jay" { current_namespace.DeclarationFound = true; } @@ -1582,15 +1601,15 @@ case 62: case_62(); break; case 63: -#line 761 "cs-parser.jay" +#line 762 "cs-parser.jay" { yyVal = "event"; PushLocation (GetLocation (yyVals[0+yyTop])); } break; case 64: -#line 762 "cs-parser.jay" +#line 763 "cs-parser.jay" { yyVal = "return"; PushLocation (GetLocation (yyVals[0+yyTop])); } break; case 65: -#line 769 "cs-parser.jay" +#line 770 "cs-parser.jay" { yyVal = new List (4) { (Attribute) yyVals[0+yyTop] }; } @@ -1599,7 +1618,7 @@ case 66: case_66(); break; case 67: -#line 786 "cs-parser.jay" +#line 787 "cs-parser.jay" { ++lexer.parsing_block; } @@ -1608,14 +1627,14 @@ case 68: case_68(); break; case 70: -#line 814 "cs-parser.jay" +#line 815 "cs-parser.jay" { yyVal = null; HadAttributeParens = false; } break; case 71: case_71(); break; case 72: -#line 826 "cs-parser.jay" +#line 827 "cs-parser.jay" { yyVal = null; } break; case 73: @@ -1631,7 +1650,7 @@ case 76: case_76(); break; case 77: -#line 870 "cs-parser.jay" +#line 871 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } @@ -1640,7 +1659,7 @@ case 79: case_79(); break; case 80: -#line 883 "cs-parser.jay" +#line 884 "cs-parser.jay" { ++lexer.parsing_block; } @@ -1652,38 +1671,32 @@ case 82: case_82(); break; case 83: -#line 909 "cs-parser.jay" +#line 910 "cs-parser.jay" { yyVal = null; } break; case 84: -#line 913 "cs-parser.jay" +#line 914 "cs-parser.jay" { yyVal = Argument.AType.Ref; } break; case 85: -#line 917 "cs-parser.jay" +#line 918 "cs-parser.jay" { yyVal = Argument.AType.Out; } break; case 88: -#line 929 "cs-parser.jay" - { - lexer.parsing_modifiers = true; - } + case_88(); break; case 89: -#line 933 "cs-parser.jay" - { - lexer.parsing_modifiers = true; - } + case_89(); break; case 102: case_102(); break; case 103: -#line 964 "cs-parser.jay" +#line 967 "cs-parser.jay" { } break; @@ -1703,7 +1716,7 @@ case 108: case_108(); break; case 109: -#line 1008 "cs-parser.jay" +#line 1017 "cs-parser.jay" { Error_SyntaxError (yyToken); } @@ -1718,13 +1731,13 @@ case 112: case_112(); break; case 115: -#line 1057 "cs-parser.jay" +#line 1066 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 116: -#line 1061 "cs-parser.jay" +#line 1070 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } @@ -1733,7 +1746,7 @@ case 117: case_117(); break; case 118: -#line 1077 "cs-parser.jay" +#line 1086 "cs-parser.jay" { ++lexer.parsing_block; } @@ -1757,7 +1770,7 @@ case 126: case_126(); break; case 127: -#line 1156 "cs-parser.jay" +#line 1165 "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"); } @@ -1769,13 +1782,13 @@ case 130: case_130(); break; case 133: -#line 1186 "cs-parser.jay" +#line 1195 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 134: -#line 1190 "cs-parser.jay" +#line 1199 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } @@ -1784,7 +1797,7 @@ case 135: case_135(); break; case 136: -#line 1203 "cs-parser.jay" +#line 1212 "cs-parser.jay" { ++lexer.parsing_block; } @@ -1793,13 +1806,13 @@ case 137: case_137(); break; case 140: -#line 1222 "cs-parser.jay" +#line 1231 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 141: -#line 1226 "cs-parser.jay" +#line 1235 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } @@ -1808,7 +1821,7 @@ case 142: case_142(); break; case 143: -#line 1242 "cs-parser.jay" +#line 1251 "cs-parser.jay" { ++lexer.parsing_block; } @@ -1829,7 +1842,7 @@ case 150: case_150(); break; case 151: -#line 1310 "cs-parser.jay" +#line 1319 "cs-parser.jay" { valid_param_mod = ParameterModifierType.All; } @@ -1841,7 +1854,7 @@ case 153: case_153(); break; case 154: -#line 1349 "cs-parser.jay" +#line 1358 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } @@ -1850,7 +1863,7 @@ case 155: case_155(); break; case 156: -#line 1359 "cs-parser.jay" +#line 1368 "cs-parser.jay" { lexer.ConstraintsParsing = true; } @@ -1865,11 +1878,11 @@ case 159: case_159(); break; case 161: -#line 1432 "cs-parser.jay" +#line 1441 "cs-parser.jay" { savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; } break; case 162: -#line 1436 "cs-parser.jay" +#line 1445 "cs-parser.jay" { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 164: @@ -1894,13 +1907,13 @@ case 170: case_170(); break; case 171: -#line 1508 "cs-parser.jay" +#line 1517 "cs-parser.jay" { yyVal = new ParametersCompiled (new Parameter[] { (Parameter) yyVals[0+yyTop] } ); } break; case 172: -#line 1512 "cs-parser.jay" +#line 1521 "cs-parser.jay" { yyVal = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation (yyVals[0+yyTop])) }, true); } @@ -1927,7 +1940,7 @@ case 179: case_179(); break; case 180: -#line 1593 "cs-parser.jay" +#line 1602 "cs-parser.jay" { ++lexer.parsing_block; } @@ -1936,11 +1949,11 @@ case 181: case_181(); break; case 182: -#line 1634 "cs-parser.jay" +#line 1643 "cs-parser.jay" { yyVal = Parameter.Modifier.NONE; } break; case 184: -#line 1642 "cs-parser.jay" +#line 1651 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } @@ -1973,7 +1986,7 @@ case 193: case_193(); break; case 194: -#line 1736 "cs-parser.jay" +#line 1745 "cs-parser.jay" { Error_DuplicateParameterModifier (GetLocation (yyVals[-1+yyTop]), Parameter.Modifier.PARAMS); } @@ -1994,7 +2007,7 @@ case 199: case_199(); break; case 200: -#line 1790 "cs-parser.jay" +#line 1799 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Params | ParameterModifierType.DefaultValue; } @@ -2003,7 +2016,7 @@ case 201: case_201(); break; case 202: -#line 1819 "cs-parser.jay" +#line 1828 "cs-parser.jay" { lexer.PropertyParsing = false; } @@ -2033,7 +2046,7 @@ case 215: case_215(); break; case 216: -#line 1967 "cs-parser.jay" +#line 1976 "cs-parser.jay" { } break; @@ -2050,55 +2063,49 @@ case 220: case_220(); break; case 221: -#line 2007 "cs-parser.jay" +#line 2016 "cs-parser.jay" { Error_SyntaxError (yyToken); } break; case 224: -#line 2019 "cs-parser.jay" - { - lexer.parsing_modifiers = true; - } + case_224(); break; case 225: -#line 2023 "cs-parser.jay" - { - lexer.parsing_modifiers = true; - } + case_225(); break; case 226: -#line 2030 "cs-parser.jay" +#line 2041 "cs-parser.jay" { report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; case 227: -#line 2034 "cs-parser.jay" +#line 2045 "cs-parser.jay" { report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; case 232: -#line 2042 "cs-parser.jay" +#line 2053 "cs-parser.jay" { report.Error (567, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain operators"); } break; case 233: -#line 2046 "cs-parser.jay" +#line 2057 "cs-parser.jay" { report.Error (526, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain contructors"); } break; case 234: -#line 2050 "cs-parser.jay" +#line 2061 "cs-parser.jay" { report.Error (524, GetLocation (yyVals[0+yyTop]), "Interfaces cannot declare classes, structs, interfaces, delegates, or enumerations"); } break; case 235: -#line 2056 "cs-parser.jay" +#line 2067 "cs-parser.jay" { } break; @@ -2106,14 +2113,14 @@ case 236: case_236(); break; case 238: -#line 2089 "cs-parser.jay" +#line 2100 "cs-parser.jay" { savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; } break; case 240: case_240(); break; case 241: -#line 2105 "cs-parser.jay" +#line 2116 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } @@ -2122,95 +2129,95 @@ case 242: case_242(); break; case 244: -#line 2151 "cs-parser.jay" +#line 2162 "cs-parser.jay" { yyVal = Operator.OpType.LogicalNot; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 245: -#line 2152 "cs-parser.jay" +#line 2163 "cs-parser.jay" { yyVal = Operator.OpType.OnesComplement; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 246: -#line 2153 "cs-parser.jay" +#line 2164 "cs-parser.jay" { yyVal = Operator.OpType.Increment; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 247: -#line 2154 "cs-parser.jay" +#line 2165 "cs-parser.jay" { yyVal = Operator.OpType.Decrement; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 248: -#line 2155 "cs-parser.jay" +#line 2166 "cs-parser.jay" { yyVal = Operator.OpType.True; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 249: -#line 2156 "cs-parser.jay" +#line 2167 "cs-parser.jay" { yyVal = Operator.OpType.False; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 250: -#line 2158 "cs-parser.jay" +#line 2169 "cs-parser.jay" { yyVal = Operator.OpType.Addition; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 251: -#line 2159 "cs-parser.jay" +#line 2170 "cs-parser.jay" { yyVal = Operator.OpType.Subtraction; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 252: -#line 2161 "cs-parser.jay" +#line 2172 "cs-parser.jay" { yyVal = Operator.OpType.Multiply; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 253: -#line 2162 "cs-parser.jay" +#line 2173 "cs-parser.jay" { yyVal = Operator.OpType.Division; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 254: -#line 2163 "cs-parser.jay" +#line 2174 "cs-parser.jay" { yyVal = Operator.OpType.Modulus; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 255: -#line 2164 "cs-parser.jay" +#line 2175 "cs-parser.jay" { yyVal = Operator.OpType.BitwiseAnd; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 256: -#line 2165 "cs-parser.jay" +#line 2176 "cs-parser.jay" { yyVal = Operator.OpType.BitwiseOr; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 257: -#line 2166 "cs-parser.jay" +#line 2177 "cs-parser.jay" { yyVal = Operator.OpType.ExclusiveOr; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 258: -#line 2167 "cs-parser.jay" +#line 2178 "cs-parser.jay" { yyVal = Operator.OpType.LeftShift; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 259: -#line 2168 "cs-parser.jay" +#line 2179 "cs-parser.jay" { yyVal = Operator.OpType.RightShift; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 260: -#line 2169 "cs-parser.jay" +#line 2180 "cs-parser.jay" { yyVal = Operator.OpType.Equality; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 261: -#line 2170 "cs-parser.jay" +#line 2181 "cs-parser.jay" { yyVal = Operator.OpType.Inequality; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 262: -#line 2171 "cs-parser.jay" +#line 2182 "cs-parser.jay" { yyVal = Operator.OpType.GreaterThan; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 263: -#line 2172 "cs-parser.jay" +#line 2183 "cs-parser.jay" { yyVal = Operator.OpType.LessThan; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 264: -#line 2173 "cs-parser.jay" +#line 2184 "cs-parser.jay" { yyVal = Operator.OpType.GreaterThanOrEqual; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 265: -#line 2174 "cs-parser.jay" +#line 2185 "cs-parser.jay" { yyVal = Operator.OpType.LessThanOrEqual; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 266: -#line 2181 "cs-parser.jay" +#line 2192 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } @@ -2219,7 +2226,7 @@ case 267: case_267(); break; case 268: -#line 2204 "cs-parser.jay" +#line 2215 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } @@ -2246,11 +2253,11 @@ case 275: case_275(); break; case 277: -#line 2314 "cs-parser.jay" +#line 2325 "cs-parser.jay" { current_block = null; yyVal = null; } break; case 280: -#line 2326 "cs-parser.jay" +#line 2337 "cs-parser.jay" { ++lexer.parsing_block; } @@ -2259,7 +2266,7 @@ case 281: case_281(); break; case 282: -#line 2336 "cs-parser.jay" +#line 2347 "cs-parser.jay" { ++lexer.parsing_block; } @@ -2298,7 +2305,7 @@ case 293: case_293(); break; case 295: -#line 2463 "cs-parser.jay" +#line 2474 "cs-parser.jay" { ++lexer.parsing_block; } @@ -2307,13 +2314,13 @@ case 296: case_296(); break; case 299: -#line 2481 "cs-parser.jay" +#line 2492 "cs-parser.jay" { current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 300: -#line 2485 "cs-parser.jay" +#line 2496 "cs-parser.jay" { current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } @@ -2322,7 +2329,7 @@ case 301: case_301(); break; case 302: -#line 2498 "cs-parser.jay" +#line 2509 "cs-parser.jay" { ++lexer.parsing_block; } @@ -2334,7 +2341,7 @@ case 304: case_304(); break; case 305: -#line 2523 "cs-parser.jay" +#line 2534 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } @@ -2388,7 +2395,7 @@ case 325: case_325(); break; case 328: -#line 2711 "cs-parser.jay" +#line 2722 "cs-parser.jay" { lbag.AppendToMember (current_container, GetLocation (yyVals[0+yyTop])); } @@ -2409,7 +2416,7 @@ case 334: case_334(); break; case 336: -#line 2785 "cs-parser.jay" +#line 2796 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out | ParameterModifierType.Params | ParameterModifierType.DefaultValue; } @@ -2418,7 +2425,7 @@ case 337: case_337(); break; case 338: -#line 2804 "cs-parser.jay" +#line 2815 "cs-parser.jay" { lexer.ConstraintsParsing = false; } @@ -2451,7 +2458,7 @@ case 351: case_351(); break; case 352: -#line 2910 "cs-parser.jay" +#line 2921 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } @@ -2496,13 +2503,13 @@ case 367: case_367(); break; case 369: -#line 3035 "cs-parser.jay" +#line 3046 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } break; case 370: -#line 3042 "cs-parser.jay" +#line 3053 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } @@ -2517,7 +2524,7 @@ case 376: case_376(); break; case 378: -#line 3080 "cs-parser.jay" +#line 3091 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } @@ -2526,7 +2533,7 @@ case 379: case_379(); break; case 380: -#line 3099 "cs-parser.jay" +#line 3110 "cs-parser.jay" { yyVal = new ComposedCast ((ATypeNameExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } @@ -2535,13 +2542,13 @@ case 381: case_381(); break; case 382: -#line 3108 "cs-parser.jay" +#line 3119 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 383: -#line 3112 "cs-parser.jay" +#line 3123 "cs-parser.jay" { yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); } @@ -2556,63 +2563,63 @@ case 386: case_386(); break; case 387: -#line 3146 "cs-parser.jay" +#line 3157 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Object, GetLocation (yyVals[0+yyTop])); } break; case 388: -#line 3147 "cs-parser.jay" +#line 3158 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.String, GetLocation (yyVals[0+yyTop])); } break; case 389: -#line 3148 "cs-parser.jay" +#line 3159 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Bool, GetLocation (yyVals[0+yyTop])); } break; case 390: -#line 3149 "cs-parser.jay" +#line 3160 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Decimal, GetLocation (yyVals[0+yyTop])); } break; case 391: -#line 3150 "cs-parser.jay" +#line 3161 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Float, GetLocation (yyVals[0+yyTop])); } break; case 392: -#line 3151 "cs-parser.jay" +#line 3162 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Double, GetLocation (yyVals[0+yyTop])); } break; case 394: -#line 3156 "cs-parser.jay" +#line 3167 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.SByte, GetLocation (yyVals[0+yyTop])); } break; case 395: -#line 3157 "cs-parser.jay" +#line 3168 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Byte, GetLocation (yyVals[0+yyTop])); } break; case 396: -#line 3158 "cs-parser.jay" +#line 3169 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Short, GetLocation (yyVals[0+yyTop])); } break; case 397: -#line 3159 "cs-parser.jay" +#line 3170 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.UShort, GetLocation (yyVals[0+yyTop])); } break; case 398: -#line 3160 "cs-parser.jay" +#line 3171 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Int, GetLocation (yyVals[0+yyTop])); } break; case 399: -#line 3161 "cs-parser.jay" +#line 3172 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.UInt, GetLocation (yyVals[0+yyTop])); } break; case 400: -#line 3162 "cs-parser.jay" +#line 3173 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Long, GetLocation (yyVals[0+yyTop])); } break; case 401: -#line 3163 "cs-parser.jay" +#line 3174 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.ULong, GetLocation (yyVals[0+yyTop])); } break; case 402: -#line 3164 "cs-parser.jay" +#line 3175 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Char, GetLocation (yyVals[0+yyTop])); } break; case 423: @@ -2622,22 +2629,22 @@ case 424: case_424(); break; case 428: -#line 3211 "cs-parser.jay" +#line 3222 "cs-parser.jay" { yyVal = new NullLiteral (GetLocation (yyVals[0+yyTop])); } break; case 429: -#line 3215 "cs-parser.jay" +#line 3226 "cs-parser.jay" { yyVal = new BoolLiteral (compiler.BuiltinTypes, true, GetLocation (yyVals[0+yyTop])); } break; case 430: -#line 3216 "cs-parser.jay" +#line 3227 "cs-parser.jay" { yyVal = new BoolLiteral (compiler.BuiltinTypes, false, GetLocation (yyVals[0+yyTop])); } break; case 435: case_435(); break; case 436: -#line 3249 "cs-parser.jay" +#line 3260 "cs-parser.jay" { yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } @@ -2655,23 +2662,23 @@ case 440: case_440(); break; case 441: -#line 3281 "cs-parser.jay" + case_441(); + break; +case 442: +#line 3298 "cs-parser.jay" { yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null,GetLocation (yyVals[0+yyTop])); } break; -case 442: - case_442(); - break; case 443: -#line 3289 "cs-parser.jay" + case_443(); + break; +case 444: +#line 3306 "cs-parser.jay" { yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null, lexer.Location); } break; -case 444: - case_444(); - break; case 445: case_445(); break; @@ -2682,28 +2689,28 @@ case 447: case_447(); break; case 448: -#line 3319 "cs-parser.jay" - { yyVal = null; } + case_448(); break; -case 450: - case_450(); +case 449: +#line 3336 "cs-parser.jay" + { yyVal = null; } break; case 451: case_451(); break; case 452: -#line 3341 "cs-parser.jay" - { yyVal = null; } + case_452(); break; case 453: -#line 3345 "cs-parser.jay" +#line 3358 "cs-parser.jay" + { yyVal = null; } + break; +case 454: +#line 3362 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; -case 454: - case_454(); - break; case 455: case_455(); break; @@ -2717,26 +2724,26 @@ case 458: case_458(); break; case 459: -#line 3384 "cs-parser.jay" + case_459(); + break; +case 460: +#line 3401 "cs-parser.jay" { yyVal = new CompletionElementInitializer (null, GetLocation (yyVals[0+yyTop])); } break; -case 460: - case_460(); - break; case 461: case_461(); break; case 462: case_462(); break; -case 465: -#line 3415 "cs-parser.jay" - { yyVal = null; } +case 463: + case_463(); break; -case 467: - case_467(); +case 466: +#line 3432 "cs-parser.jay" + { yyVal = null; } break; case 468: case_468(); @@ -2751,14 +2758,14 @@ case 471: case_471(); break; case 472: -#line 3469 "cs-parser.jay" + case_472(); + break; +case 473: +#line 3486 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; -case 476: - case_476(); - break; case 477: case_477(); break; @@ -2768,8 +2775,8 @@ case 478: case 479: case_479(); break; -case 481: - case_481(); +case 480: + case_480(); break; case 482: case_482(); @@ -2790,38 +2797,38 @@ case 487: case_487(); break; case 488: -#line 3562 "cs-parser.jay" + case_488(); + break; +case 489: +#line 3579 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; -case 490: -#line 3570 "cs-parser.jay" +case 491: +#line 3587 "cs-parser.jay" { yyVal = new This (GetLocation (yyVals[0+yyTop])); } break; -case 491: - case_491(); - break; case 492: case_492(); break; case 493: -#line 3590 "cs-parser.jay" + case_493(); + break; +case 494: +#line 3607 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PostIncrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; -case 494: -#line 3597 "cs-parser.jay" +case 495: +#line 3614 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PostDecrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; -case 495: - case_495(); - break; case 496: case_496(); break; @@ -2841,26 +2848,29 @@ case 501: case_501(); break; case 502: -#line 3664 "cs-parser.jay" + case_502(); + break; +case 503: +#line 3681 "cs-parser.jay" { ++lexer.parsing_type; } break; -case 503: - case_503(); - break; case 504: case_504(); break; -case 507: -#line 3691 "cs-parser.jay" - { yyVal = null; } +case 505: + case_505(); break; -case 509: - case_509(); +case 506: +#line 3703 "cs-parser.jay" + { + yyVal = new EmptyCompletion (); + } break; -case 510: - case_510(); +case 509: +#line 3712 "cs-parser.jay" + { yyVal = null; } break; case 511: case_511(); @@ -2869,77 +2879,83 @@ case 512: case_512(); break; case 513: - case_513(); +#line 3734 "cs-parser.jay" + { + yyVal = new EmptyCompletion (); + } break; case 514: - case_514(); +#line 3738 "cs-parser.jay" + { + yyVal = yyVals[-1+yyTop]; + } + break; +case 515: + case_515(); + break; +case 516: + case_516(); + break; +case 517: + case_517(); break; case 518: case_518(); break; -case 519: - case_519(); +case 522: + case_522(); + break; +case 523: + case_523(); break; -case 520: - case_520(); +case 524: + case_524(); break; -case 521: -#line 3769 "cs-parser.jay" +case 525: +#line 3798 "cs-parser.jay" { yyVal = 2; } break; -case 522: -#line 3773 "cs-parser.jay" +case 526: +#line 3802 "cs-parser.jay" { yyVal = ((int) yyVals[-1+yyTop]) + 1; } break; -case 523: -#line 3780 "cs-parser.jay" +case 527: +#line 3809 "cs-parser.jay" { yyVal = null; } break; -case 524: -#line 3784 "cs-parser.jay" +case 528: +#line 3813 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; -case 525: - case_525(); +case 529: + case_529(); break; -case 526: - case_526(); +case 530: + case_530(); break; -case 527: - case_527(); +case 531: + case_531(); break; -case 528: - case_528(); +case 532: + case_532(); break; -case 529: -#line 3828 "cs-parser.jay" +case 533: +#line 3857 "cs-parser.jay" { lexer.TypeOfParsing = true; } break; -case 530: - case_530(); - break; -case 533: - case_533(); - break; case 534: case_534(); break; -case 535: - case_535(); - break; -case 536: - case_536(); - break; case 537: case_537(); break; @@ -2974,64 +2990,64 @@ case 547: case_547(); break; case 548: -#line 3971 "cs-parser.jay" - { - start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], false, GetLocation (yyVals[-1+yyTop])); - } + case_548(); break; case 549: case_549(); break; case 550: -#line 3984 "cs-parser.jay" - { - start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], true, GetLocation (yyVals[-2+yyTop])); - } + case_550(); break; case 551: case_551(); break; case 552: -#line 4001 "cs-parser.jay" +#line 4000 "cs-parser.jay" { - yyVal = ParametersCompiled.Undefined; + start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], false, GetLocation (yyVals[-1+yyTop])); } break; +case 553: + case_553(); + break; case 554: -#line 4009 "cs-parser.jay" +#line 4013 "cs-parser.jay" { - valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; + start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], true, GetLocation (yyVals[-2+yyTop])); } break; case 555: case_555(); break; case 556: - case_556(); +#line 4030 "cs-parser.jay" + { + yyVal = ParametersCompiled.Undefined; + } break; case 558: -#line 4035 "cs-parser.jay" +#line 4038 "cs-parser.jay" { - yyVal = new Unary (Unary.Operator.LogicalNot, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 559: -#line 4039 "cs-parser.jay" - { - yyVal = new Unary (Unary.Operator.OnesComplement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } + case_559(); break; case 560: case_560(); break; -case 561: - case_561(); - break; case 562: - case_562(); +#line 4064 "cs-parser.jay" + { + yyVal = new Unary (Unary.Operator.LogicalNot, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } break; case 563: - case_563(); +#line 4068 "cs-parser.jay" + { + yyVal = new Unary (Unary.Operator.OnesComplement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } break; case 564: case_564(); @@ -3039,60 +3055,63 @@ case 564: case 565: case_565(); break; +case 566: + case_566(); + break; case 567: -#line 4103 "cs-parser.jay" + case_567(); + break; +case 568: + case_568(); + break; +case 569: + case_569(); + break; +case 571: +#line 4132 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.UnaryPlus, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 568: -#line 4107 "cs-parser.jay" +case 572: +#line 4136 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.UnaryNegation, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 569: -#line 4111 "cs-parser.jay" +case 573: +#line 4140 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PreIncrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 570: -#line 4115 "cs-parser.jay" +case 574: +#line 4144 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PreDecrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 571: -#line 4119 "cs-parser.jay" +case 575: +#line 4148 "cs-parser.jay" { yyVal = new Indirection ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 572: -#line 4123 "cs-parser.jay" +case 576: +#line 4152 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.AddressOf, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; -case 573: - case_573(); - break; -case 574: - case_574(); - break; -case 575: - case_575(); - break; -case 576: - case_576(); - break; case 577: case_577(); break; case 578: case_578(); break; +case 579: + case_579(); + break; case 580: case_580(); break; @@ -3102,15 +3121,15 @@ case 581: case 582: case_582(); break; -case 583: - case_583(); - break; case 584: case_584(); break; case 585: case_585(); break; +case 586: + case_586(); + break; case 587: case_587(); break; @@ -3118,16 +3137,7 @@ case 588: case_588(); break; case 589: -#line 4217 "cs-parser.jay" - { - yyVal = new As ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } - break; -case 590: -#line 4221 "cs-parser.jay" - { - yyVal = new Is ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } + case_589(); break; case 591: case_591(); @@ -3136,10 +3146,19 @@ case 592: case_592(); break; case 593: - case_593(); +#line 4246 "cs-parser.jay" + { + yyVal = new As ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } break; case 594: - case_594(); +#line 4250 "cs-parser.jay" + { + yyVal = new Is ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } + break; +case 595: + case_595(); break; case 596: case_596(); @@ -3153,8 +3172,8 @@ case 598: case 599: case_599(); break; -case 601: - case_601(); +case 600: + case_600(); break; case 602: case_602(); @@ -3168,15 +3187,15 @@ case 604: case 605: case_605(); break; -case 606: - case_606(); - break; case 607: case_607(); break; case 608: case_608(); break; +case 609: + case_609(); + break; case 610: case_610(); break; @@ -3189,12 +3208,15 @@ case 612: case 613: case_613(); break; -case 615: - case_615(); +case 614: + case_614(); break; case 616: case_616(); break; +case 617: + case_617(); + break; case 618: case_618(); break; @@ -3222,8 +3244,8 @@ case 628: case 630: case_630(); break; -case 632: - case_632(); +case 631: + case_631(); break; case 633: case_633(); @@ -3231,15 +3253,9 @@ case 633: case 634: case_634(); break; -case 635: - case_635(); - break; case 636: case_636(); break; -case 637: - case_637(); - break; case 638: case_638(); break; @@ -3286,50 +3302,47 @@ case 652: case_652(); break; case 653: -#line 4587 "cs-parser.jay" - { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } + case_653(); break; case 654: case_654(); break; case 655: -#line 4598 "cs-parser.jay" - { - start_block (Location.Null); - } + case_655(); break; case 656: case_656(); break; +case 657: + case_657(); + break; case 658: case_658(); break; +case 659: +#line 4626 "cs-parser.jay" + { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } + break; case 660: case_660(); break; case 661: - case_661(); +#line 4637 "cs-parser.jay" + { + start_block (Location.Null); + } break; case 662: case_662(); break; -case 663: - case_663(); - break; case 664: case_664(); break; -case 665: - case_665(); - break; case 666: case_666(); break; case 667: -#line 4665 "cs-parser.jay" - { - valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; - } + case_667(); break; case 668: case_668(); @@ -3338,10 +3351,7 @@ case 669: case_669(); break; case 670: -#line 4679 "cs-parser.jay" - { - valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; - } + case_670(); break; case 671: case_671(); @@ -3349,30 +3359,34 @@ case 671: case 672: case_672(); break; -case 678: +case 673: #line 4704 "cs-parser.jay" { - yyVal = new ArglistAccess (GetLocation (yyVals[0+yyTop])); + valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; -case 679: - case_679(); - break; -case 680: - case_680(); +case 674: + case_674(); break; -case 681: - case_681(); +case 675: + case_675(); break; -case 683: -#line 4733 "cs-parser.jay" +case 676: +#line 4718 "cs-parser.jay" { - yyVal = new BooleanExpression ((Expression) yyVals[0+yyTop]); + valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; +case 677: + case_677(); + break; +case 678: + case_678(); + break; case 684: -#line 4745 "cs-parser.jay" +#line 4743 "cs-parser.jay" { + yyVal = new ArglistAccess (GetLocation (yyVals[0+yyTop])); } break; case 685: @@ -3384,40 +3398,52 @@ case 686: case 687: case_687(); break; -case 688: - case_688(); - break; case 689: -#line 4792 "cs-parser.jay" - { yyVal = null; } +#line 4772 "cs-parser.jay" + { + yyVal = new BooleanExpression ((Expression) yyVals[0+yyTop]); + } break; case 690: -#line 4794 "cs-parser.jay" - { yyVal = yyVals[0+yyTop]; StoreModifierLocation (Modifiers.PARTIAL, GetLocation (yyVals[0+yyTop])); } - break; -case 691: - case_691(); +#line 4779 "cs-parser.jay" + { + yyVal = null; + } break; case 692: -#line 4807 "cs-parser.jay" + case_692(); + break; +case 693: +#line 4797 "cs-parser.jay" { - lexer.parsing_modifiers = false; + yyVal = null; } break; case 694: - case_694(); +#line 4801 "cs-parser.jay" + { + yyVal = null; + } break; case 695: - case_695(); +#line 4805 "cs-parser.jay" + { + yyVal = yyVals[0+yyTop]; + } break; case 696: - case_696(); +#line 4809 "cs-parser.jay" + { + ++lexer.parsing_block; + } break; case 697: case_697(); break; case 698: - case_698(); +#line 4829 "cs-parser.jay" + { + } break; case 699: case_699(); @@ -3432,19 +3458,21 @@ case 702: case_702(); break; case 703: - case_703(); +#line 4881 "cs-parser.jay" + { yyVal = null; } break; case 704: - case_704(); +#line 4883 "cs-parser.jay" + { yyVal = yyVals[0+yyTop]; StoreModifierLocation (Modifiers.PARTIAL, GetLocation (yyVals[0+yyTop])); } break; case 705: case_705(); break; case 706: - case_706(); - break; -case 707: - case_707(); +#line 4896 "cs-parser.jay" + { + lexer.parsing_modifiers = false; + } break; case 708: case_708(); @@ -3452,17 +3480,20 @@ case 708: case 709: case_709(); break; +case 710: + case_710(); + break; case 711: case_711(); break; case 712: case_712(); break; +case 713: + case_713(); + break; case 714: -#line 4933 "cs-parser.jay" - { - yyVal = yyVals[0+yyTop]; - } + case_714(); break; case 715: case_715(); @@ -3489,22 +3520,7 @@ case 722: case_722(); break; case 723: -#line 5026 "cs-parser.jay" - { - yyVal = new SpecialContraintExpr (SpecialConstraint.Class, GetLocation (yyVals[0+yyTop])); - } - break; -case 724: -#line 5030 "cs-parser.jay" - { - yyVal = new SpecialContraintExpr (SpecialConstraint.Struct, GetLocation (yyVals[0+yyTop])); - } - break; -case 725: -#line 5037 "cs-parser.jay" - { - yyVal = null; - } + case_723(); break; case 726: case_726(); @@ -3512,18 +3528,15 @@ case 726: case 727: case_727(); break; -case 728: - case_728(); - break; case 729: - case_729(); - break; -case 730: -#line 5082 "cs-parser.jay" +#line 5026 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; +case 730: + case_730(); + break; case 731: case_731(); break; @@ -3545,116 +3558,149 @@ case 736: case 737: case_737(); break; -case 742: -#line 5144 "cs-parser.jay" +case 738: +#line 5119 "cs-parser.jay" { - current_block.AddStatement ((Statement) yyVals[0+yyTop]); + yyVal = new SpecialContraintExpr (SpecialConstraint.Class, GetLocation (yyVals[0+yyTop])); } break; -case 743: -#line 5148 "cs-parser.jay" +case 739: +#line 5123 "cs-parser.jay" { - current_block.AddStatement ((Statement) yyVals[0+yyTop]); + yyVal = new SpecialContraintExpr (SpecialConstraint.Struct, GetLocation (yyVals[0+yyTop])); + } + break; +case 740: +#line 5130 "cs-parser.jay" + { + yyVal = null; } break; +case 741: + case_741(); + break; +case 742: + case_742(); + break; +case 743: + case_743(); + break; +case 744: + case_744(); + break; case 745: - case_745(); +#line 5175 "cs-parser.jay" + { + yyVal = yyVals[0+yyTop]; + } break; case 746: case_746(); break; +case 747: + case_747(); + break; +case 748: + case_748(); + break; case 749: -#line 5182 "cs-parser.jay" + case_749(); + break; +case 750: + case_750(); + break; +case 751: + case_751(); + break; +case 752: + case_752(); + break; +case 757: +#line 5237 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; -case 750: -#line 5186 "cs-parser.jay" +case 758: +#line 5241 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; -case 779: - case_779(); - break; -case 780: - case_780(); - break; -case 781: - case_781(); +case 760: + case_760(); break; -case 782: - case_782(); +case 761: + case_761(); break; -case 783: - case_783(); - break; -case 786: - case_786(); - break; -case 787: - case_787(); - break; -case 788: - case_788(); - break; -case 789: - case_789(); - break; -case 790: -#line 5330 "cs-parser.jay" +case 764: +#line 5275 "cs-parser.jay" { - yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); + current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; -case 791: -#line 5334 "cs-parser.jay" +case 765: +#line 5279 "cs-parser.jay" { - yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); + current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; -case 792: - case_792(); - break; case 794: case_794(); break; case 795: -#line 5355 "cs-parser.jay" - { - yyVal = ComposedTypeSpecifier.CreatePointer (GetLocation (yyVals[0+yyTop])); - } + case_795(); + break; +case 796: + case_796(); break; case 797: -#line 5363 "cs-parser.jay" - { - yyVal = Error_AwaitAsIdentifier (yyVals[0+yyTop]); - } + case_797(); break; case 798: case_798(); break; -case 799: - case_799(); - break; -case 800: - case_800(); - break; case 801: case_801(); break; +case 802: + case_802(); + break; case 803: case_803(); break; +case 804: + case_804(); + break; case 805: - case_805(); +#line 5423 "cs-parser.jay" + { + yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); + } break; case 806: - case_806(); +#line 5427 "cs-parser.jay" + { + yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); + } + break; +case 807: + case_807(); + break; +case 809: + case_809(); break; case 810: - case_810(); +#line 5448 "cs-parser.jay" + { + yyVal = ComposedTypeSpecifier.CreatePointer (GetLocation (yyVals[0+yyTop])); + } + break; +case 812: +#line 5456 "cs-parser.jay" + { + yyVal = Error_AwaitAsIdentifier (yyVals[0+yyTop]); + } break; case 813: case_813(); @@ -3663,64 +3709,43 @@ case 814: case_814(); break; case 815: -#line 5477 "cs-parser.jay" - { - report.Error (145, lexer.Location, "A const field requires a value to be provided"); - } + case_815(); break; case 816: case_816(); break; -case 821: - case_821(); +case 818: + case_818(); break; -case 823: - case_823(); +case 820: + case_820(); break; -case 824: - case_824(); +case 821: + case_821(); break; case 825: case_825(); break; -case 826: -#line 5527 "cs-parser.jay" - { yyVal = yyVals[-1+yyTop]; } - break; -case 827: - case_827(); - break; case 828: -#line 5537 "cs-parser.jay" - { yyVal = yyVals[-1+yyTop]; } + case_828(); break; case 829: -#line 5538 "cs-parser.jay" - { yyVal = yyVals[-1+yyTop]; } + case_829(); break; case 830: - case_830(); +#line 5570 "cs-parser.jay" + { + report.Error (145, lexer.Location, "A const field requires a value to be provided"); + } break; case 831: case_831(); break; -case 832: - case_832(); - break; -case 835: - case_835(); - break; case 836: case_836(); break; -case 837: - case_837(); - break; case 838: -#line 5610 "cs-parser.jay" - { - start_block (GetLocation (yyVals[0+yyTop])); - } + case_838(); break; case 839: case_839(); @@ -3729,95 +3754,88 @@ case 840: case_840(); break; case 841: +#line 5620 "cs-parser.jay" + { yyVal = yyVals[-1+yyTop]; } + break; +case 842: + case_842(); + break; +case 843: #line 5630 "cs-parser.jay" - { - report.Warning (1522, 1, current_block.StartLocation, "Empty switch block"); - } + { yyVal = yyVals[-1+yyTop]; } + break; +case 844: +#line 5631 "cs-parser.jay" + { yyVal = yyVals[-1+yyTop]; } break; case 845: -#line 5640 "cs-parser.jay" - { - Error_SyntaxError (yyToken); - } + case_845(); + break; +case 846: + case_846(); break; case 847: case_847(); break; -case 848: -#line 5657 "cs-parser.jay" - { - current_block.AddStatement ((Statement) yyVals[0+yyTop]); - } - break; -case 849: - case_849(); - break; case 850: case_850(); break; case 851: -#line 5674 "cs-parser.jay" + case_851(); + break; +case 852: + case_852(); + break; +case 853: +#line 5703 "cs-parser.jay" { - yyVal = new SwitchLabel (null, GetLocation (yyVals[0+yyTop])); + start_block (GetLocation (yyVals[0+yyTop])); } break; -case 856: - case_856(); - break; -case 857: - case_857(); +case 854: + case_854(); break; -case 858: - case_858(); +case 855: + case_855(); break; -case 859: - case_859(); +case 856: +#line 5723 "cs-parser.jay" + { + report.Warning (1522, 1, current_block.StartLocation, "Empty switch block"); + } break; case 860: - case_860(); - break; -case 861: - case_861(); - break; -case 862: -#line 5735 "cs-parser.jay" +#line 5733 "cs-parser.jay" { - yyVal = yyVals[0+yyTop]; + Error_SyntaxError (yyToken); } break; -case 863: - case_863(); +case 862: + case_862(); break; -case 864: +case 863: #line 5750 "cs-parser.jay" { - yyVal = yyVals[0+yyTop]; + current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; +case 864: + case_864(); + break; case 865: case_865(); break; case 866: - case_866(); - break; -case 867: -#line 5771 "cs-parser.jay" +#line 5767 "cs-parser.jay" { - yyVal = yyVals[0+yyTop]; + yyVal = new SwitchLabel (null, GetLocation (yyVals[0+yyTop])); } break; -case 868: - case_868(); - break; -case 869: - case_869(); - break; -case 870: - case_870(); - break; case 871: -#line 5805 "cs-parser.jay" - { yyVal = new EmptyStatement (lexer.Location); } + case_871(); + break; +case 872: + case_872(); break; case 873: case_873(); @@ -3825,16 +3843,38 @@ case 873: case 874: case_874(); break; +case 875: + case_875(); + break; case 876: -#line 5829 "cs-parser.jay" - { yyVal = null; } + case_876(); + break; +case 877: +#line 5828 "cs-parser.jay" + { + yyVal = yyVals[0+yyTop]; + } break; case 878: -#line 5834 "cs-parser.jay" - { yyVal = new EmptyStatement (lexer.Location); } + case_878(); + break; +case 879: +#line 5843 "cs-parser.jay" + { + yyVal = yyVals[0+yyTop]; + } + break; +case 880: + case_880(); + break; +case 881: + case_881(); break; case 882: - case_882(); +#line 5864 "cs-parser.jay" + { + yyVal = yyVals[0+yyTop]; + } break; case 883: case_883(); @@ -3846,19 +3886,22 @@ case 885: case_885(); break; case 886: - case_886(); - break; -case 887: - case_887(); +#line 5898 "cs-parser.jay" + { yyVal = new EmptyStatement (lexer.Location); } break; case 888: case_888(); break; -case 895: - case_895(); +case 889: + case_889(); break; -case 896: - case_896(); +case 891: +#line 5922 "cs-parser.jay" + { yyVal = null; } + break; +case 893: +#line 5927 "cs-parser.jay" + { yyVal = new EmptyStatement (lexer.Location); } break; case 897: case_897(); @@ -3881,29 +3924,14 @@ case 902: case 903: case_903(); break; -case 904: - case_904(); - break; -case 905: - case_905(); - break; -case 906: - case_906(); +case 910: + case_910(); break; -case 907: - case_907(); - break; -case 908: - case_908(); - break; -case 909: - case_909(); +case 911: + case_911(); break; case 912: -#line 6080 "cs-parser.jay" - { - yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false); - } + case_912(); break; case 913: case_913(); @@ -3920,20 +3948,20 @@ case 916: case 917: case_917(); break; +case 918: + case_918(); + break; +case 919: + case_919(); + break; case 920: -#line 6129 "cs-parser.jay" - { - yyVal = new Catch ((ExplicitBlock) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } + case_920(); break; case 921: case_921(); break; case 922: -#line 6148 "cs-parser.jay" - { - yyVal = yyVals[-1+yyTop]; - } + case_922(); break; case 923: case_923(); @@ -3941,26 +3969,14 @@ case 923: case 924: case_924(); break; -case 925: -#line 6189 "cs-parser.jay" - { - yyVal = new Checked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } - break; -case 926: -#line 6196 "cs-parser.jay" +case 927: +#line 6173 "cs-parser.jay" { - yyVal = new Unchecked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false); } break; -case 927: - case_927(); - break; case 928: -#line 6206 "cs-parser.jay" - { - yyVal = new Unsafe ((Block) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); - } + case_928(); break; case 929: case_929(); @@ -3974,12 +3990,6 @@ case 931: case 932: case_932(); break; -case 933: - case_933(); - break; -case 934: - case_934(); - break; case 935: case_935(); break; @@ -3992,26 +4002,32 @@ case 937: case 938: case_938(); break; -case 940: - case_940(); +case 939: + case_939(); break; case 941: -#line 6311 "cs-parser.jay" - { - Error_MissingInitializer (lexer.Location); - } + case_941(); break; case 942: - case_942(); +#line 6298 "cs-parser.jay" + { + yyVal = new Checked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } break; case 943: - case_943(); +#line 6305 "cs-parser.jay" + { + yyVal = new Unchecked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } break; case 944: case_944(); break; case 945: - case_945(); +#line 6315 "cs-parser.jay" + { + yyVal = new Unsafe ((Block) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); + } break; case 946: case_946(); @@ -4029,19 +4045,13 @@ case 950: case_950(); break; case 951: -#line 6416 "cs-parser.jay" - { - current_block = new Linq.QueryBlock (current_block, lexer.Location); - } + case_951(); break; case 952: case_952(); break; case 953: -#line 6431 "cs-parser.jay" - { - current_block = new Linq.QueryBlock (current_block, lexer.Location); - } + case_953(); break; case 954: case_954(); @@ -4049,20 +4059,20 @@ case 954: case 955: case_955(); break; -case 956: - case_956(); +case 957: + case_957(); break; case 958: - case_958(); +#line 6420 "cs-parser.jay" + { + Error_MissingInitializer (lexer.Location); + } break; case 959: case_959(); break; case 960: -#line 6495 "cs-parser.jay" - { - current_block = new Linq.QueryBlock (current_block, lexer.Location); - } + case_960(); break; case 961: case_961(); @@ -4077,35 +4087,50 @@ case 964: case_964(); break; case 965: -#line 6534 "cs-parser.jay" - { - yyVal = new object[] { yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]) }; - } + case_965(); break; case 966: case_966(); break; +case 967: + case_967(); + break; case 968: - case_968(); +#line 6525 "cs-parser.jay" + { + current_block = new Linq.QueryBlock (current_block, lexer.Location); + } + break; +case 969: + case_969(); break; -case 974: -#line 6563 "cs-parser.jay" +case 970: +#line 6540 "cs-parser.jay" { - current_block = new Linq.QueryBlock (current_block, lexer.Location); + current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; +case 971: + case_971(); + break; +case 972: + case_972(); + break; +case 973: + case_973(); + break; case 975: case_975(); break; case 976: -#line 6582 "cs-parser.jay" + case_976(); + break; +case 977: +#line 6604 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; -case 977: - case_977(); - break; case 978: case_978(); break; @@ -4119,32 +4144,32 @@ case 981: case_981(); break; case 982: - case_982(); +#line 6643 "cs-parser.jay" + { + yyVal = new object[] { yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]) }; + } break; case 983: case_983(); break; -case 984: - case_984(); - break; case 985: case_985(); break; -case 987: - case_987(); - break; -case 988: - case_988(); - break; -case 989: - case_989(); - break; case 991: - case_991(); +#line 6672 "cs-parser.jay" + { + current_block = new Linq.QueryBlock (current_block, lexer.Location); + } break; case 992: case_992(); break; +case 993: +#line 6691 "cs-parser.jay" + { + current_block = new Linq.QueryBlock (current_block, lexer.Location); + } + break; case 994: case_994(); break; @@ -4152,10 +4177,7 @@ case 995: case_995(); break; case 996: -#line 6783 "cs-parser.jay" - { - yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); - } + case_996(); break; case 997: case_997(); @@ -4164,10 +4186,7 @@ case 998: case_998(); break; case 999: -#line 6800 "cs-parser.jay" - { - yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); - } + case_999(); break; case 1000: case_1000(); @@ -4175,92 +4194,143 @@ case 1000: case 1001: case_1001(); break; -case 1003: - case_1003(); +case 1002: + case_1002(); break; case 1004: case_1004(); break; -case 1007: - case_1007(); +case 1005: + case_1005(); + break; +case 1006: + case_1006(); break; case 1008: case_1008(); break; +case 1009: + case_1009(); + break; +case 1011: + case_1011(); + break; +case 1012: + case_1012(); + break; +case 1013: +#line 6892 "cs-parser.jay" + { + yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); + } + break; +case 1014: + case_1014(); + break; +case 1015: + case_1015(); + break; case 1016: -#line 6925 "cs-parser.jay" +#line 6909 "cs-parser.jay" { - module.DocumentationBuilder.ParsedName = (MemberName) yyVals[0+yyTop]; + yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); } break; case 1017: -#line 6932 "cs-parser.jay" + case_1017(); + break; +case 1018: + case_1018(); + break; +case 1020: + case_1020(); + break; +case 1021: + case_1021(); + break; +case 1024: + case_1024(); + break; +case 1025: + case_1025(); + break; +case 1033: +#line 7034 "cs-parser.jay" + { + module.DocumentationBuilder.ParsedName = (MemberName) yyVals[0+yyTop]; + } + break; +case 1034: +#line 7041 "cs-parser.jay" { module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; } break; -case 1018: - case_1018(); +case 1035: + case_1035(); break; -case 1019: - case_1019(); +case 1036: + case_1036(); break; -case 1020: -#line 6949 "cs-parser.jay" +case 1037: + case_1037(); + break; +case 1038: +#line 7064 "cs-parser.jay" { yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], MemberCache.IndexerNameAlias, Location.Null); } break; -case 1021: -#line 6953 "cs-parser.jay" +case 1039: +#line 7068 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; -case 1022: - case_1022(); +case 1040: + case_1040(); break; -case 1023: - case_1023(); +case 1041: + case_1041(); break; -case 1024: - case_1024(); +case 1042: + case_1042(); break; -case 1025: - case_1025(); +case 1043: + case_1043(); break; -case 1027: -#line 6989 "cs-parser.jay" +case 1045: +#line 7104 "cs-parser.jay" { yyVal = new MemberName (((MemberName) yyVals[-2+yyTop]), (MemberName) yyVals[0+yyTop]); } break; -case 1029: -#line 6997 "cs-parser.jay" +case 1047: +#line 7112 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; -case 1030: -#line 7001 "cs-parser.jay" +case 1048: +#line 7116 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; -case 1031: -#line 7008 "cs-parser.jay" +case 1049: +#line 7123 "cs-parser.jay" { yyVal = new List (0); } break; -case 1033: - case_1033(); +case 1051: + case_1051(); break; -case 1034: - case_1034(); +case 1052: + case_1052(); break; -case 1035: - case_1035(); +case 1053: + case_1053(); break; #line default } @@ -4298,7 +4368,7 @@ case 1035: All more than 3 lines long rules are wrapped into a method */ void case_6() -#line 395 "cs-parser.jay" +#line 396 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { Attributes attrs = (Attributes) yyVals[0+yyTop]; @@ -4310,7 +4380,7 @@ void case_6() } void case_8() -#line 409 "cs-parser.jay" +#line 410 "cs-parser.jay" { if (yyToken == Token.EXTERN_ALIAS) report.Error (439, lexer.Location, "An extern alias declaration must precede all other elements"); @@ -4319,7 +4389,7 @@ void case_8() } void case_13() -#line 429 "cs-parser.jay" +#line 430 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-2+yyTop]; string s = lt.Value; @@ -4342,14 +4412,14 @@ void case_13() } void case_17() -#line 462 "cs-parser.jay" +#line 463 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } void case_18() -#line 470 "cs-parser.jay" +#line 471 "cs-parser.jay" { var un = new UsingNamespace ((ATypeNameExpression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); current_namespace.AddUsing (un); @@ -4358,7 +4428,7 @@ void case_18() } void case_19() -#line 477 "cs-parser.jay" +#line 478 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-3+yyTop]; if (lang_version != LanguageVersion.ISO_1 && lt.Value == "global") { @@ -4372,14 +4442,14 @@ void case_19() } void case_20() -#line 489 "cs-parser.jay" +#line 490 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } void case_21() -#line 502 "cs-parser.jay" +#line 503 "cs-parser.jay" { Attributes attrs = (Attributes) yyVals[-2+yyTop]; var name = (MemberName) yyVals[0+yyTop]; @@ -4409,14 +4479,14 @@ void case_21() } void case_22() -#line 530 "cs-parser.jay" +#line 531 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } void case_23() -#line 535 "cs-parser.jay" +#line 536 "cs-parser.jay" { if (yyVals[0+yyTop] != null) lbag.AddLocation (current_container, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); @@ -4427,7 +4497,7 @@ void case_23() } void case_24() -#line 544 "cs-parser.jay" +#line 545 "cs-parser.jay" { report.Error (1514, lexer.Location, "Unexpected symbol `{0}', expecting `.' or `{{'", GetSymbolName (yyToken)); @@ -4438,21 +4508,21 @@ void case_24() } void case_27() -#line 558 "cs-parser.jay" +#line 559 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } void case_28() -#line 566 "cs-parser.jay" +#line 567 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; yyVal = new MemberName (lt.Value, lt.Location); } void case_29() -#line 571 "cs-parser.jay" +#line 572 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], lt.Value, lt.Location); @@ -4460,14 +4530,14 @@ void case_29() } void case_30() -#line 577 "cs-parser.jay" +#line 578 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new MemberName ("", lexer.Location); } void case_43() -#line 615 "cs-parser.jay" +#line 616 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { TypeContainer ds = (TypeContainer)yyVals[0+yyTop]; @@ -4488,7 +4558,7 @@ void case_43() } void case_45() -#line 637 "cs-parser.jay" +#line 638 "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"); @@ -4496,14 +4566,14 @@ void case_45() } void case_53() -#line 670 "cs-parser.jay" +#line 671 "cs-parser.jay" { var sect = (List) yyVals[0+yyTop]; yyVal = new Attributes (sect); } void case_54() -#line 675 "cs-parser.jay" +#line 676 "cs-parser.jay" { Attributes attrs = yyVals[-1+yyTop] as Attributes; var sect = (List) yyVals[0+yyTop]; @@ -4515,21 +4585,21 @@ void case_54() } void case_55() -#line 688 "cs-parser.jay" +#line 689 "cs-parser.jay" { PushLocation (GetLocation (yyVals[0+yyTop])); lexer.parsing_attribute_section = true; } void case_56() -#line 693 "cs-parser.jay" +#line 694 "cs-parser.jay" { lexer.parsing_attribute_section = false; yyVal = yyVals[0+yyTop]; } void case_57() -#line 701 "cs-parser.jay" +#line 702 "cs-parser.jay" { current_attr_target = (string) yyVals[-1+yyTop]; if (current_attr_target == "assembly" || current_attr_target == "module") { @@ -4538,7 +4608,7 @@ void case_57() } void case_58() -#line 708 "cs-parser.jay" +#line 709 "cs-parser.jay" { /* when attribute target is invalid*/ if (current_attr_target == string.Empty) @@ -4559,7 +4629,7 @@ void case_58() } void case_59() -#line 727 "cs-parser.jay" +#line 728 "cs-parser.jay" { yyVal = yyVals[-2+yyTop]; lbag.InsertLocation (yyVal, 0, PopLocation ()); @@ -4571,7 +4641,7 @@ void case_59() } void case_60() -#line 737 "cs-parser.jay" +#line 738 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -4584,14 +4654,14 @@ void case_60() } void case_61() -#line 748 "cs-parser.jay" +#line 749 "cs-parser.jay" { CheckAttributeTarget (yyToken, GetTokenName (yyToken), GetLocation (yyVals[0+yyTop])); yyVal = null; } void case_62() -#line 756 "cs-parser.jay" +#line 757 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; yyVal = CheckAttributeTarget (yyToken, lt.Value, lt.Location); @@ -4599,7 +4669,7 @@ void case_62() } void case_66() -#line 771 "cs-parser.jay" +#line 772 "cs-parser.jay" { var attrs = (List) yyVals[-2+yyTop]; if (attrs != null) { @@ -4611,7 +4681,7 @@ void case_66() } void case_68() -#line 788 "cs-parser.jay" +#line 789 "cs-parser.jay" { --lexer.parsing_block; @@ -4633,7 +4703,7 @@ void case_68() } void case_71() -#line 816 "cs-parser.jay" +#line 817 "cs-parser.jay" { savedAttrParenOpenLocation = GetLocation (yyVals[-2+yyTop]); savedAttrParenCloseLocation = GetLocation (yyVals[0+yyTop]); @@ -4642,7 +4712,7 @@ void case_71() } void case_73() -#line 828 "cs-parser.jay" +#line 829 "cs-parser.jay" { Arguments a = new Arguments (4); a.Add ((Argument) yyVals[0+yyTop]); @@ -4650,7 +4720,7 @@ void case_73() } void case_74() -#line 834 "cs-parser.jay" +#line 835 "cs-parser.jay" { Arguments a = new Arguments (4); a.Add ((Argument) yyVals[0+yyTop]); @@ -4658,7 +4728,7 @@ void case_74() } void case_75() -#line 840 "cs-parser.jay" +#line 841 "cs-parser.jay" { Arguments[] o = (Arguments[]) yyVals[-2+yyTop]; if (o [1] != null) { @@ -4675,7 +4745,7 @@ void case_75() } void case_76() -#line 855 "cs-parser.jay" +#line 856 "cs-parser.jay" { Arguments[] o = (Arguments[]) yyVals[-2+yyTop]; if (o [1] == null) { @@ -4687,14 +4757,14 @@ void case_76() } void case_79() -#line 873 "cs-parser.jay" +#line 874 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } void case_81() -#line 885 "cs-parser.jay" +#line 886 "cs-parser.jay" { --lexer.parsing_block; var lt = (LocatedToken) yyVals[-3+yyTop]; @@ -4703,7 +4773,7 @@ void case_81() } void case_82() -#line 895 "cs-parser.jay" +#line 896 "cs-parser.jay" { if (lang_version <= LanguageVersion.V_3) FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "named argument"); @@ -4716,8 +4786,22 @@ void case_82() lbag.AddLocation (yyVal, GetLocation(yyVals[-2+yyTop])); } +void case_88() +#line 928 "cs-parser.jay" +{ + lexer.parsing_modifiers = true; + lexer.parsing_block = 0; + } + +void case_89() +#line 933 "cs-parser.jay" +{ + lexer.parsing_modifiers = true; + lexer.parsing_block = 0; + } + void case_102() -#line 950 "cs-parser.jay" +#line 953 "cs-parser.jay" { report.Error (1519, lexer.Location, "Unexpected symbol `{0}' in class, struct, or interface member declaration", GetSymbolName (yyToken)); @@ -4726,18 +4810,23 @@ void case_102() } void case_104() -#line 966 "cs-parser.jay" +#line 969 "cs-parser.jay" { lexer.ConstraintsParsing = true; + valid_param_mod = ParameterModifierType.PrimaryConstructor; 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_105() -#line 973 "cs-parser.jay" +#line 978 "cs-parser.jay" { + valid_param_mod = 0; lexer.ConstraintsParsing = false; + if (yyVals[-2+yyTop] != null) + current_type.PrimaryConstructorParameters = (ParametersCompiled) yyVals[-2+yyTop]; + if (yyVals[0+yyTop] != null) current_container.SetConstraints ((List) yyVals[0+yyTop]); @@ -4749,14 +4838,14 @@ void case_105() } void case_106() -#line 986 "cs-parser.jay" +#line 995 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } void case_107() -#line 991 "cs-parser.jay" +#line 1000 "cs-parser.jay" { --lexer.parsing_declaration; if (doc_support) @@ -4764,9 +4853,9 @@ void case_107() } void case_108() -#line 997 "cs-parser.jay" +#line 1006 "cs-parser.jay" { - if (yyVals[0+yyTop] == null) { + if (yyVals[-1+yyTop] == null) { lbag.AppendToMember (current_container, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop])); } else { lbag.AppendToMember (current_container, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); @@ -4775,7 +4864,7 @@ void case_108() } void case_110() -#line 1015 "cs-parser.jay" +#line 1024 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; var mod = (Modifiers) yyVals[-3+yyTop]; @@ -4790,7 +4879,7 @@ void case_110() } void case_111() -#line 1028 "cs-parser.jay" +#line 1037 "cs-parser.jay" { if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); @@ -4803,7 +4892,7 @@ void case_111() } void case_112() -#line 1041 "cs-parser.jay" +#line 1050 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -4811,7 +4900,7 @@ void case_112() } void case_117() -#line 1066 "cs-parser.jay" +#line 1075 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (ConstInitializer) yyVals[0+yyTop]); @@ -4819,7 +4908,7 @@ void case_117() } void case_119() -#line 1079 "cs-parser.jay" +#line 1088 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstInitializer (current_field, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); @@ -4827,14 +4916,14 @@ void case_119() } void case_120() -#line 1085 "cs-parser.jay" +#line 1094 "cs-parser.jay" { report.Error (145, lexer.Location, "A const field requires a value to be provided"); yyVal = null; } void case_123() -#line 1100 "cs-parser.jay" +#line 1109 "cs-parser.jay" { lexer.parsing_generic_declaration = false; @@ -4849,7 +4938,7 @@ void case_123() } void case_124() -#line 1115 "cs-parser.jay" +#line 1124 "cs-parser.jay" { if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); @@ -4862,7 +4951,7 @@ void case_124() } void case_125() -#line 1128 "cs-parser.jay" +#line 1137 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "fixed size buffers"); @@ -4875,7 +4964,7 @@ void case_125() } void case_126() -#line 1139 "cs-parser.jay" +#line 1148 "cs-parser.jay" { if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); @@ -4889,7 +4978,7 @@ void case_126() } void case_129() -#line 1162 "cs-parser.jay" +#line 1171 "cs-parser.jay" { ++lexer.parsing_block; current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; @@ -4897,7 +4986,7 @@ void case_129() } void case_130() -#line 1168 "cs-parser.jay" +#line 1177 "cs-parser.jay" { --lexer.parsing_block; current_field.Initializer = (Expression) yyVals[0+yyTop]; @@ -4907,7 +4996,7 @@ void case_130() } void case_135() -#line 1195 "cs-parser.jay" +#line 1204 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null); @@ -4915,7 +5004,7 @@ void case_135() } void case_137() -#line 1205 "cs-parser.jay" +#line 1214 "cs-parser.jay" { --lexer.parsing_block; var lt = (LocatedToken) yyVals[-3+yyTop]; @@ -4924,7 +5013,7 @@ void case_137() } void case_142() -#line 1231 "cs-parser.jay" +#line 1240 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (ConstInitializer) yyVals[0+yyTop]); @@ -4932,7 +5021,7 @@ void case_142() } void case_144() -#line 1244 "cs-parser.jay" +#line 1253 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstInitializer (current_field, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); @@ -4940,14 +5029,14 @@ void case_144() } void case_145() -#line 1250 "cs-parser.jay" +#line 1259 "cs-parser.jay" { report.Error (443, lexer.Location, "Value or constant expected"); yyVal = null; } void case_148() -#line 1260 "cs-parser.jay" +#line 1269 "cs-parser.jay" { /* It has to be here for the parent to safely restore artificial block*/ Error_SyntaxError (yyToken); @@ -4955,7 +5044,7 @@ void case_148() } void case_149() -#line 1269 "cs-parser.jay" +#line 1278 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.NotAllowed; @@ -4964,7 +5053,7 @@ void case_149() } void case_150() -#line 1276 "cs-parser.jay" +#line 1285 "cs-parser.jay" { Method method = (Method) yyVals[-2+yyTop]; method.Block = (ToplevelBlock) yyVals[0+yyTop]; @@ -4992,7 +5081,7 @@ void case_150() } void case_152() -#line 1312 "cs-parser.jay" +#line 1321 "cs-parser.jay" { valid_param_mod = 0; MemberName name = (MemberName) yyVals[-4+yyTop]; @@ -5015,7 +5104,7 @@ void case_152() } void case_153() -#line 1333 "cs-parser.jay" +#line 1342 "cs-parser.jay" { lexer.ConstraintsParsing = false; @@ -5028,14 +5117,14 @@ void case_153() } void case_155() -#line 1352 "cs-parser.jay" +#line 1361 "cs-parser.jay" { lexer.parsing_generic_declaration = false; valid_param_mod = ParameterModifierType.All; } void case_157() -#line 1361 "cs-parser.jay" +#line 1370 "cs-parser.jay" { lexer.ConstraintsParsing = false; valid_param_mod = 0; @@ -5065,7 +5154,7 @@ void case_157() } void case_158() -#line 1392 "cs-parser.jay" +#line 1401 "cs-parser.jay" { MemberName name = (MemberName) yyVals[-3+yyTop]; report.Error (1585, name.Location, @@ -5085,7 +5174,7 @@ void case_158() } void case_159() -#line 1413 "cs-parser.jay" +#line 1422 "cs-parser.jay" { Error_SyntaxError (yyToken); current_local_parameters = ParametersCompiled.Undefined; @@ -5103,7 +5192,7 @@ void case_159() } void case_164() -#line 1442 "cs-parser.jay" +#line 1451 "cs-parser.jay" { var pars_list = (List) yyVals[0+yyTop]; yyVal = new ParametersCompiled (pars_list.ToArray ()); @@ -5111,7 +5200,7 @@ void case_164() } void case_165() -#line 1448 "cs-parser.jay" +#line 1457 "cs-parser.jay" { var pars_list = (List) yyVals[-2+yyTop]; pars_list.Add ((Parameter) yyVals[0+yyTop]); @@ -5122,7 +5211,7 @@ void case_165() } void case_166() -#line 1457 "cs-parser.jay" +#line 1466 "cs-parser.jay" { var pars_list = (List) yyVals[-2+yyTop]; pars_list.Add (new ArglistParameter (GetLocation (yyVals[0+yyTop]))); @@ -5133,7 +5222,7 @@ void case_166() } void case_167() -#line 1466 "cs-parser.jay" +#line 1475 "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"); @@ -5143,7 +5232,7 @@ void case_167() } void case_168() -#line 1474 "cs-parser.jay" +#line 1483 "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"); @@ -5158,7 +5247,7 @@ void case_168() } void case_169() -#line 1487 "cs-parser.jay" +#line 1496 "cs-parser.jay" { report.Error (257, GetLocation (yyVals[-2+yyTop]), "An __arglist parameter must be the last parameter in a formal parameter list"); @@ -5167,7 +5256,7 @@ void case_169() } void case_170() -#line 1494 "cs-parser.jay" +#line 1503 "cs-parser.jay" { report.Error (257, GetLocation (yyVals[-2+yyTop]), "An __arglist parameter must be the last parameter in a formal parameter list"); @@ -5181,14 +5270,14 @@ void case_170() } void case_173() -#line 1514 "cs-parser.jay" +#line 1523 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = ParametersCompiled.EmptyReadOnlyParameters; } void case_174() -#line 1522 "cs-parser.jay" +#line 1531 "cs-parser.jay" { parameters_bucket.Clear (); Parameter p = (Parameter) yyVals[0+yyTop]; @@ -5199,7 +5288,7 @@ void case_174() } void case_175() -#line 1531 "cs-parser.jay" +#line 1540 "cs-parser.jay" { var pars = (List) yyVals[-2+yyTop]; Parameter p = (Parameter) yyVals[0+yyTop]; @@ -5219,7 +5308,7 @@ void case_175() } void case_176() -#line 1555 "cs-parser.jay" +#line 1564 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Parameter.Modifier) yyVals[-2+yyTop], (Attributes) yyVals[-3+yyTop], lt.Location); @@ -5227,7 +5316,7 @@ void case_176() } void case_177() -#line 1564 "cs-parser.jay" +#line 1573 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-2+yyTop]; report.Error (1552, lt.Location, "Array type specifier, [], must appear before parameter name"); @@ -5236,7 +5325,7 @@ void case_177() } void case_178() -#line 1571 "cs-parser.jay" +#line 1580 "cs-parser.jay" { Error_SyntaxError (yyToken); Location l = GetLocation (yyVals[0+yyTop]); @@ -5244,7 +5333,7 @@ void case_178() } void case_179() -#line 1580 "cs-parser.jay" +#line 1589 "cs-parser.jay" { Error_SyntaxError (yyToken); Location l = GetLocation (yyVals[0+yyTop]); @@ -5253,7 +5342,7 @@ void case_179() } void case_181() -#line 1595 "cs-parser.jay" +#line 1604 "cs-parser.jay" { --lexer.parsing_block; if (lang_version <= LanguageVersion.V_3) { @@ -5292,7 +5381,7 @@ void case_181() } void case_185() -#line 1644 "cs-parser.jay" +#line 1653 "cs-parser.jay" { Parameter.Modifier p2 = (Parameter.Modifier)yyVals[0+yyTop]; Parameter.Modifier mod = (Parameter.Modifier)yyVals[-1+yyTop] | p2; @@ -5315,7 +5404,7 @@ void case_185() } void case_186() -#line 1668 "cs-parser.jay" +#line 1677 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Ref) == 0) Error_ParameterModifierNotValid ("ref", GetLocation (yyVals[0+yyTop])); @@ -5324,7 +5413,7 @@ void case_186() } void case_187() -#line 1675 "cs-parser.jay" +#line 1684 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Out) == 0) Error_ParameterModifierNotValid ("out", GetLocation (yyVals[0+yyTop])); @@ -5333,7 +5422,7 @@ void case_187() } void case_188() -#line 1682 "cs-parser.jay" +#line 1691 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.This) == 0) Error_ParameterModifierNotValid ("this", GetLocation (yyVals[0+yyTop])); @@ -5345,7 +5434,7 @@ void case_188() } void case_189() -#line 1695 "cs-parser.jay" +#line 1704 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; yyVal = new ParamsParameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Attributes) yyVals[-3+yyTop], lt.Location); @@ -5353,7 +5442,7 @@ void case_189() } void case_190() -#line 1701 "cs-parser.jay" +#line 1710 "cs-parser.jay" { report.Error (1751, GetLocation (yyVals[-4+yyTop]), "Cannot specify a default value for a parameter array"); @@ -5363,7 +5452,7 @@ void case_190() } void case_191() -#line 1709 "cs-parser.jay" +#line 1718 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -5371,7 +5460,7 @@ void case_191() } void case_192() -#line 1718 "cs-parser.jay" +#line 1727 "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"); @@ -5379,7 +5468,7 @@ void case_192() } void case_193() -#line 1724 "cs-parser.jay" +#line 1733 "cs-parser.jay" { Parameter.Modifier mod = (Parameter.Modifier)yyVals[0+yyTop]; if ((mod & Parameter.Modifier.This) != 0) { @@ -5391,21 +5480,21 @@ void case_193() } void case_195() -#line 1741 "cs-parser.jay" +#line 1750 "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_196() -#line 1752 "cs-parser.jay" +#line 1761 "cs-parser.jay" { if (doc_support) tmpComment = Lexer.consume_doc_comment (); } void case_197() -#line 1757 "cs-parser.jay" +#line 1766 "cs-parser.jay" { var type = (FullNamedExpression) yyVals[-3+yyTop]; current_property = new Property (current_type, type, (Modifiers) yyVals[-4+yyTop], @@ -5421,7 +5510,7 @@ void case_197() } void case_198() -#line 1771 "cs-parser.jay" +#line 1780 "cs-parser.jay" { lexer.PropertyParsing = false; @@ -5430,14 +5519,14 @@ void case_198() } void case_199() -#line 1778 "cs-parser.jay" +#line 1787 "cs-parser.jay" { lbag.AppendToMember (current_property, GetLocation (yyVals[0+yyTop])); current_property = null; } void case_201() -#line 1792 "cs-parser.jay" +#line 1801 "cs-parser.jay" { valid_param_mod = 0; var type = (FullNamedExpression) yyVals[-5+yyTop]; @@ -5464,7 +5553,7 @@ void case_201() } void case_203() -#line 1821 "cs-parser.jay" +#line 1830 "cs-parser.jay" { if (current_property.AccessorFirst != null && current_property.AccessorFirst.Block == null) ((Indexer) current_property).ParameterInfo.CheckParameters (current_property); @@ -5477,7 +5566,7 @@ void case_203() } void case_208() -#line 1840 "cs-parser.jay" +#line 1849 "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 ()); @@ -5490,7 +5579,7 @@ void case_208() } void case_209() -#line 1854 "cs-parser.jay" +#line 1863 "cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone && lang_version == LanguageVersion.ISO_1) { FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "access modifiers on properties"); @@ -5513,7 +5602,7 @@ void case_209() } void case_210() -#line 1875 "cs-parser.jay" +#line 1884 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { current_property.Get.Block = (ToplevelBlock) yyVals[0+yyTop]; @@ -5536,7 +5625,7 @@ void case_210() } void case_211() -#line 1899 "cs-parser.jay" +#line 1908 "cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone && lang_version == LanguageVersion.ISO_1) { FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "access modifiers on properties"); @@ -5564,7 +5653,7 @@ void case_211() } void case_212() -#line 1925 "cs-parser.jay" +#line 1934 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { current_property.Set.Block = (ToplevelBlock) yyVals[0+yyTop]; @@ -5587,21 +5676,21 @@ void case_212() } void case_214() -#line 1950 "cs-parser.jay" +#line 1959 "cs-parser.jay" { savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; } void case_215() -#line 1955 "cs-parser.jay" +#line 1964 "cs-parser.jay" { Error_SyntaxError (1043, yyToken, "Invalid accessor body"); yyVal = null; } void case_217() -#line 1969 "cs-parser.jay" +#line 1978 "cs-parser.jay" { lexer.ConstraintsParsing = true; push_current_container (new Interface (current_container, (MemberName) yyVals[0+yyTop], (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]); @@ -5609,7 +5698,7 @@ void case_217() } void case_218() -#line 1976 "cs-parser.jay" +#line 1985 "cs-parser.jay" { lexer.ConstraintsParsing = false; @@ -5625,7 +5714,7 @@ void case_218() } void case_219() -#line 1990 "cs-parser.jay" +#line 1999 "cs-parser.jay" { --lexer.parsing_declaration; if (doc_support) @@ -5633,7 +5722,7 @@ void case_219() } void case_220() -#line 1996 "cs-parser.jay" +#line 2005 "cs-parser.jay" { if (yyVals[0+yyTop] == null) { lbag.AppendToMember (current_container, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); @@ -5643,8 +5732,22 @@ void case_220() yyVal = pop_current_class (); } +void case_224() +#line 2026 "cs-parser.jay" +{ + lexer.parsing_modifiers = true; + lexer.parsing_block = 0; + } + +void case_225() +#line 2031 "cs-parser.jay" +{ + lexer.parsing_modifiers = true; + lexer.parsing_block = 0; + } + void case_236() -#line 2058 "cs-parser.jay" +#line 2069 "cs-parser.jay" { OperatorDeclaration decl = (OperatorDeclaration) yyVals[-2+yyTop]; if (decl != null) { @@ -5674,14 +5777,14 @@ void case_236() } void case_240() -#line 2095 "cs-parser.jay" +#line 2106 "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_242() -#line 2107 "cs-parser.jay" +#line 2118 "cs-parser.jay" { valid_param_mod = 0; @@ -5723,7 +5826,7 @@ void case_242() } void case_267() -#line 2183 "cs-parser.jay" +#line 2194 "cs-parser.jay" { valid_param_mod = 0; @@ -5744,7 +5847,7 @@ void case_267() } void case_269() -#line 2206 "cs-parser.jay" +#line 2217 "cs-parser.jay" { valid_param_mod = 0; @@ -5765,7 +5868,7 @@ void case_269() } void case_270() -#line 2225 "cs-parser.jay" +#line 2236 "cs-parser.jay" { Error_SyntaxError (yyToken); current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; @@ -5773,7 +5876,7 @@ void case_270() } void case_271() -#line 2231 "cs-parser.jay" +#line 2242 "cs-parser.jay" { Error_SyntaxError (yyToken); current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; @@ -5781,7 +5884,7 @@ void case_271() } void case_272() -#line 2241 "cs-parser.jay" +#line 2252 "cs-parser.jay" { Constructor c = (Constructor) yyVals[-1+yyTop]; c.Block = (ToplevelBlock) yyVals[0+yyTop]; @@ -5795,7 +5898,7 @@ void case_272() } void case_273() -#line 2258 "cs-parser.jay" +#line 2269 "cs-parser.jay" { if (doc_support) { tmpComment = Lexer.consume_doc_comment (); @@ -5806,7 +5909,7 @@ void case_273() } void case_274() -#line 2267 "cs-parser.jay" +#line 2278 "cs-parser.jay" { valid_param_mod = 0; current_local_parameters = (ParametersCompiled) yyVals[-1+yyTop]; @@ -5837,7 +5940,7 @@ void case_274() } void case_275() -#line 2296 "cs-parser.jay" +#line 2307 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { var c = (Constructor) yyVals[-1+yyTop]; @@ -5854,7 +5957,7 @@ void case_275() } void case_281() -#line 2328 "cs-parser.jay" +#line 2339 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstructorBaseInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); @@ -5862,7 +5965,7 @@ void case_281() } void case_283() -#line 2338 "cs-parser.jay" +#line 2349 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstructorThisInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); @@ -5870,7 +5973,7 @@ void case_283() } void case_284() -#line 2344 "cs-parser.jay" +#line 2355 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new ConstructorThisInitializer (null, GetLocation (yyVals[0+yyTop])); @@ -5878,14 +5981,14 @@ void case_284() } void case_285() -#line 2350 "cs-parser.jay" +#line 2361 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } void case_286() -#line 2358 "cs-parser.jay" +#line 2369 "cs-parser.jay" { if (doc_support) { tmpComment = Lexer.consume_doc_comment (); @@ -5896,7 +5999,7 @@ void case_286() } void case_287() -#line 2367 "cs-parser.jay" +#line 2378 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-3+yyTop]; if (lt.Value != current_container.MemberName.Name){ @@ -5919,7 +6022,7 @@ void case_287() } void case_288() -#line 2393 "cs-parser.jay" +#line 2404 "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); @@ -5933,7 +6036,7 @@ void case_288() } void case_289() -#line 2407 "cs-parser.jay" +#line 2418 "cs-parser.jay" { if (doc_support) { current_event_field.DocComment = Lexer.consume_doc_comment (); @@ -5948,7 +6051,7 @@ void case_289() } void case_290() -#line 2423 "cs-parser.jay" +#line 2434 "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); @@ -5958,7 +6061,7 @@ void case_290() } void case_291() -#line 2431 "cs-parser.jay" +#line 2442 "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"); @@ -5967,7 +6070,7 @@ void case_291() } void case_292() -#line 2438 "cs-parser.jay" +#line 2449 "cs-parser.jay" { if (doc_support) { current_event.DocComment = Lexer.consume_doc_comment (); @@ -5980,7 +6083,7 @@ void case_292() } void case_293() -#line 2451 "cs-parser.jay" +#line 2462 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -5988,7 +6091,7 @@ void case_293() } void case_296() -#line 2465 "cs-parser.jay" +#line 2476 "cs-parser.jay" { --lexer.parsing_block; savedEventAssignLocation = GetLocation (yyVals[-2+yyTop]); @@ -5996,7 +6099,7 @@ void case_296() } void case_301() -#line 2490 "cs-parser.jay" +#line 2501 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null); @@ -6004,7 +6107,7 @@ void case_301() } void case_303() -#line 2500 "cs-parser.jay" +#line 2511 "cs-parser.jay" { --lexer.parsing_block; var lt = (LocatedToken) yyVals[-3+yyTop]; @@ -6013,7 +6116,7 @@ void case_303() } void case_304() -#line 2509 "cs-parser.jay" +#line 2520 "cs-parser.jay" { if (current_container.Kind == MemberKind.Interface) { report.Error (68, lexer.Location, "`{0}': event in interface cannot have an initializer", @@ -6027,28 +6130,28 @@ void case_304() } void case_308() -#line 2530 "cs-parser.jay" +#line 2541 "cs-parser.jay" { report.Error (65, lexer.Location, "`{0}': event property must have both add and remove accessors", current_event.GetSignatureForError ()); } void case_309() -#line 2535 "cs-parser.jay" +#line 2546 "cs-parser.jay" { report.Error (65, lexer.Location, "`{0}': event property must have both add and remove accessors", current_event.GetSignatureForError ()); } void case_310() -#line 2540 "cs-parser.jay" +#line 2551 "cs-parser.jay" { report.Error (1055, GetLocation (yyVals[0+yyTop]), "An add or remove accessor expected"); yyVal = null; } void case_311() -#line 2548 "cs-parser.jay" +#line 2559 "cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone) { report.Error (1609, GetLocation (yyVals[-1+yyTop]), "Modifiers cannot be placed on event accessor declarations"); @@ -6062,7 +6165,7 @@ void case_311() } void case_312() -#line 2560 "cs-parser.jay" +#line 2571 "cs-parser.jay" { lexer.EventParsing = true; @@ -6077,7 +6180,7 @@ void case_312() } void case_313() -#line 2576 "cs-parser.jay" +#line 2587 "cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone) { report.Error (1609, GetLocation (yyVals[-1+yyTop]), "Modifiers cannot be placed on event accessor declarations"); @@ -6091,7 +6194,7 @@ void case_313() } void case_314() -#line 2588 "cs-parser.jay" +#line 2599 "cs-parser.jay" { lexer.EventParsing = true; @@ -6106,14 +6209,14 @@ void case_314() } void case_315() -#line 2604 "cs-parser.jay" +#line 2615 "cs-parser.jay" { report.Error (73, lexer.Location, "An add or remove accessor must have a body"); yyVal = null; } void case_317() -#line 2613 "cs-parser.jay" +#line 2624 "cs-parser.jay" { current_type.UnattachedAttributes = (Attributes) yyVals[-1+yyTop]; report.Error (1519, GetLocation (yyVals[-1+yyTop]), "An attribute is missing member declaration"); @@ -6121,7 +6224,7 @@ void case_317() } void case_318() -#line 2624 "cs-parser.jay" +#line 2635 "cs-parser.jay" { report.Error (1519, lexer.Location, "Unexpected symbol `}' in class, struct, or interface member declaration"); @@ -6136,14 +6239,14 @@ void case_318() } void case_319() -#line 2644 "cs-parser.jay" +#line 2655 "cs-parser.jay" { if (doc_support) enumTypeComment = Lexer.consume_doc_comment (); } void case_320() -#line 2649 "cs-parser.jay" +#line 2660 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; @@ -6162,7 +6265,7 @@ void case_320() } void case_321() -#line 2666 "cs-parser.jay" +#line 2677 "cs-parser.jay" { lexer.parsing_modifiers = true; @@ -6172,7 +6275,7 @@ void case_321() } void case_322() -#line 2674 "cs-parser.jay" +#line 2685 "cs-parser.jay" { lbag.AppendToMember (current_container, GetLocation (yyVals[-1+yyTop])); if (yyVals[0+yyTop] != null) { @@ -6190,28 +6293,28 @@ void case_322() } void case_324() -#line 2694 "cs-parser.jay" +#line 2705 "cs-parser.jay" { savedLocation = GetLocation (yyVals[-1+yyTop]); yyVal = yyVals[0+yyTop]; } void case_325() -#line 2699 "cs-parser.jay" +#line 2710 "cs-parser.jay" { Error_TypeExpected (GetLocation (yyVals[-1+yyTop])); yyVal = null; } void case_330() -#line 2717 "cs-parser.jay" +#line 2728 "cs-parser.jay" { lbag.AppendToMember (current_container, GetLocation (yyVals[-1+yyTop])); yyVal = yyVals[0+yyTop]; } void case_331() -#line 2725 "cs-parser.jay" +#line 2736 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; var em = new EnumMember ((Enum) current_type, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-1+yyTop]); @@ -6226,7 +6329,7 @@ void case_331() } void case_332() -#line 2738 "cs-parser.jay" +#line 2749 "cs-parser.jay" { ++lexer.parsing_block; if (doc_support) { @@ -6236,7 +6339,7 @@ void case_332() } void case_333() -#line 2746 "cs-parser.jay" +#line 2757 "cs-parser.jay" { --lexer.parsing_block; @@ -6252,7 +6355,7 @@ void case_333() } void case_334() -#line 2760 "cs-parser.jay" +#line 2771 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -6269,7 +6372,7 @@ void case_334() } void case_337() -#line 2787 "cs-parser.jay" +#line 2798 "cs-parser.jay" { valid_param_mod = 0; @@ -6286,7 +6389,7 @@ void case_337() } void case_339() -#line 2806 "cs-parser.jay" +#line 2817 "cs-parser.jay" { if (doc_support) { current_delegate.DocComment = Lexer.consume_doc_comment (); @@ -6303,7 +6406,7 @@ void case_339() } void case_341() -#line 2825 "cs-parser.jay" +#line 2836 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "nullable types"); @@ -6312,7 +6415,7 @@ void case_341() } void case_343() -#line 2836 "cs-parser.jay" +#line 2847 "cs-parser.jay" { var lt1 = (LocatedToken) yyVals[-2+yyTop]; var lt2 = (LocatedToken) yyVals[-1+yyTop]; @@ -6322,7 +6425,7 @@ void case_343() } void case_345() -#line 2848 "cs-parser.jay" +#line 2859 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); @@ -6330,14 +6433,14 @@ void case_345() } void case_346() -#line 2857 "cs-parser.jay" +#line 2868 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; yyVal = new SimpleName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } void case_348() -#line 2869 "cs-parser.jay" +#line 2880 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "generics"); @@ -6350,14 +6453,14 @@ void case_348() } void case_349() -#line 2880 "cs-parser.jay" +#line 2891 "cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = new TypeArguments (); } void case_350() -#line 2888 "cs-parser.jay" +#line 2899 "cs-parser.jay" { TypeArguments type_args = new TypeArguments (); type_args.Add ((FullNamedExpression) yyVals[0+yyTop]); @@ -6366,7 +6469,7 @@ void case_350() } void case_351() -#line 2895 "cs-parser.jay" +#line 2906 "cs-parser.jay" { TypeArguments type_args = (TypeArguments) yyVals[-2+yyTop]; type_args.Add ((FullNamedExpression) yyVals[0+yyTop]); @@ -6375,7 +6478,7 @@ void case_351() } void case_353() -#line 2912 "cs-parser.jay" +#line 2923 "cs-parser.jay" { lexer.parsing_generic_declaration = false; var lt = (LocatedToken) yyVals[-2+yyTop]; @@ -6383,7 +6486,7 @@ void case_353() } void case_354() -#line 2921 "cs-parser.jay" +#line 2932 "cs-parser.jay" { MemberName mn = (MemberName)yyVals[0+yyTop]; if (mn.TypeParameters != null) @@ -6392,7 +6495,7 @@ void case_354() } void case_356() -#line 2932 "cs-parser.jay" +#line 2943 "cs-parser.jay" { lexer.parsing_generic_declaration = false; var lt = (LocatedToken) yyVals[-1+yyTop]; @@ -6400,21 +6503,21 @@ void case_356() } void case_357() -#line 2941 "cs-parser.jay" +#line 2952 "cs-parser.jay" { lexer.parsing_generic_declaration = false; yyVal = new MemberName (TypeDefinition.DefaultIndexerName, GetLocation (yyVals[0+yyTop])); } void case_358() -#line 2946 "cs-parser.jay" +#line 2957 "cs-parser.jay" { lexer.parsing_generic_declaration = false; yyVal = new MemberName (TypeDefinition.DefaultIndexerName, null, (ATypeNameExpression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } void case_359() -#line 2954 "cs-parser.jay" +#line 2965 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-2+yyTop]; yyVal = new SimpleName (lt.Value, (TypeArguments) yyVals[-1+yyTop], lt.Location); @@ -6422,7 +6525,7 @@ void case_359() } void case_360() -#line 2960 "cs-parser.jay" +#line 2971 "cs-parser.jay" { var lt1 = (LocatedToken) yyVals[-3+yyTop]; var lt2 = (LocatedToken) yyVals[-2+yyTop]; @@ -6432,7 +6535,7 @@ void case_360() } void case_361() -#line 2968 "cs-parser.jay" +#line 2979 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberAccess ((ATypeNameExpression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[-1+yyTop], lt.Location); @@ -6440,7 +6543,7 @@ void case_361() } void case_363() -#line 2978 "cs-parser.jay" +#line 2989 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "generics"); @@ -6453,7 +6556,7 @@ void case_363() } void case_364() -#line 2992 "cs-parser.jay" +#line 3003 "cs-parser.jay" { var tparams = new TypeParameters (); tparams.Add ((TypeParameter)yyVals[0+yyTop]); @@ -6462,7 +6565,7 @@ void case_364() } void case_365() -#line 2999 "cs-parser.jay" +#line 3010 "cs-parser.jay" { var tparams = (TypeParameters) yyVals[-2+yyTop]; tparams.Add ((TypeParameter)yyVals[0+yyTop]); @@ -6471,7 +6574,7 @@ void case_365() } void case_366() -#line 3009 "cs-parser.jay" +#line 3020 "cs-parser.jay" { var lt = (LocatedToken)yyVals[0+yyTop]; var variance = (VarianceDecl) yyVals[-1+yyTop]; @@ -6481,7 +6584,7 @@ void case_366() } void case_367() -#line 3017 "cs-parser.jay" +#line 3028 "cs-parser.jay" { if (GetTokenName (yyToken) == "type") report.Error (81, GetLocation (yyVals[0+yyTop]), "Type parameter declaration must be an identifier not a type"); @@ -6492,28 +6595,28 @@ void case_367() } void case_372() -#line 3051 "cs-parser.jay" +#line 3062 "cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } void case_374() -#line 3060 "cs-parser.jay" +#line 3071 "cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } void case_376() -#line 3069 "cs-parser.jay" +#line 3080 "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_379() -#line 3085 "cs-parser.jay" +#line 3096 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { yyVal = new ComposedCast ((ATypeNameExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); @@ -6527,14 +6630,14 @@ void case_379() } void case_381() -#line 3101 "cs-parser.jay" +#line 3112 "cs-parser.jay" { if (yyVals[0+yyTop] != null) yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } void case_384() -#line 3117 "cs-parser.jay" +#line 3128 "cs-parser.jay" { var types = new List (2); types.Add ((FullNamedExpression) yyVals[0+yyTop]); @@ -6542,7 +6645,7 @@ void case_384() } void case_385() -#line 3123 "cs-parser.jay" +#line 3134 "cs-parser.jay" { var types = (List) yyVals[-2+yyTop]; types.Add ((FullNamedExpression) yyVals[0+yyTop]); @@ -6551,7 +6654,7 @@ void case_385() } void case_386() -#line 3133 "cs-parser.jay" +#line 3144 "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 ()); @@ -6560,28 +6663,28 @@ void case_386() } void case_423() -#line 3197 "cs-parser.jay" +#line 3208 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; yyVal = new SimpleName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } void case_424() -#line 3201 "cs-parser.jay" +#line 3212 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionSimpleName (MemberName.MakeName (lt.Value, null), lt.Location); } void case_435() -#line 3242 "cs-parser.jay" +#line 3253 "cs-parser.jay" { yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } void case_437() -#line 3254 "cs-parser.jay" +#line 3265 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); @@ -6589,7 +6692,7 @@ void case_437() } void case_438() -#line 3260 "cs-parser.jay" +#line 3271 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); @@ -6597,7 +6700,7 @@ void case_438() } void case_439() -#line 3266 "cs-parser.jay" +#line 3277 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess (new BaseThis (GetLocation (yyVals[-3+yyTop])), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); @@ -6605,7 +6708,15 @@ void case_439() } void case_440() -#line 3272 "cs-parser.jay" +#line 3283 "cs-parser.jay" +{ + var lt = (LocatedToken) yyVals[-1+yyTop]; + yyVal = new MemberAccess (new SimpleName ("await", ((LocatedToken) yyVals[-3+yyTop]).Location), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); + lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); + } + +void case_441() +#line 3289 "cs-parser.jay" { var lt1 = (LocatedToken) yyVals[-2+yyTop]; var lt2 = (LocatedToken) yyVals[-1+yyTop]; @@ -6614,29 +6725,29 @@ void case_440() lbag.AddLocation (yyVal, savedLocation, GetLocation (yyVals[-1+yyTop])); } -void case_442() -#line 3282 "cs-parser.jay" +void case_443() +#line 3299 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionMemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, lt.Location); } -void case_444() -#line 3290 "cs-parser.jay" +void case_445() +#line 3307 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionMemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, lt.Location); } -void case_445() -#line 3298 "cs-parser.jay" +void case_446() +#line 3315 "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_446() -#line 3303 "cs-parser.jay" +void case_447() +#line 3320 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -6644,8 +6755,8 @@ void case_446() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_447() -#line 3310 "cs-parser.jay" +void case_448() +#line 3327 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -6653,8 +6764,8 @@ void case_447() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_450() -#line 3325 "cs-parser.jay" +void case_451() +#line 3342 "cs-parser.jay" { if (yyVals[-1+yyTop] == null) { yyVal = new CollectionOrObjectInitializers (GetLocation (yyVals[-2+yyTop])); @@ -6664,23 +6775,23 @@ void case_450() lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_451() -#line 3334 "cs-parser.jay" +void case_452() +#line 3351 "cs-parser.jay" { yyVal = new CollectionOrObjectInitializers ((List) yyVals[-2+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_454() -#line 3350 "cs-parser.jay" +void case_455() +#line 3367 "cs-parser.jay" { var a = new List (); a.Add ((Expression) yyVals[0+yyTop]); yyVal = a; } -void case_455() -#line 3356 "cs-parser.jay" +void case_456() +#line 3373 "cs-parser.jay" { var a = (List)yyVals[-2+yyTop]; a.Add ((Expression) yyVals[0+yyTop]); @@ -6688,31 +6799,31 @@ void case_455() yyVal = a; } -void case_456() -#line 3362 "cs-parser.jay" +void case_457() +#line 3379 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = yyVals[-1+yyTop]; } -void case_457() -#line 3370 "cs-parser.jay" +void case_458() +#line 3387 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-2+yyTop]; yyVal = new ElementInitializer (lt.Value, (Expression)yyVals[0+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_458() -#line 3376 "cs-parser.jay" +void case_459() +#line 3393 "cs-parser.jay" { var lt = (LocatedToken) Error_AwaitAsIdentifier (yyVals[-2+yyTop]); yyVal = new ElementInitializer (lt.Value, (Expression)yyVals[0+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_460() -#line 3385 "cs-parser.jay" +void case_461() +#line 3402 "cs-parser.jay" { CompletionSimpleName csn = yyVals[-1+yyTop] as CompletionSimpleName; if (csn == null) @@ -6721,8 +6832,8 @@ void case_460() yyVal = new CompletionElementInitializer (csn.Prefix, csn.Location); } -void case_461() -#line 3393 "cs-parser.jay" +void case_462() +#line 3410 "cs-parser.jay" { if (yyVals[-1+yyTop] == null) yyVal = new CollectionElementInitializer (GetLocation (yyVals[-2+yyTop])); @@ -6732,24 +6843,24 @@ void case_461() } } -void case_462() -#line 3402 "cs-parser.jay" +void case_463() +#line 3419 "cs-parser.jay" { report.Error (1920, GetLocation (yyVals[-1+yyTop]), "An element initializer cannot be empty"); yyVal = new CollectionElementInitializer (GetLocation (yyVals[-1+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_467() -#line 3421 "cs-parser.jay" +void case_468() +#line 3438 "cs-parser.jay" { Arguments list = new Arguments (4); list.Add ((Argument) yyVals[0+yyTop]); yyVal = list; } -void case_468() -#line 3427 "cs-parser.jay" +void case_469() +#line 3444 "cs-parser.jay" { Arguments list = (Arguments) yyVals[-2+yyTop]; if (list [list.Count - 1] is NamedArgument) @@ -6760,8 +6871,8 @@ void case_468() yyVal = list; } -void case_469() -#line 3437 "cs-parser.jay" +void case_470() +#line 3454 "cs-parser.jay" { Arguments list = (Arguments) yyVals[-2+yyTop]; NamedArgument a = (NamedArgument) yyVals[0+yyTop]; @@ -6777,8 +6888,8 @@ void case_469() yyVal = list; } -void case_470() -#line 3452 "cs-parser.jay" +void case_471() +#line 3469 "cs-parser.jay" { if (lexer.putback_char == -1) lexer.putback (')'); /* TODO: Wrong but what can I do*/ @@ -6786,72 +6897,72 @@ void case_470() yyVal = yyVals[-2+yyTop]; } -void case_471() -#line 3459 "cs-parser.jay" +void case_472() +#line 3476 "cs-parser.jay" { report.Error (839, GetLocation (yyVals[-1+yyTop]), "An argument is missing"); yyVal = null; } -void case_476() -#line 3480 "cs-parser.jay" +void case_477() +#line 3497 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Ref); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_477() -#line 3485 "cs-parser.jay" +void case_478() +#line 3502 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Out); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_478() -#line 3490 "cs-parser.jay" +void case_479() +#line 3507 "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_479() -#line 3495 "cs-parser.jay" +void case_480() +#line 3512 "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_481() -#line 3507 "cs-parser.jay" +void case_482() +#line 3524 "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_482() -#line 3512 "cs-parser.jay" +void case_483() +#line 3529 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_483() -#line 3517 "cs-parser.jay" +void case_484() +#line 3534 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new ElementAccess ((Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-1+yyTop])); } -void case_484() -#line 3525 "cs-parser.jay" +void case_485() +#line 3542 "cs-parser.jay" { var list = new List (4); list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } -void case_485() -#line 3531 "cs-parser.jay" +void case_486() +#line 3548 "cs-parser.jay" { var list = (List) yyVals[-2+yyTop]; list.Add ((Expression) yyVals[0+yyTop]); @@ -6859,16 +6970,16 @@ void case_485() yyVal = list; } -void case_486() -#line 3541 "cs-parser.jay" +void case_487() +#line 3558 "cs-parser.jay" { Arguments args = new Arguments (4); args.Add ((Argument) yyVals[0+yyTop]); yyVal = args; } -void case_487() -#line 3547 "cs-parser.jay" +void case_488() +#line 3564 "cs-parser.jay" { Arguments args = (Arguments) yyVals[-2+yyTop]; if (args [args.Count - 1] is NamedArgument && !(yyVals[0+yyTop] is NamedArgument)) @@ -6879,22 +6990,22 @@ void case_487() yyVal = args; } -void case_491() -#line 3575 "cs-parser.jay" +void case_492() +#line 3592 "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_492() -#line 3580 "cs-parser.jay" +void case_493() +#line 3597 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new ElementAccess (null, null, GetLocation (yyVals[-1+yyTop])); } -void case_495() -#line 3602 "cs-parser.jay" +void case_496() +#line 3619 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { if (lang_version <= LanguageVersion.ISO_2) @@ -6908,8 +7019,8 @@ void case_495() lbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_496() -#line 3615 "cs-parser.jay" +void case_497() +#line 3632 "cs-parser.jay" { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "collection initializers"); @@ -6917,8 +7028,8 @@ void case_496() yyVal = new NewInitialize ((FullNamedExpression) yyVals[-1+yyTop], null, (CollectionOrObjectInitializers) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_497() -#line 3627 "cs-parser.jay" +void case_498() +#line 3644 "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])) { @@ -6927,8 +7038,8 @@ void case_497() lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_498() -#line 3635 "cs-parser.jay" +void case_499() +#line 3652 "cs-parser.jay" { if (yyVals[0+yyTop] == null) report.Error (1586, GetLocation (yyVals[-3+yyTop]), "Array creation must have array size or array initializer"); @@ -6936,8 +7047,8 @@ void case_498() yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-2+yyTop], (ComposedTypeSpecifier) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); } -void case_499() -#line 3642 "cs-parser.jay" +void case_500() +#line 3659 "cs-parser.jay" { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "implicitly typed arrays"); @@ -6945,30 +7056,30 @@ void case_499() yyVal = new ImplicitlyTypedArrayCreation ((ComposedTypeSpecifier) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_500() -#line 3649 "cs-parser.jay" +void case_501() +#line 3666 "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_501() -#line 3654 "cs-parser.jay" +void case_502() +#line 3671 "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_503() -#line 3666 "cs-parser.jay" +void case_504() +#line 3683 "cs-parser.jay" { --lexer.parsing_type; yyVal = yyVals[0+yyTop]; } -void case_504() -#line 3674 "cs-parser.jay" +void case_505() +#line 3691 "cs-parser.jay" { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "anonymous types"); @@ -6979,16 +7090,16 @@ void case_504() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_509() -#line 3697 "cs-parser.jay" +void case_511() +#line 3718 "cs-parser.jay" { var a = new List (4); a.Add ((AnonymousTypeParameter) yyVals[0+yyTop]); yyVal = a; } -void case_510() -#line 3703 "cs-parser.jay" +void case_512() +#line 3724 "cs-parser.jay" { var a = (List) yyVals[-2+yyTop]; a.Add ((AnonymousTypeParameter) yyVals[0+yyTop]); @@ -6997,60 +7108,60 @@ void case_510() yyVal = a; } -void case_511() -#line 3714 "cs-parser.jay" +void case_515() +#line 3743 "cs-parser.jay" { var lt = (LocatedToken)yyVals[-2+yyTop]; yyVal = new AnonymousTypeParameter ((Expression)yyVals[0+yyTop], lt.Value, lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_512() -#line 3720 "cs-parser.jay" +void case_516() +#line 3749 "cs-parser.jay" { var lt = (LocatedToken)yyVals[0+yyTop]; yyVal = new AnonymousTypeParameter (new SimpleName (lt.Value, lt.Location), lt.Value, lt.Location); } -void case_513() -#line 3726 "cs-parser.jay" +void case_517() +#line 3755 "cs-parser.jay" { MemberAccess ma = (MemberAccess) yyVals[0+yyTop]; yyVal = new AnonymousTypeParameter (ma, ma.Name, ma.Location); } -void case_514() -#line 3731 "cs-parser.jay" +void case_518() +#line 3760 "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_518() -#line 3746 "cs-parser.jay" +void case_522() +#line 3775 "cs-parser.jay" { ((ComposedTypeSpecifier) yyVals[-1+yyTop]).Next = (ComposedTypeSpecifier) yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } -void case_519() -#line 3754 "cs-parser.jay" +void case_523() +#line 3783 "cs-parser.jay" { yyVal = ComposedTypeSpecifier.CreateArrayDimension (1, GetLocation (yyVals[-1+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_520() -#line 3759 "cs-parser.jay" +void case_524() +#line 3788 "cs-parser.jay" { yyVal = ComposedTypeSpecifier.CreateArrayDimension ((int)yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_525() -#line 3789 "cs-parser.jay" +void case_529() +#line 3818 "cs-parser.jay" { var ai = new ArrayInitializer (0, GetLocation (yyVals[-1+yyTop])); ai.VariableDeclaration = current_variable; @@ -7058,8 +7169,8 @@ void case_525() yyVal = ai; } -void case_526() -#line 3796 "cs-parser.jay" +void case_530() +#line 3825 "cs-parser.jay" { var ai = new ArrayInitializer ((List) yyVals[-2+yyTop], GetLocation (yyVals[-3+yyTop])); ai.VariableDeclaration = current_variable; @@ -7071,16 +7182,16 @@ void case_526() yyVal = ai; } -void case_527() -#line 3810 "cs-parser.jay" +void case_531() +#line 3839 "cs-parser.jay" { var list = new List (4); list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } -void case_528() -#line 3816 "cs-parser.jay" +void case_532() +#line 3845 "cs-parser.jay" { var list = (List) yyVals[-2+yyTop]; list.Add ((Expression) yyVals[0+yyTop]); @@ -7088,23 +7199,23 @@ void case_528() yyVal = list; } -void case_530() -#line 3830 "cs-parser.jay" +void case_534() +#line 3859 "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_533() -#line 3841 "cs-parser.jay" +void case_537() +#line 3870 "cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = null; } -void case_534() -#line 3849 "cs-parser.jay" +void case_538() +#line 3878 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; @@ -7113,8 +7224,8 @@ void case_534() lbag.AddLocation (sn.TypeArguments, Lexer.GetGenericDimensionLocations ()); } -void case_535() -#line 3857 "cs-parser.jay" +void case_539() +#line 3886 "cs-parser.jay" { var lt1 = (LocatedToken) yyVals[-2+yyTop]; var lt2 = (LocatedToken) yyVals[-1+yyTop]; @@ -7125,8 +7236,8 @@ void case_535() lbag.AddLocation (yyVal, savedLocation, GetLocation (yyVals[-1+yyTop])); } -void case_536() -#line 3867 "cs-parser.jay" +void case_540() +#line 3896 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; @@ -7134,8 +7245,8 @@ void case_536() lbag.AddLocation (yyVal, savedLocation, GetLocation (yyVals[-1+yyTop])); } -void case_537() -#line 3874 "cs-parser.jay" +void case_541() +#line 3903 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; @@ -7145,8 +7256,8 @@ void case_537() lbag.AddLocation (ma.TypeArguments, Lexer.GetGenericDimensionLocations ()); } -void case_538() -#line 3883 "cs-parser.jay" +void case_542() +#line 3912 "cs-parser.jay" { var tne = (ATypeNameExpression) yyVals[-3+yyTop]; if (tne.HasTypeArguments) @@ -7158,8 +7269,8 @@ void case_538() lbag.AddLocation (ma.TypeArguments, Lexer.GetGenericDimensionLocations ()); } -void case_539() -#line 3897 "cs-parser.jay" +void case_543() +#line 3926 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "generics"); @@ -7167,8 +7278,8 @@ void case_539() yyVal = yyVals[0+yyTop]; } -void case_540() -#line 3907 "cs-parser.jay" +void case_544() +#line 3936 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; if (lang_version == LanguageVersion.ISO_1) @@ -7177,15 +7288,15 @@ void case_540() yyVal = lt; } -void case_541() -#line 3918 "cs-parser.jay" +void case_545() +#line 3947 "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_542() -#line 3923 "cs-parser.jay" +void case_546() +#line 3952 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7193,45 +7304,45 @@ void case_542() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_543() -#line 3933 "cs-parser.jay" +void case_547() +#line 3962 "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_544() -#line 3938 "cs-parser.jay" +void case_548() +#line 3967 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new CheckedExpr (null, GetLocation (yyVals[-1+yyTop])); } -void case_545() -#line 3947 "cs-parser.jay" +void case_549() +#line 3976 "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_546() -#line 3952 "cs-parser.jay" +void case_550() +#line 3981 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new UnCheckedExpr (null, GetLocation (yyVals[-1+yyTop])); } -void case_547() -#line 3961 "cs-parser.jay" +void case_551() +#line 3990 "cs-parser.jay" { var lt = (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_549() -#line 3973 "cs-parser.jay" +void case_553() +#line 4002 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); if ((ParametersCompiled) yyVals[-2+yyTop] != ParametersCompiled.Undefined) { @@ -7241,8 +7352,8 @@ void case_549() } } -void case_551() -#line 3986 "cs-parser.jay" +void case_555() +#line 4015 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); @@ -7253,8 +7364,8 @@ void case_551() } } -void case_555() -#line 4011 "cs-parser.jay" +void case_559() +#line 4040 "cs-parser.jay" { valid_param_mod = 0; yyVal = yyVals[-1+yyTop]; @@ -7262,8 +7373,8 @@ void case_555() PushLocation (GetLocation (yyVals[-3+yyTop])); } -void case_556() -#line 4021 "cs-parser.jay" +void case_560() +#line 4050 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "default value expression"); @@ -7272,15 +7383,15 @@ void case_556() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_560() -#line 4041 "cs-parser.jay" +void case_564() +#line 4070 "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_561() -#line 4046 "cs-parser.jay" +void case_565() +#line 4075 "cs-parser.jay" { if (!async_block) { if (current_anonymous_method is LambdaExpression) { @@ -7303,24 +7414,24 @@ void case_561() yyVal = new Await ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_562() -#line 4068 "cs-parser.jay" +void case_566() +#line 4097 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Unary (Unary.Operator.LogicalNot, null, GetLocation (yyVals[-1+yyTop])); } -void case_563() -#line 4074 "cs-parser.jay" +void case_567() +#line 4103 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Unary (Unary.Operator.OnesComplement, null, GetLocation (yyVals[-1+yyTop])); } -void case_564() -#line 4080 "cs-parser.jay" +void case_568() +#line 4109 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7328,85 +7439,85 @@ void case_564() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_565() -#line 4087 "cs-parser.jay" +void case_569() +#line 4116 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Await (null, GetLocation (yyVals[-1+yyTop])); } -void case_573() -#line 4125 "cs-parser.jay" +void case_577() +#line 4154 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Unary (Unary.Operator.UnaryPlus, null, GetLocation (yyVals[-1+yyTop])); } -void case_574() -#line 4131 "cs-parser.jay" +void case_578() +#line 4160 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Unary (Unary.Operator.UnaryNegation, null, GetLocation (yyVals[-1+yyTop])); } -void case_575() -#line 4137 "cs-parser.jay" +void case_579() +#line 4166 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new UnaryMutator (UnaryMutator.Mode.PreIncrement, null, GetLocation (yyVals[-1+yyTop])); } -void case_576() -#line 4143 "cs-parser.jay" +void case_580() +#line 4172 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new UnaryMutator (UnaryMutator.Mode.PreDecrement, null, GetLocation (yyVals[-1+yyTop])); } -void case_577() -#line 4149 "cs-parser.jay" +void case_581() +#line 4178 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Indirection (null, GetLocation (yyVals[-1+yyTop])); } -void case_578() -#line 4155 "cs-parser.jay" +void case_582() +#line 4184 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Unary (Unary.Operator.AddressOf, null, GetLocation (yyVals[-1+yyTop])); } -void case_580() -#line 4165 "cs-parser.jay" +void case_584() +#line 4194 "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_581() -#line 4170 "cs-parser.jay" +void case_585() +#line 4199 "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_582() -#line 4175 "cs-parser.jay" +void case_586() +#line 4204 "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_583() -#line 4180 "cs-parser.jay" +void case_587() +#line 4209 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7414,8 +7525,8 @@ void case_583() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_584() -#line 4187 "cs-parser.jay" +void case_588() +#line 4216 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7423,8 +7534,8 @@ void case_584() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_585() -#line 4194 "cs-parser.jay" +void case_589() +#line 4223 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7432,22 +7543,22 @@ void case_585() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_587() -#line 4205 "cs-parser.jay" +void case_591() +#line 4234 "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_588() -#line 4210 "cs-parser.jay" +void case_592() +#line 4239 "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_591() -#line 4223 "cs-parser.jay" +void case_595() +#line 4252 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7455,8 +7566,8 @@ void case_591() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_592() -#line 4230 "cs-parser.jay" +void case_596() +#line 4259 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7464,38 +7575,52 @@ void case_592() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_593() -#line 4237 "cs-parser.jay" +void case_597() +#line 4266 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new As ((Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-1+yyTop])); } -void case_594() -#line 4243 "cs-parser.jay" +void case_598() +#line 4272 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Is ((Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-1+yyTop])); } -void case_596() -#line 4253 "cs-parser.jay" +void case_599() +#line 4278 "cs-parser.jay" +{ + var lt = (LocatedToken) yyVals[-2+yyTop]; + yyVal = new Is (new SimpleName (lt.Value, lt.Location), (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } + +void case_600() +#line 4283 "cs-parser.jay" +{ + var lt = (LocatedToken) yyVals[-2+yyTop]; + yyVal = new As (new SimpleName (lt.Value, lt.Location), (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } + +void case_602() +#line 4292 "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_597() -#line 4258 "cs-parser.jay" +void case_603() +#line 4297 "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_598() -#line 4263 "cs-parser.jay" +void case_604() +#line 4302 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7503,8 +7628,8 @@ void case_598() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_599() -#line 4270 "cs-parser.jay" +void case_605() +#line 4309 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7512,36 +7637,36 @@ void case_599() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_601() -#line 4281 "cs-parser.jay" +void case_607() +#line 4320 "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_602() -#line 4286 "cs-parser.jay" +void case_608() +#line 4325 "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_603() -#line 4291 "cs-parser.jay" +void case_609() +#line 4330 "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_604() -#line 4296 "cs-parser.jay" +void case_610() +#line 4335 "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_605() -#line 4301 "cs-parser.jay" +void case_611() +#line 4340 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7549,8 +7674,8 @@ void case_605() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_606() -#line 4308 "cs-parser.jay" +void case_612() +#line 4347 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7558,8 +7683,8 @@ void case_606() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_607() -#line 4315 "cs-parser.jay" +void case_613() +#line 4354 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7567,8 +7692,8 @@ void case_607() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_608() -#line 4322 "cs-parser.jay" +void case_614() +#line 4361 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7576,22 +7701,22 @@ void case_608() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_610() -#line 4333 "cs-parser.jay" +void case_616() +#line 4372 "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_611() -#line 4338 "cs-parser.jay" +void case_617() +#line 4377 "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_612() -#line 4343 "cs-parser.jay" +void case_618() +#line 4382 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7599,8 +7724,8 @@ void case_612() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_613() -#line 4350 "cs-parser.jay" +void case_619() +#line 4389 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7608,15 +7733,15 @@ void case_613() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_615() -#line 4361 "cs-parser.jay" +void case_621() +#line 4400 "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_616() -#line 4366 "cs-parser.jay" +void case_622() +#line 4405 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7624,15 +7749,15 @@ void case_616() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_618() -#line 4377 "cs-parser.jay" +void case_624() +#line 4416 "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_619() -#line 4382 "cs-parser.jay" +void case_625() +#line 4421 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7640,15 +7765,15 @@ void case_619() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_621() -#line 4393 "cs-parser.jay" +void case_627() +#line 4432 "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_622() -#line 4398 "cs-parser.jay" +void case_628() +#line 4437 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7656,15 +7781,15 @@ void case_622() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_624() -#line 4409 "cs-parser.jay" +void case_630() +#line 4448 "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_625() -#line 4414 "cs-parser.jay" +void case_631() +#line 4453 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7672,15 +7797,15 @@ void case_625() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_627() -#line 4425 "cs-parser.jay" +void case_633() +#line 4464 "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_628() -#line 4430 "cs-parser.jay" +void case_634() +#line 4469 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7688,8 +7813,8 @@ void case_628() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_630() -#line 4441 "cs-parser.jay" +void case_636() +#line 4480 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "null coalescing operator"); @@ -7698,23 +7823,23 @@ void case_630() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_632() -#line 4453 "cs-parser.jay" +void case_638() +#line 4492 "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_633() -#line 4458 "cs-parser.jay" +void case_639() +#line 4497 "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_634() -#line 4464 "cs-parser.jay" +void case_640() +#line 4503 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -7722,8 +7847,8 @@ void case_634() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_635() -#line 4471 "cs-parser.jay" +void case_641() +#line 4510 "cs-parser.jay" { Error_SyntaxError (Token.CLOSE_BRACE); @@ -7732,85 +7857,85 @@ void case_635() lexer.putback ('}'); } -void case_636() -#line 4482 "cs-parser.jay" +void case_642() +#line 4521 "cs-parser.jay" { yyVal = new SimpleAssign ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_637() -#line 4487 "cs-parser.jay" +void case_643() +#line 4526 "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_638() -#line 4492 "cs-parser.jay" +void case_644() +#line 4531 "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_639() -#line 4497 "cs-parser.jay" +void case_645() +#line 4536 "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_640() -#line 4502 "cs-parser.jay" +void case_646() +#line 4541 "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_641() -#line 4507 "cs-parser.jay" +void case_647() +#line 4546 "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_642() -#line 4512 "cs-parser.jay" +void case_648() +#line 4551 "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_643() -#line 4517 "cs-parser.jay" +void case_649() +#line 4556 "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_644() -#line 4522 "cs-parser.jay" +void case_650() +#line 4561 "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_645() -#line 4527 "cs-parser.jay" +void case_651() +#line 4566 "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_646() -#line 4532 "cs-parser.jay" +void case_652() +#line 4571 "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_647() -#line 4540 "cs-parser.jay" +void case_653() +#line 4579 "cs-parser.jay" { var pars = new List (4); pars.Add ((Parameter) yyVals[0+yyTop]); @@ -7818,8 +7943,8 @@ void case_647() yyVal = pars; } -void case_648() -#line 4547 "cs-parser.jay" +void case_654() +#line 4586 "cs-parser.jay" { var pars = (List) yyVals[-2+yyTop]; Parameter p = (Parameter)yyVals[0+yyTop]; @@ -7833,46 +7958,46 @@ void case_648() yyVal = pars; } -void case_649() -#line 4563 "cs-parser.jay" +void case_655() +#line 4602 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Parameter.Modifier) yyVals[-2+yyTop], null, lt.Location); } -void case_650() -#line 4569 "cs-parser.jay" +void case_656() +#line 4608 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, Parameter.Modifier.NONE, null, lt.Location); } -void case_651() -#line 4575 "cs-parser.jay" +void case_657() +#line 4614 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; yyVal = new ImplicitLambdaParameter (lt.Value, lt.Location); } -void case_652() -#line 4580 "cs-parser.jay" +void case_658() +#line 4619 "cs-parser.jay" { var lt = (LocatedToken) Error_AwaitAsIdentifier (yyVals[0+yyTop]); yyVal = new ImplicitLambdaParameter (lt.Value, lt.Location); } -void case_654() -#line 4588 "cs-parser.jay" +void case_660() +#line 4627 "cs-parser.jay" { var pars_list = (List) yyVals[0+yyTop]; yyVal = new ParametersCompiled (pars_list.ToArray ()); lbag.AddLocation (yyVal, parameterListCommas); } -void case_656() -#line 4600 "cs-parser.jay" +void case_662() +#line 4639 "cs-parser.jay" { Block b = end_block (Location.Null); b.IsCompilerGenerated = true; @@ -7880,8 +8005,8 @@ void case_656() yyVal = b; } -void case_658() -#line 4608 "cs-parser.jay" +void case_664() +#line 4647 "cs-parser.jay" { /* Handles only cases like foo = x.FirstOrDefault (l => );*/ /* where we must restore current_variable*/ @@ -7892,109 +8017,128 @@ void case_658() yyVal = null; } -void case_660() -#line 4622 "cs-parser.jay" +void case_666() +#line 4661 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } -void case_661() -#line 4630 "cs-parser.jay" +void case_667() +#line 4669 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; Parameter p = new ImplicitLambdaParameter (lt.Value, lt.Location); start_anonymous (true, new ParametersCompiled (p), false, lt.Location); } -void case_662() -#line 4636 "cs-parser.jay" +void case_668() +#line 4675 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_663() -#line 4641 "cs-parser.jay" +void case_669() +#line 4680 "cs-parser.jay" { var lt = (LocatedToken) Error_AwaitAsIdentifier (yyVals[-1+yyTop]); Parameter p = new ImplicitLambdaParameter (lt.Value, lt.Location); start_anonymous (true, new ParametersCompiled (p), false, lt.Location); } -void case_664() -#line 4647 "cs-parser.jay" +void case_670() +#line 4686 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_665() -#line 4652 "cs-parser.jay" +void case_671() +#line 4691 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; Parameter p = new ImplicitLambdaParameter (lt.Value, lt.Location); start_anonymous (true, new ParametersCompiled (p), true, lt.Location); } -void case_666() -#line 4658 "cs-parser.jay" +void case_672() +#line 4697 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_668() -#line 4667 "cs-parser.jay" +void case_674() +#line 4706 "cs-parser.jay" { valid_param_mod = 0; start_anonymous (true, (ParametersCompiled) yyVals[-2+yyTop], false, GetLocation (yyVals[-4+yyTop])); } -void case_669() -#line 4672 "cs-parser.jay" +void case_675() +#line 4711 "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_671() -#line 4681 "cs-parser.jay" +void case_677() +#line 4720 "cs-parser.jay" { valid_param_mod = 0; start_anonymous (true, (ParametersCompiled) yyVals[-2+yyTop], true, GetLocation (yyVals[-5+yyTop])); } -void case_672() -#line 4686 "cs-parser.jay" +void case_678() +#line 4725 "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_679() -#line 4709 "cs-parser.jay" +void case_685() +#line 4748 "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_680() -#line 4714 "cs-parser.jay" +void case_686() +#line 4753 "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_681() -#line 4719 "cs-parser.jay" +void case_687() +#line 4758 "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_685() -#line 4747 "cs-parser.jay" +void case_692() +#line 4785 "cs-parser.jay" +{ + yyVal = yyVals[-1+yyTop]; + + /* Cannot use opt_formal_parameter_list because it can be shared instance for empty parameters*/ + lbag.AppendToMember (current_container, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); + } + +void case_697() +#line 4811 "cs-parser.jay" +{ + lbag.AppendToMember (current_container, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); + ((Class)current_type).PrimaryConstructorBaseArguments = (Arguments) yyVals[-1+yyTop]; + --lexer.parsing_block; + + yyVal = yyVals[-5+yyTop]; + } + +void case_699() +#line 4831 "cs-parser.jay" { lexer.ConstraintsParsing = true; @@ -8005,13 +8149,18 @@ void case_685() push_current_container (c, yyVals[-3+yyTop]); lbag.AddMember (current_container, GetModifierLocations (), GetLocation (yyVals[-2+yyTop])); + valid_param_mod = ParameterModifierType.PrimaryConstructor; } -void case_686() -#line 4760 "cs-parser.jay" +void case_700() +#line 4845 "cs-parser.jay" { + valid_param_mod = 0; lexer.ConstraintsParsing = false; + if (yyVals[-1+yyTop] != null) + current_type.PrimaryConstructorParameters = (ParametersCompiled) yyVals[-1+yyTop]; + if (yyVals[0+yyTop] != null) current_container.SetConstraints ((List) yyVals[0+yyTop]); @@ -8023,16 +8172,16 @@ void case_686() lexer.parsing_modifiers = true; } -void case_687() -#line 4774 "cs-parser.jay" +void case_701() +#line 4863 "cs-parser.jay" { --lexer.parsing_declaration; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } -void case_688() -#line 4780 "cs-parser.jay" +void case_702() +#line 4869 "cs-parser.jay" { if (yyVals[0+yyTop] == null) { lbag.AppendToMember (current_container, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); @@ -8042,16 +8191,16 @@ void case_688() yyVal = pop_current_class (); } -void case_691() -#line 4799 "cs-parser.jay" +void case_705() +#line 4888 "cs-parser.jay" { mod_locations = null; yyVal = ModifierNone; lexer.parsing_modifiers = false; } -void case_694() -#line 4813 "cs-parser.jay" +void case_708() +#line 4902 "cs-parser.jay" { var m1 = (Modifiers) yyVals[-1+yyTop]; var m2 = (Modifiers) yyVals[0+yyTop]; @@ -8068,8 +8217,8 @@ void case_694() yyVal = m1 | m2; } -void case_695() -#line 4832 "cs-parser.jay" +void case_709() +#line 4921 "cs-parser.jay" { yyVal = Modifiers.NEW; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); @@ -8078,92 +8227,92 @@ void case_695() report.Error (1530, GetLocation (yyVals[0+yyTop]), "Keyword `new' is not allowed on namespace elements"); } -void case_696() -#line 4840 "cs-parser.jay" +void case_710() +#line 4929 "cs-parser.jay" { yyVal = Modifiers.PUBLIC; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_697() -#line 4845 "cs-parser.jay" +void case_711() +#line 4934 "cs-parser.jay" { yyVal = Modifiers.PROTECTED; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_698() -#line 4850 "cs-parser.jay" +void case_712() +#line 4939 "cs-parser.jay" { yyVal = Modifiers.INTERNAL; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_699() -#line 4855 "cs-parser.jay" +void case_713() +#line 4944 "cs-parser.jay" { yyVal = Modifiers.PRIVATE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_700() -#line 4860 "cs-parser.jay" +void case_714() +#line 4949 "cs-parser.jay" { yyVal = Modifiers.ABSTRACT; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_701() -#line 4865 "cs-parser.jay" +void case_715() +#line 4954 "cs-parser.jay" { yyVal = Modifiers.SEALED; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_702() -#line 4870 "cs-parser.jay" +void case_716() +#line 4959 "cs-parser.jay" { yyVal = Modifiers.STATIC; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_703() -#line 4875 "cs-parser.jay" +void case_717() +#line 4964 "cs-parser.jay" { yyVal = Modifiers.READONLY; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_704() -#line 4880 "cs-parser.jay" +void case_718() +#line 4969 "cs-parser.jay" { yyVal = Modifiers.VIRTUAL; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_705() -#line 4885 "cs-parser.jay" +void case_719() +#line 4974 "cs-parser.jay" { yyVal = Modifiers.OVERRIDE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_706() -#line 4890 "cs-parser.jay" +void case_720() +#line 4979 "cs-parser.jay" { yyVal = Modifiers.EXTERN; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_707() -#line 4895 "cs-parser.jay" +void case_721() +#line 4984 "cs-parser.jay" { yyVal = Modifiers.VOLATILE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_708() -#line 4900 "cs-parser.jay" +void case_722() +#line 4989 "cs-parser.jay" { yyVal = Modifiers.UNSAFE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); @@ -8171,38 +8320,38 @@ void case_708() Error_UnsafeCodeNotAllowed (GetLocation (yyVals[0+yyTop])); } -void case_709() -#line 4907 "cs-parser.jay" +void case_723() +#line 4996 "cs-parser.jay" { yyVal = Modifiers.ASYNC; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_711() -#line 4916 "cs-parser.jay" +void case_726() +#line 5009 "cs-parser.jay" { current_type.SetBaseTypes ((List) yyVals[0+yyTop]); lbag.AppendToMember (current_type, GetLocation (yyVals[-1+yyTop])); } -void case_712() -#line 4921 "cs-parser.jay" +void case_727() +#line 5014 "cs-parser.jay" { Error_SyntaxError (yyToken); current_type.SetBaseTypes ((List) yyVals[-1+yyTop]); } -void case_715() -#line 4938 "cs-parser.jay" +void case_730() +#line 5031 "cs-parser.jay" { var constraints = new List (1); constraints.Add ((Constraints) yyVals[0+yyTop]); yyVal = constraints; } -void case_716() -#line 4944 "cs-parser.jay" +void case_731() +#line 5037 "cs-parser.jay" { var constraints = (List) yyVals[-1+yyTop]; Constraints new_constraint = (Constraints)yyVals[0+yyTop]; @@ -8219,16 +8368,16 @@ void case_716() yyVal = constraints; } -void case_717() -#line 4963 "cs-parser.jay" +void case_732() +#line 5056 "cs-parser.jay" { var lt = (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_718() -#line 4969 "cs-parser.jay" +void case_733() +#line 5062 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8236,16 +8385,16 @@ void case_718() yyVal = new Constraints (new SimpleMemberName (lt.Value, lt.Location), null, GetLocation (yyVals[-2+yyTop])); } -void case_719() -#line 4979 "cs-parser.jay" +void case_734() +#line 5072 "cs-parser.jay" { var constraints = new List (1); constraints.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = constraints; } -void case_720() -#line 4985 "cs-parser.jay" +void case_735() +#line 5078 "cs-parser.jay" { var constraints = (List) yyVals[-2+yyTop]; var prev = constraints [constraints.Count - 1] as SpecialContraintExpr; @@ -8270,8 +8419,8 @@ void case_720() yyVal = constraints; } -void case_721() -#line 5012 "cs-parser.jay" +void case_736() +#line 5105 "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 ()); @@ -8279,15 +8428,15 @@ void case_721() yyVal = yyVals[0+yyTop]; } -void case_722() -#line 5019 "cs-parser.jay" +void case_737() +#line 5112 "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_726() -#line 5039 "cs-parser.jay" +void case_741() +#line 5132 "cs-parser.jay" { if (lang_version <= LanguageVersion.V_3) FeatureIsNotAvailable (lexer.Location, "generic type variance"); @@ -8295,79 +8444,79 @@ void case_726() yyVal = yyVals[0+yyTop]; } -void case_727() -#line 5049 "cs-parser.jay" +void case_742() +#line 5142 "cs-parser.jay" { yyVal = new VarianceDecl (Variance.Covariant, GetLocation (yyVals[0+yyTop])); savedLocation = GetLocation (yyVals[0+yyTop]); } -void case_728() -#line 5054 "cs-parser.jay" +void case_743() +#line 5147 "cs-parser.jay" { yyVal = new VarianceDecl (Variance.Contravariant, GetLocation (yyVals[0+yyTop])); savedLocation = GetLocation (yyVals[0+yyTop]); } -void case_729() -#line 5075 "cs-parser.jay" +void case_744() +#line 5168 "cs-parser.jay" { ++lexer.parsing_block; start_block (GetLocation (yyVals[0+yyTop])); } -void case_731() -#line 5087 "cs-parser.jay" +void case_746() +#line 5180 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_732() -#line 5092 "cs-parser.jay" +void case_747() +#line 5185 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (lexer.Location); } -void case_733() -#line 5101 "cs-parser.jay" +void case_748() +#line 5194 "cs-parser.jay" { ++lexer.parsing_block; current_block.StartLocation = GetLocation (yyVals[0+yyTop]); } -void case_734() -#line 5106 "cs-parser.jay" +void case_749() +#line 5199 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_735() -#line 5110 "cs-parser.jay" +void case_750() +#line 5203 "cs-parser.jay" { report.Error (1525, GetLocation (yyVals[0+yyTop]), "Unexpected symbol '}', expected '{'"); lexer.putback ('}'); yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_736() -#line 5119 "cs-parser.jay" +void case_751() +#line 5212 "cs-parser.jay" { ++lexer.parsing_block; current_block.StartLocation = GetLocation (yyVals[0+yyTop]); } -void case_737() -#line 5124 "cs-parser.jay" +void case_752() +#line 5217 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_745() -#line 5152 "cs-parser.jay" +void case_760() +#line 5245 "cs-parser.jay" { Error_SyntaxError (yyToken); var lt =(LocatedToken) yyVals[-1+yyTop]; @@ -8376,43 +8525,43 @@ void case_745() yyVal = null; } -void case_746() -#line 5161 "cs-parser.jay" +void case_761() +#line 5254 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } -void case_779() -#line 5225 "cs-parser.jay" +void case_794() +#line 5318 "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_780() -#line 5230 "cs-parser.jay" +void case_795() +#line 5323 "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_781() -#line 5235 "cs-parser.jay" +void case_796() +#line 5328 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop])); } -void case_782() -#line 5243 "cs-parser.jay" +void case_797() +#line 5336 "cs-parser.jay" { /* Uses lexer.Location because semicolon location is not kept in quick mode*/ yyVal = new EmptyStatement (lexer.Location); } -void case_783() -#line 5251 "cs-parser.jay" +void case_798() +#line 5344 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-1+yyTop]; LabeledStatement labeled = new LabeledStatement (lt.Value, current_block, lt.Location); @@ -8421,8 +8570,8 @@ void case_783() current_block.AddStatement (labeled); } -void case_786() -#line 5264 "cs-parser.jay" +void case_801() +#line 5357 "cs-parser.jay" { if (yyVals[-1+yyTop] is VarExpr) yyVals[-1+yyTop] = new SimpleName ("var", ((VarExpr) yyVals[-1+yyTop]).Location); @@ -8430,8 +8579,8 @@ void case_786() yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } -void case_787() -#line 5280 "cs-parser.jay" +void case_802() +#line 5373 "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*/ @@ -8462,8 +8611,8 @@ void case_787() } } -void case_788() -#line 5310 "cs-parser.jay" +void case_803() +#line 5403 "cs-parser.jay" { ATypeNameExpression expr = yyVals[-1+yyTop] as ATypeNameExpression; @@ -8475,8 +8624,8 @@ void case_788() } } -void case_789() -#line 5321 "cs-parser.jay" +void case_804() +#line 5414 "cs-parser.jay" { if (yyVals[0+yyTop] == null) yyVal = yyVals[-1+yyTop]; @@ -8484,22 +8633,22 @@ void case_789() yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } -void case_792() -#line 5336 "cs-parser.jay" +void case_807() +#line 5429 "cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } -void case_794() -#line 5345 "cs-parser.jay" +void case_809() +#line 5438 "cs-parser.jay" { ((ComposedTypeSpecifier) yyVals[-1+yyTop]).Next = (ComposedTypeSpecifier) yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } -void case_798() -#line 5368 "cs-parser.jay" +void case_813() +#line 5461 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, lt.Location); @@ -8507,8 +8656,8 @@ void case_798() current_variable = new BlockVariable ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_799() -#line 5375 "cs-parser.jay" +void case_814() +#line 5468 "cs-parser.jay" { yyVal = current_variable; current_variable = null; @@ -8518,8 +8667,8 @@ void case_799() lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_800() -#line 5384 "cs-parser.jay" +void case_815() +#line 5477 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location); @@ -8527,8 +8676,8 @@ void case_800() current_variable = new BlockConstant ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_801() -#line 5391 "cs-parser.jay" +void case_816() +#line 5484 "cs-parser.jay" { if (current_variable.Initializer != null) { lbag.AddLocation (current_variable, GetLocation (yyVals[-6+yyTop]), savedLocation, GetLocation (yyVals[0+yyTop])); @@ -8539,8 +8688,8 @@ void case_801() current_variable = null; } -void case_803() -#line 5404 "cs-parser.jay" +void case_818() +#line 5497 "cs-parser.jay" { /* Redundant, but wont regress*/ report.Error (1525, lexer.Location, "Unexpected symbol }"); @@ -8548,16 +8697,16 @@ void case_803() yyVal = yyVals[0+yyTop]; } -void case_805() -#line 5415 "cs-parser.jay" +void case_820() +#line 5508 "cs-parser.jay" { current_variable.Initializer = (Expression) yyVals[0+yyTop]; PushLocation (GetLocation (yyVals[-1+yyTop])); yyVal = current_variable; } -void case_806() -#line 5421 "cs-parser.jay" +void case_821() +#line 5514 "cs-parser.jay" { if (yyToken == Token.OPEN_BRACKET_EXPR) { report.Error (650, lexer.Location, @@ -8567,8 +8716,8 @@ void case_806() } } -void case_810() -#line 5439 "cs-parser.jay" +void case_825() +#line 5532 "cs-parser.jay" { foreach (var d in current_variable.Declarators) { if (d.Initializer == null) @@ -8576,8 +8725,8 @@ void case_810() } } -void case_813() -#line 5454 "cs-parser.jay" +void case_828() +#line 5547 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location); @@ -8587,8 +8736,8 @@ void case_813() lbag.AddLocation (d, GetLocation (yyVals[-1+yyTop])); } -void case_814() -#line 5463 "cs-parser.jay" +void case_829() +#line 5556 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-2+yyTop]; var li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location); @@ -8598,15 +8747,15 @@ void case_814() lbag.AddLocation (d, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_816() -#line 5479 "cs-parser.jay" +void case_831() +#line 5572 "cs-parser.jay" { savedLocation = GetLocation (yyVals[-1+yyTop]); current_variable.Initializer = (Expression) yyVals[0+yyTop]; } -void case_821() -#line 5497 "cs-parser.jay" +void case_836() +#line 5590 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-2+yyTop]; var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location); @@ -8616,37 +8765,37 @@ void case_821() lbag.AddLocation (d, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_823() -#line 5510 "cs-parser.jay" +void case_838() +#line 5603 "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_824() -#line 5515 "cs-parser.jay" +void case_839() +#line 5608 "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_825() -#line 5523 "cs-parser.jay" +void case_840() +#line 5616 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_827() -#line 5529 "cs-parser.jay" +void case_842() +#line 5622 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; report.Error (1002, GetLocation (yyVals[0+yyTop]), "; expected"); lexer.putback ('}'); } -void case_830() -#line 5547 "cs-parser.jay" +void case_845() +#line 5640 "cs-parser.jay" { ExpressionStatement s = yyVals[0+yyTop] as ExpressionStatement; if (s == null) { @@ -8657,22 +8806,22 @@ void case_830() } } -void case_831() -#line 5560 "cs-parser.jay" +void case_846() +#line 5653 "cs-parser.jay" { Expression expr = (Expression) yyVals[0+yyTop]; yyVal = new StatementExpression (new OptionalAssign (expr, lexer.Location)); } -void case_832() -#line 5565 "cs-parser.jay" +void case_847() +#line 5658 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop])); } -void case_835() -#line 5579 "cs-parser.jay" +void case_850() +#line 5672 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8681,8 +8830,8 @@ void case_835() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_836() -#line 5588 "cs-parser.jay" +void case_851() +#line 5681 "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])); @@ -8693,8 +8842,8 @@ void case_836() Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); } -void case_837() -#line 5598 "cs-parser.jay" +void case_852() +#line 5691 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8702,16 +8851,16 @@ void case_837() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_839() -#line 5612 "cs-parser.jay" +void case_854() +#line 5705 "cs-parser.jay" { yyVal = new Switch ((Expression) yyVals[-5+yyTop], (ExplicitBlock) current_block.Explicit, 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_840() -#line 5618 "cs-parser.jay" +void case_855() +#line 5711 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8719,30 +8868,30 @@ void case_840() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_847() -#line 5649 "cs-parser.jay" +void case_862() +#line 5742 "cs-parser.jay" { var label = (SwitchLabel) yyVals[0+yyTop]; label.SectionStart = true; current_block.AddStatement (label); } -void case_849() -#line 5662 "cs-parser.jay" +void case_864() +#line 5755 "cs-parser.jay" { yyVal = new SwitchLabel ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_850() -#line 5667 "cs-parser.jay" +void case_865() +#line 5760 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new SwitchLabel ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_856() -#line 5686 "cs-parser.jay" +void case_871() +#line 5779 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8751,8 +8900,8 @@ void case_856() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_857() -#line 5694 "cs-parser.jay" +void case_872() +#line 5787 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8760,22 +8909,22 @@ void case_857() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_858() -#line 5704 "cs-parser.jay" +void case_873() +#line 5797 "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_859() -#line 5709 "cs-parser.jay" +void case_874() +#line 5802 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Do ((Statement) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop]), Location.Null); } -void case_860() -#line 5714 "cs-parser.jay" +void case_875() +#line 5807 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8783,8 +8932,8 @@ void case_860() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_861() -#line 5724 "cs-parser.jay" +void case_876() +#line 5817 "cs-parser.jay" { start_block (GetLocation (yyVals[0+yyTop])); current_block.IsCompilerGenerated = true; @@ -8794,8 +8943,8 @@ void case_861() yyVal = f; } -void case_863() -#line 5741 "cs-parser.jay" +void case_878() +#line 5834 "cs-parser.jay" { For f = (For) yyVals[-2+yyTop]; f.Initializer = (Statement) yyVals[-1+yyTop]; @@ -8803,8 +8952,8 @@ void case_863() yyVal = f; } -void case_865() -#line 5751 "cs-parser.jay" +void case_880() +#line 5844 "cs-parser.jay" { report.Error (1525, GetLocation (yyVals[0+yyTop]), "Unexpected symbol ')', expected ';'"); For f = (For) yyVals[-2+yyTop]; @@ -8813,8 +8962,8 @@ void case_865() yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_866() -#line 5762 "cs-parser.jay" +void case_881() +#line 5855 "cs-parser.jay" { For f = (For) yyVals[-2+yyTop]; f.Condition = (BooleanExpression) yyVals[-1+yyTop]; @@ -8822,8 +8971,8 @@ void case_866() yyVal = f; } -void case_868() -#line 5773 "cs-parser.jay" +void case_883() +#line 5866 "cs-parser.jay" { report.Error (1525, GetLocation (yyVals[0+yyTop]), "Unexpected symbol ')', expected ';'"); For f = (For) yyVals[-2+yyTop]; @@ -8832,8 +8981,8 @@ void case_868() yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_869() -#line 5785 "cs-parser.jay" +void case_884() +#line 5878 "cs-parser.jay" { For f = (For) yyVals[-3+yyTop]; f.Iterator = (Statement) yyVals[-2+yyTop]; @@ -8847,15 +8996,15 @@ void case_869() yyVal = end_block (GetLocation (yyVals[-1+yyTop])); } -void case_870() -#line 5798 "cs-parser.jay" +void case_885() +#line 5891 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = end_block (current_block.StartLocation); } -void case_873() -#line 5811 "cs-parser.jay" +void case_888() +#line 5904 "cs-parser.jay" { var lt = (LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, lt.Location); @@ -8863,8 +9012,8 @@ void case_873() current_variable = new BlockVariable ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_874() -#line 5818 "cs-parser.jay" +void case_889() +#line 5911 "cs-parser.jay" { yyVal = current_variable; if (yyVals[-1+yyTop] != null) @@ -8873,8 +9022,8 @@ void case_874() current_variable = null; } -void case_882() -#line 5845 "cs-parser.jay" +void case_897() +#line 5938 "cs-parser.jay" { var sl = yyVals[-2+yyTop] as StatementList; if (sl == null) { @@ -8889,8 +9038,8 @@ void case_882() yyVal = sl; } -void case_883() -#line 5862 "cs-parser.jay" +void case_898() +#line 5955 "cs-parser.jay" { report.Error (230, GetLocation (yyVals[-3+yyTop]), "Type and identifier are both required in a foreach statement"); @@ -8904,8 +9053,8 @@ void case_883() yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_884() -#line 5875 "cs-parser.jay" +void case_899() +#line 5968 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -8923,8 +9072,8 @@ void case_884() yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_885() -#line 5892 "cs-parser.jay" +void case_900() +#line 5985 "cs-parser.jay" { start_block (GetLocation (yyVals[-5+yyTop])); current_block.IsCompilerGenerated = true; @@ -8935,8 +9084,8 @@ void case_885() yyVal = li; } -void case_886() -#line 5902 "cs-parser.jay" +void case_901() +#line 5995 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8948,8 +9097,8 @@ void case_886() yyVal = f; } -void case_887() -#line 5913 "cs-parser.jay" +void case_902() +#line 6006 "cs-parser.jay" { start_block (GetLocation (yyVals[-3+yyTop])); current_block.IsCompilerGenerated = true; @@ -8963,8 +9112,8 @@ void case_887() yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_888() -#line 5926 "cs-parser.jay" +void case_903() +#line 6019 "cs-parser.jay" { Foreach f = new Foreach ((Expression) yyVals[-1+yyTop], null, null, null, null, GetLocation (yyVals[-3+yyTop])); current_block.AddStatement (f); @@ -8973,93 +9122,93 @@ void case_888() yyVal = f; } -void case_895() -#line 5946 "cs-parser.jay" +void case_910() +#line 6039 "cs-parser.jay" { yyVal = new Break (GetLocation (yyVals[-1+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_896() -#line 5954 "cs-parser.jay" +void case_911() +#line 6047 "cs-parser.jay" { yyVal = new Continue (GetLocation (yyVals[-1+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_897() -#line 5959 "cs-parser.jay" +void case_912() +#line 6052 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Continue (GetLocation (yyVals[-1+yyTop])); } -void case_898() -#line 5967 "cs-parser.jay" +void case_913() +#line 6060 "cs-parser.jay" { var lt = (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_899() -#line 5973 "cs-parser.jay" +void case_914() +#line 6066 "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_900() -#line 5978 "cs-parser.jay" +void case_915() +#line 6071 "cs-parser.jay" { yyVal = new GotoDefault (GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_901() -#line 5986 "cs-parser.jay" +void case_916() +#line 6079 "cs-parser.jay" { yyVal = new Return ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_902() -#line 5991 "cs-parser.jay" +void case_917() +#line 6084 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Return ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_903() -#line 5996 "cs-parser.jay" +void case_918() +#line 6089 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Return (null, GetLocation (yyVals[-1+yyTop])); } -void case_904() -#line 6004 "cs-parser.jay" +void case_919() +#line 6097 "cs-parser.jay" { yyVal = new Throw ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_905() -#line 6009 "cs-parser.jay" +void case_920() +#line 6102 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Throw ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_906() -#line 6014 "cs-parser.jay" +void case_921() +#line 6107 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new Throw (null, GetLocation (yyVals[-1+yyTop])); } -void case_907() -#line 6022 "cs-parser.jay" +void case_922() +#line 6115 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-3+yyTop]; string s = lt.Value; @@ -9076,8 +9225,8 @@ void case_907() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_908() -#line 6038 "cs-parser.jay" +void case_923() +#line 6131 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -9096,8 +9245,8 @@ void case_908() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_909() -#line 6056 "cs-parser.jay" +void case_924() +#line 6149 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-2+yyTop]; string s = lt.Value; @@ -9112,29 +9261,29 @@ void case_909() lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_913() -#line 6082 "cs-parser.jay" +void case_928() +#line 6175 "cs-parser.jay" { yyVal = new TryFinally ((Statement) yyVals[-2+yyTop], (ExplicitBlock) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_914() -#line 6087 "cs-parser.jay" +void case_929() +#line 6180 "cs-parser.jay" { yyVal = new TryFinally (new TryCatch ((Block) yyVals[-3+yyTop], (List) yyVals[-2+yyTop], GetLocation (yyVals[-4+yyTop]), true), (ExplicitBlock) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_915() -#line 6092 "cs-parser.jay" +void case_930() +#line 6185 "cs-parser.jay" { Error_SyntaxError (1524, yyToken); yyVal = new TryCatch ((Block) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop]), false); } -void case_916() -#line 6100 "cs-parser.jay" +void case_931() +#line 6193 "cs-parser.jay" { var l = new List (2); @@ -9142,13 +9291,14 @@ void case_916() yyVal = l; } -void case_917() -#line 6107 "cs-parser.jay" +void case_932() +#line 6200 "cs-parser.jay" { var l = (List) yyVals[-1+yyTop]; Catch c = (Catch) yyVals[0+yyTop]; - if (l [l.Count - 1].IsGeneral) { + var prev_catch = l [l.Count - 1]; + if (prev_catch.IsGeneral && prev_catch.Filter == null) { report.Error (1017, c.loc, "Try statement already has an empty catch block"); } @@ -9156,8 +9306,16 @@ void case_917() yyVal = l; } -void case_921() -#line 6131 "cs-parser.jay" +void case_935() +#line 6221 "cs-parser.jay" +{ + var c = new Catch ((ExplicitBlock) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); + c.Filter = (CatchFilterExpression) yyVals[-1+yyTop]; + yyVal = c; + } + +void case_936() +#line 6227 "cs-parser.jay" { start_block (GetLocation (yyVals[-3+yyTop])); var c = new Catch ((ExplicitBlock) current_block, GetLocation (yyVals[-4+yyTop])); @@ -9173,8 +9331,15 @@ void case_921() yyVal = c; } -void case_923() -#line 6150 "cs-parser.jay" +void case_937() +#line 6242 "cs-parser.jay" +{ + ((Catch) yyVals[-2+yyTop]).Filter = (CatchFilterExpression) yyVals[-1+yyTop]; + yyVal = yyVals[-2+yyTop]; + } + +void case_938() +#line 6247 "cs-parser.jay" { if (yyToken == Token.CLOSE_PARENS) { report.Error (1015, lexer.Location, @@ -9186,8 +9351,8 @@ void case_923() yyVal = new Catch (null, GetLocation (yyVals[-2+yyTop])); } -void case_924() -#line 6161 "cs-parser.jay" +void case_939() +#line 6258 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -9211,15 +9376,25 @@ void case_924() yyVal = c; } -void case_927() -#line 6201 "cs-parser.jay" +void case_941() +#line 6285 "cs-parser.jay" +{ + if (lang_version <= LanguageVersion.V_5) + FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "exception filter"); + + yyVal = new CatchFilterExpression ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); + lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); + } + +void case_944() +#line 6310 "cs-parser.jay" { if (!settings.Unsafe) Error_UnsafeCodeNotAllowed (GetLocation (yyVals[0+yyTop])); } -void case_929() -#line 6211 "cs-parser.jay" +void case_946() +#line 6320 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -9228,8 +9403,8 @@ void case_929() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_930() -#line 6219 "cs-parser.jay" +void case_947() +#line 6328 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -9237,8 +9412,8 @@ void case_930() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_931() -#line 6229 "cs-parser.jay" +void case_948() +#line 6338 "cs-parser.jay" { start_block (GetLocation (yyVals[-2+yyTop])); @@ -9249,15 +9424,15 @@ void case_931() current_variable = new Fixed.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_932() -#line 6239 "cs-parser.jay" +void case_949() +#line 6348 "cs-parser.jay" { yyVal = current_variable; current_variable = null; } -void case_933() -#line 6244 "cs-parser.jay" +void case_950() +#line 6353 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -9268,8 +9443,8 @@ void case_933() yyVal = end_block (GetLocation (yyVals[-2+yyTop])); } -void case_934() -#line 6257 "cs-parser.jay" +void case_951() +#line 6366 "cs-parser.jay" { start_block (GetLocation (yyVals[-2+yyTop])); @@ -9280,15 +9455,15 @@ void case_934() current_variable = new Using.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_935() -#line 6267 "cs-parser.jay" +void case_952() +#line 6376 "cs-parser.jay" { yyVal = current_variable; current_variable = null; } -void case_936() -#line 6272 "cs-parser.jay" +void case_953() +#line 6381 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -9299,8 +9474,8 @@ void case_936() yyVal = end_block (GetLocation (yyVals[-2+yyTop])); } -void case_937() -#line 6282 "cs-parser.jay" +void case_954() +#line 6391 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -9309,8 +9484,8 @@ void case_937() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_938() -#line 6290 "cs-parser.jay" +void case_955() +#line 6399 "cs-parser.jay" { Error_SyntaxError (yyToken); @@ -9318,23 +9493,23 @@ void case_938() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_940() -#line 6301 "cs-parser.jay" +void case_957() +#line 6410 "cs-parser.jay" { /* It has to be here for the parent to safely restore artificial block*/ Error_SyntaxError (yyToken); } -void case_942() -#line 6313 "cs-parser.jay" +void case_959() +#line 6422 "cs-parser.jay" { current_variable.Initializer = (Expression) yyVals[0+yyTop]; lbag.AddLocation (current_variable, GetLocation (yyVals[-1+yyTop])); yyVal = current_variable; } -void case_943() -#line 6325 "cs-parser.jay" +void case_960() +#line 6434 "cs-parser.jay" { lexer.query_parsing = false; @@ -9347,8 +9522,8 @@ void case_943() current_block = current_block.Parent; } -void case_944() -#line 6337 "cs-parser.jay" +void case_961() +#line 6446 "cs-parser.jay" { Linq.AQueryClause from = yyVals[-1+yyTop] as Linq.AQueryClause; @@ -9359,8 +9534,8 @@ void case_944() current_block = current_block.Parent; } -void case_945() -#line 6348 "cs-parser.jay" +void case_962() +#line 6457 "cs-parser.jay" { lexer.query_parsing = false; yyVal = yyVals[-1+yyTop]; @@ -9369,16 +9544,16 @@ void case_945() current_block = current_block.Parent; } -void case_946() -#line 6355 "cs-parser.jay" +void case_963() +#line 6464 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } -void case_947() -#line 6364 "cs-parser.jay" +void case_964() +#line 6473 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); @@ -9389,8 +9564,8 @@ void case_947() yyVal = new Linq.QueryExpression (clause); } -void case_948() -#line 6374 "cs-parser.jay" +void case_965() +#line 6483 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); @@ -9403,8 +9578,8 @@ void case_948() yyVal = new Linq.QueryExpression (clause); } -void case_949() -#line 6389 "cs-parser.jay" +void case_966() +#line 6498 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); @@ -9415,8 +9590,8 @@ void case_949() yyVal = new Linq.QueryExpression (clause); } -void case_950() -#line 6399 "cs-parser.jay" +void case_967() +#line 6508 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); @@ -9429,8 +9604,8 @@ void case_950() yyVal = new Linq.QueryExpression (clause); } -void case_952() -#line 6418 "cs-parser.jay" +void case_969() +#line 6527 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); @@ -9442,8 +9617,8 @@ void case_952() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_954() -#line 6433 "cs-parser.jay" +void case_971() +#line 6542 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); @@ -9460,8 +9635,8 @@ void case_954() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_955() -#line 6452 "cs-parser.jay" +void case_972() +#line 6561 "cs-parser.jay" { Linq.AQueryClause head = (Linq.AQueryClause)yyVals[-1+yyTop]; @@ -9477,8 +9652,8 @@ void case_955() yyVal = head; } -void case_956() -#line 6467 "cs-parser.jay" +void case_973() +#line 6576 "cs-parser.jay" { Linq.AQueryClause head = (Linq.AQueryClause)yyVals[0+yyTop]; @@ -9491,22 +9666,22 @@ void case_956() yyVal = head; } -void case_958() -#line 6480 "cs-parser.jay" +void case_975() +#line 6589 "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_959() -#line 6485 "cs-parser.jay" +void case_976() +#line 6594 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } -void case_961() -#line 6497 "cs-parser.jay" +void case_978() +#line 6606 "cs-parser.jay" { yyVal = new Linq.Select ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); @@ -9514,8 +9689,8 @@ void case_961() current_block = current_block.Parent; } -void case_962() -#line 6504 "cs-parser.jay" +void case_979() +#line 6613 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack (); @@ -9524,8 +9699,8 @@ void case_962() linq_clause_blocks.Push ((Linq.QueryBlock)current_block); } -void case_963() -#line 6512 "cs-parser.jay" +void case_980() +#line 6621 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -9533,8 +9708,8 @@ void case_963() current_block = new Linq.QueryBlock (current_block, lexer.Location); } -void case_964() -#line 6519 "cs-parser.jay" +void case_981() +#line 6628 "cs-parser.jay" { var obj = (object[]) yyVals[0+yyTop]; @@ -9545,22 +9720,22 @@ void case_964() current_block = current_block.Parent; } -void case_966() -#line 6536 "cs-parser.jay" +void case_983() +#line 6645 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new object[2] { null, Location.Null }; } -void case_968() -#line 6545 "cs-parser.jay" +void case_985() +#line 6654 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-1+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } -void case_975() -#line 6565 "cs-parser.jay" +void case_992() +#line 6674 "cs-parser.jay" { var lt = (LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); @@ -9573,8 +9748,8 @@ void case_975() ((Linq.QueryBlock)current_block).AddRangeVariable (sn); } -void case_977() -#line 6584 "cs-parser.jay" +void case_994() +#line 6693 "cs-parser.jay" { yyVal = new Linq.Where ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); @@ -9582,8 +9757,8 @@ void case_977() current_block = current_block.Parent; } -void case_978() -#line 6594 "cs-parser.jay" +void case_995() +#line 6703 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack (); @@ -9592,8 +9767,8 @@ void case_978() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_979() -#line 6602 "cs-parser.jay" +void case_996() +#line 6711 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -9602,8 +9777,8 @@ void case_979() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_980() -#line 6610 "cs-parser.jay" +void case_997() +#line 6719 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -9612,8 +9787,8 @@ void case_980() current_block = new Linq.QueryBlock (current_block, lexer.Location); } -void case_981() -#line 6618 "cs-parser.jay" +void case_998() +#line 6727 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -9652,8 +9827,8 @@ void case_981() ((Linq.QueryBlock)current_block).AddRangeVariable (into); } -void case_982() -#line 6656 "cs-parser.jay" +void case_999() +#line 6765 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack (); @@ -9662,8 +9837,8 @@ void case_982() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_983() -#line 6664 "cs-parser.jay" +void case_1000() +#line 6773 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -9672,8 +9847,8 @@ void case_983() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_984() -#line 6672 "cs-parser.jay" +void case_1001() +#line 6781 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -9682,8 +9857,8 @@ void case_984() current_block = new Linq.QueryBlock (current_block, lexer.Location); } -void case_985() -#line 6680 "cs-parser.jay" +void case_1002() +#line 6789 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -9726,22 +9901,22 @@ void case_985() ((Linq.QueryBlock)current_block).AddRangeVariable (into); } -void case_987() -#line 6726 "cs-parser.jay" +void case_1004() +#line 6835 "cs-parser.jay" { opt_intoStack.Push (GetLocation (yyVals[-1+yyTop])); yyVal = yyVals[0+yyTop]; } -void case_988() -#line 6734 "cs-parser.jay" +void case_1005() +#line 6843 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); lbag.AddLocation (current_block, GetLocation (yyVals[0+yyTop])); } -void case_989() -#line 6739 "cs-parser.jay" +void case_1006() +#line 6848 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -9749,8 +9924,8 @@ void case_989() yyVal = yyVals[0+yyTop]; } -void case_991() -#line 6750 "cs-parser.jay" +void case_1008() +#line 6859 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -9758,15 +9933,15 @@ void case_991() current_block = new Linq.QueryBlock (current_block, lexer.Location); } -void case_992() -#line 6757 "cs-parser.jay" +void case_1009() +#line 6866 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-3+yyTop]).Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-3+yyTop]; } -void case_994() -#line 6766 "cs-parser.jay" +void case_1011() +#line 6875 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -9774,43 +9949,43 @@ void case_994() current_block = new Linq.QueryBlock ((Linq.QueryBlock) current_block, lexer.Location); } -void case_995() -#line 6773 "cs-parser.jay" +void case_1012() +#line 6882 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-3+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-3+yyTop]; } -void case_997() -#line 6785 "cs-parser.jay" +void case_1014() +#line 6894 "cs-parser.jay" { yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_998() -#line 6790 "cs-parser.jay" +void case_1015() +#line 6899 "cs-parser.jay" { yyVal = new Linq.OrderByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_1000() -#line 6802 "cs-parser.jay" +void case_1017() +#line 6911 "cs-parser.jay" { yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_1001() -#line 6807 "cs-parser.jay" +void case_1018() +#line 6916 "cs-parser.jay" { yyVal = new Linq.ThenByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_1003() -#line 6817 "cs-parser.jay" +void case_1020() +#line 6926 "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*/ @@ -9827,8 +10002,8 @@ void case_1003() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_1004() -#line 6833 "cs-parser.jay" +void case_1021() +#line 6942 "cs-parser.jay" { var current_block = linq_clause_blocks.Pop (); var lt = (LocatedToken) yyVals[-2+yyTop]; @@ -9838,8 +10013,8 @@ void case_1004() }; } -void case_1007() -#line 6860 "cs-parser.jay" +void case_1024() +#line 6969 "cs-parser.jay" { current_container = current_type = new Class (current_container, new MemberName (""), Modifiers.PUBLIC, null); @@ -9868,8 +10043,8 @@ void case_1007() start_block (lexer.Location); } -void case_1008() -#line 6888 "cs-parser.jay" +void case_1025() +#line 6997 "cs-parser.jay" { --lexer.parsing_block; var method = (InteractiveMethod) oob_stack.Pop (); @@ -9883,16 +10058,24 @@ void case_1008() current_local_parameters = null; } -void case_1018() -#line 6934 "cs-parser.jay" +void case_1035() +#line 7043 "cs-parser.jay" { module.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)yyVals[-1+yyTop]; module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; yyVal = null; } -void case_1019() -#line 6940 "cs-parser.jay" +void case_1036() +#line 7049 "cs-parser.jay" +{ + module.DocumentationBuilder.ParsedBuiltinType = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])); + module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; + yyVal = null; + } + +void case_1037() +#line 7055 "cs-parser.jay" { module.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)yyVals[-3+yyTop]; module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; @@ -9900,15 +10083,15 @@ void case_1019() yyVal = new MemberName (lt.Value); } -void case_1022() -#line 6955 "cs-parser.jay" +void case_1040() +#line 7070 "cs-parser.jay" { module.DocumentationBuilder.ParsedParameters = (List)yyVals[-1+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-6+yyTop], MemberCache.IndexerNameAlias, Location.Null); } -void case_1023() -#line 6960 "cs-parser.jay" +void case_1041() +#line 7075 "cs-parser.jay" { var p = (List)yyVals[0+yyTop] ?? new List (1); p.Add (new DocumentationParameter ((FullNamedExpression) yyVals[-1+yyTop])); @@ -9917,8 +10100,8 @@ void case_1023() yyVal = null; } -void case_1024() -#line 6968 "cs-parser.jay" +void case_1042() +#line 7083 "cs-parser.jay" { var p = (List)yyVals[0+yyTop] ?? new List (1); p.Add (new DocumentationParameter ((FullNamedExpression) yyVals[-1+yyTop])); @@ -9927,33 +10110,33 @@ void case_1024() yyVal = null; } -void case_1025() -#line 6976 "cs-parser.jay" +void case_1043() +#line 7091 "cs-parser.jay" { - var p = (List)yyVals[0+yyTop] ?? new List (1); + var p = (List)yyVals[0+yyTop]; module.DocumentationBuilder.ParsedParameters = p; module.DocumentationBuilder.ParsedOperator = (Operator.OpType) yyVals[-1+yyTop]; yyVal = null; } -void case_1033() -#line 7014 "cs-parser.jay" +void case_1051() +#line 7129 "cs-parser.jay" { var parameters = new List (); parameters.Add ((DocumentationParameter) yyVals[0+yyTop]); yyVal = parameters; } -void case_1034() -#line 7020 "cs-parser.jay" +void case_1052() +#line 7135 "cs-parser.jay" { var parameters = yyVals[-2+yyTop] as List; parameters.Add ((DocumentationParameter) yyVals[0+yyTop]); yyVal = parameters; } -void case_1035() -#line 7029 "cs-parser.jay" +void case_1053() +#line 7144 "cs-parser.jay" { if (yyVals[-1+yyTop] != null) yyVal = new DocumentationParameter ((Parameter.Modifier) yyVals[-1+yyTop], (FullNamedExpression) yyVals[0+yyTop]); @@ -9973,100 +10156,102 @@ void case_1035() 40, 42, 42, 42, 42, 42, 43, 43, 43, 47, 44, 46, 49, 49, 49, 51, 51, 52, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 68, 70, 72, 73, 74, 28, 28, 77, - 54, 54, 78, 78, 79, 79, 80, 82, 76, 76, - 81, 81, 87, 55, 91, 55, 55, 86, 94, 86, - 88, 88, 95, 95, 96, 97, 96, 92, 92, 98, - 98, 99, 100, 90, 90, 93, 93, 93, 103, 56, - 106, 107, 101, 108, 109, 110, 101, 101, 101, 102, - 102, 105, 105, 113, 113, 113, 113, 113, 113, 113, - 113, 113, 113, 114, 114, 117, 117, 117, 117, 120, - 117, 118, 118, 121, 121, 122, 122, 122, 115, 115, - 115, 123, 123, 123, 116, 125, 127, 128, 57, 130, - 131, 132, 59, 126, 126, 126, 126, 126, 136, 133, - 137, 134, 135, 135, 135, 138, 139, 140, 142, 29, - 29, 141, 141, 143, 143, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 147, 60, 146, 146, 148, 148, - 151, 145, 145, 150, 150, 150, 150, 150, 150, 150, - 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, - 150, 150, 150, 150, 150, 153, 152, 154, 152, 152, - 152, 61, 157, 159, 155, 156, 156, 158, 158, 163, - 161, 164, 161, 161, 161, 165, 62, 167, 58, 170, - 171, 58, 58, 166, 173, 166, 168, 168, 174, 174, - 175, 176, 175, 177, 172, 169, 169, 169, 169, 169, - 181, 178, 182, 179, 180, 180, 63, 64, 184, 186, - 187, 30, 183, 183, 183, 185, 185, 185, 188, 188, - 189, 190, 189, 189, 189, 191, 192, 193, 31, 194, - 194, 16, 16, 195, 195, 198, 197, 197, 197, 199, - 199, 201, 67, 124, 104, 104, 129, 129, 202, 202, - 202, 200, 200, 203, 203, 204, 204, 206, 206, 85, - 75, 75, 89, 89, 119, 119, 149, 149, 207, 207, - 207, 207, 207, 211, 211, 212, 210, 210, 210, 210, - 210, 210, 210, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 215, 215, 215, 216, 216, 216, 236, 236, - 237, 237, 238, 238, 218, 218, 235, 235, 235, 235, - 235, 235, 235, 235, 220, 220, 220, 240, 240, 241, - 241, 242, 242, 244, 244, 244, 245, 245, 245, 245, - 245, 245, 246, 246, 162, 162, 239, 239, 239, 239, - 239, 251, 251, 250, 250, 252, 252, 252, 252, 253, - 221, 221, 221, 249, 249, 254, 254, 255, 255, 222, - 223, 223, 224, 225, 226, 226, 217, 217, 217, 217, - 217, 260, 256, 227, 261, 261, 262, 262, 263, 263, - 264, 264, 264, 264, 257, 257, 208, 208, 259, 259, - 265, 265, 258, 258, 84, 84, 266, 266, 267, 228, - 268, 268, 268, 269, 269, 269, 269, 269, 270, 196, - 229, 229, 230, 230, 231, 231, 232, 272, 233, 273, - 233, 271, 271, 275, 274, 219, 276, 276, 276, 276, - 276, 276, 276, 276, 276, 277, 277, 277, 277, 277, - 277, 277, 277, 277, 277, 277, 277, 277, 278, 278, - 278, 278, 278, 278, 278, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 280, 280, 280, 280, 280, 281, - 281, 281, 281, 281, 281, 281, 281, 281, 282, 282, - 282, 282, 282, 283, 283, 283, 284, 284, 284, 285, - 285, 285, 286, 286, 286, 287, 287, 287, 288, 288, - 289, 289, 289, 289, 289, 290, 290, 290, 290, 290, - 290, 290, 290, 290, 290, 290, 291, 291, 292, 292, - 292, 292, 293, 293, 295, 294, 294, 294, 50, 50, - 297, 296, 298, 296, 299, 296, 300, 301, 296, 302, - 303, 296, 45, 45, 247, 247, 247, 247, 234, 234, - 234, 83, 305, 306, 307, 308, 309, 27, 66, 66, - 65, 65, 111, 111, 310, 310, 310, 310, 310, 310, - 310, 310, 310, 310, 310, 310, 310, 310, 310, 69, - 69, 69, 71, 71, 311, 311, 312, 312, 313, 313, - 314, 314, 314, 314, 205, 205, 315, 315, 317, 112, - 318, 318, 319, 160, 160, 321, 320, 316, 316, 322, - 322, 323, 323, 323, 323, 323, 327, 327, 328, 328, - 328, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 329, 329, 329, 329, 329, 329, - 329, 329, 329, 329, 329, 329, 329, 343, 343, 343, - 343, 330, 344, 326, 345, 345, 346, 346, 346, 346, - 346, 346, 209, 209, 347, 48, 48, 349, 324, 353, - 324, 351, 351, 348, 348, 348, 350, 350, 357, 357, - 356, 356, 358, 358, 352, 352, 354, 354, 359, 359, - 360, 355, 355, 355, 331, 331, 331, 342, 342, 361, - 362, 362, 332, 332, 363, 363, 363, 366, 364, 364, - 365, 365, 367, 367, 367, 368, 369, 369, 370, 370, - 370, 333, 333, 333, 333, 371, 371, 372, 372, 372, - 376, 373, 379, 375, 375, 382, 378, 378, 381, 381, - 377, 377, 385, 384, 384, 380, 380, 383, 383, 387, - 386, 386, 374, 374, 388, 374, 374, 374, 334, 334, - 334, 334, 334, 334, 389, 390, 390, 391, 391, 391, - 392, 392, 392, 393, 393, 393, 394, 394, 394, 395, - 395, 335, 335, 335, 335, 396, 396, 398, 398, 397, - 399, 397, 397, 397, 336, 337, 400, 340, 338, 338, - 402, 403, 341, 405, 406, 339, 339, 339, 404, 404, - 401, 401, 304, 304, 304, 304, 407, 407, 409, 409, - 411, 410, 412, 410, 408, 408, 408, 408, 408, 416, - 414, 417, 419, 414, 418, 418, 413, 413, 420, 420, - 420, 420, 420, 425, 421, 426, 422, 427, 428, 429, - 423, 431, 432, 433, 423, 430, 430, 435, 424, 434, - 438, 434, 437, 440, 437, 436, 436, 436, 439, 439, - 439, 415, 441, 415, 3, 3, 442, 3, 3, 443, - 443, 248, 248, 243, 243, 5, 444, 444, 444, 444, - 448, 444, 444, 444, 444, 445, 445, 446, 449, 446, - 447, 447, 450, 450, 451, + 53, 53, 68, 70, 73, 74, 75, 28, 28, 78, + 54, 54, 79, 79, 80, 80, 81, 83, 77, 77, + 82, 82, 88, 55, 92, 55, 55, 87, 95, 87, + 89, 89, 96, 96, 97, 98, 97, 93, 93, 99, + 99, 100, 101, 91, 91, 94, 94, 94, 104, 56, + 107, 108, 102, 109, 110, 111, 102, 102, 102, 103, + 103, 106, 106, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 115, 115, 118, 118, 118, 118, 121, + 118, 119, 119, 122, 122, 123, 123, 123, 116, 116, + 116, 124, 124, 124, 117, 126, 128, 129, 57, 131, + 132, 133, 59, 127, 127, 127, 127, 127, 137, 134, + 138, 135, 136, 136, 136, 139, 140, 141, 143, 29, + 29, 142, 142, 144, 144, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 148, 60, 147, 147, 149, 149, + 152, 146, 146, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 154, 153, 155, 153, 153, + 153, 61, 158, 160, 156, 157, 157, 159, 159, 164, + 162, 165, 162, 162, 162, 166, 62, 168, 58, 171, + 172, 58, 58, 167, 174, 167, 169, 169, 175, 175, + 176, 177, 176, 178, 173, 170, 170, 170, 170, 170, + 182, 179, 183, 180, 181, 181, 63, 64, 185, 187, + 188, 30, 184, 184, 184, 186, 186, 186, 189, 189, + 190, 191, 190, 190, 190, 192, 193, 194, 31, 195, + 195, 16, 16, 196, 196, 199, 198, 198, 198, 200, + 200, 202, 67, 125, 105, 105, 130, 130, 203, 203, + 203, 201, 201, 204, 204, 205, 205, 207, 207, 86, + 76, 76, 90, 90, 120, 120, 150, 150, 208, 208, + 208, 208, 208, 212, 212, 213, 211, 211, 211, 211, + 211, 211, 211, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 216, 216, 216, 217, 217, 217, 237, 237, + 238, 238, 239, 239, 219, 219, 236, 236, 236, 236, + 236, 236, 236, 236, 236, 221, 221, 221, 241, 241, + 242, 242, 243, 243, 245, 245, 245, 246, 246, 246, + 246, 246, 246, 247, 247, 163, 163, 240, 240, 240, + 240, 240, 252, 252, 251, 251, 253, 253, 253, 253, + 254, 222, 222, 222, 250, 250, 255, 255, 256, 256, + 223, 224, 224, 225, 226, 227, 227, 218, 218, 218, + 218, 218, 261, 257, 228, 228, 262, 262, 263, 263, + 264, 264, 264, 264, 265, 265, 265, 265, 258, 258, + 209, 209, 260, 260, 266, 266, 259, 259, 85, 85, + 267, 267, 268, 229, 269, 269, 269, 270, 270, 270, + 270, 270, 271, 197, 230, 230, 231, 231, 232, 232, + 233, 273, 234, 274, 234, 272, 272, 276, 275, 220, + 277, 277, 277, 277, 277, 277, 277, 277, 277, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 279, 279, 279, 279, 279, 279, 279, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 281, 281, 281, 281, 281, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 283, 283, 283, 283, 283, 284, + 284, 284, 285, 285, 285, 286, 286, 286, 287, 287, + 287, 288, 288, 288, 289, 289, 290, 290, 290, 290, + 290, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 292, 292, 293, 293, 293, 293, 294, 294, + 296, 295, 295, 295, 50, 50, 298, 297, 299, 297, + 300, 297, 301, 302, 297, 303, 304, 297, 45, 45, + 248, 248, 248, 248, 235, 235, 235, 84, 306, 69, + 69, 307, 308, 308, 308, 310, 308, 311, 312, 313, + 314, 27, 66, 66, 65, 65, 112, 112, 315, 315, + 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, + 315, 315, 315, 71, 71, 309, 309, 72, 72, 316, + 316, 317, 317, 318, 318, 319, 319, 319, 319, 206, + 206, 320, 320, 322, 113, 323, 323, 324, 161, 161, + 326, 325, 321, 321, 327, 327, 328, 328, 328, 328, + 328, 332, 332, 333, 333, 333, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, 330, 334, + 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, + 334, 334, 348, 348, 348, 348, 335, 349, 331, 350, + 350, 351, 351, 351, 351, 351, 351, 210, 210, 352, + 48, 48, 354, 329, 358, 329, 356, 356, 353, 353, + 353, 355, 355, 362, 362, 361, 361, 363, 363, 357, + 357, 359, 359, 364, 364, 365, 360, 360, 360, 336, + 336, 336, 347, 347, 366, 367, 367, 337, 337, 368, + 368, 368, 371, 369, 369, 370, 370, 372, 372, 372, + 373, 374, 374, 375, 375, 375, 338, 338, 338, 338, + 376, 376, 377, 377, 377, 381, 378, 384, 380, 380, + 387, 383, 383, 386, 386, 382, 382, 390, 389, 389, + 385, 385, 388, 388, 392, 391, 391, 379, 379, 393, + 379, 379, 379, 339, 339, 339, 339, 339, 339, 394, + 395, 395, 396, 396, 396, 397, 397, 397, 398, 398, + 398, 399, 399, 399, 400, 400, 340, 340, 340, 340, + 401, 401, 403, 403, 402, 405, 402, 402, 402, 404, + 404, 341, 342, 406, 345, 343, 343, 408, 409, 346, + 411, 412, 344, 344, 344, 410, 410, 407, 407, 305, + 305, 305, 305, 413, 413, 415, 415, 417, 416, 418, + 416, 414, 414, 414, 414, 414, 422, 420, 423, 425, + 420, 424, 424, 419, 419, 426, 426, 426, 426, 426, + 431, 427, 432, 428, 433, 434, 435, 429, 437, 438, + 439, 429, 436, 436, 441, 430, 440, 444, 440, 443, + 446, 443, 442, 442, 442, 445, 445, 445, 421, 447, + 421, 3, 3, 448, 3, 3, 449, 449, 249, 249, + 244, 244, 5, 450, 450, 450, 450, 450, 454, 450, + 450, 450, 450, 451, 451, 452, 455, 452, 453, 453, + 456, 456, 457, }; static readonly short [] yyLen = { 2, 2, 0, 3, 1, 2, 4, 3, 1, 0, 1, @@ -10079,7 +10264,7 @@ void case_1035() 3, 0, 1, 1, 3, 3, 1, 1, 1, 0, 4, 4, 0, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 0, 0, 0, 0, 16, 5, 0, + 1, 1, 0, 0, 0, 0, 0, 17, 5, 0, 9, 5, 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, @@ -10112,214 +10297,219 @@ void case_1035() 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, 3, 0, 1, 3, - 4, 0, 1, 1, 3, 2, 3, 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, 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, 2, 4, 2, 4, 0, 4, 0, - 5, 0, 1, 0, 4, 4, 1, 2, 2, 4, - 2, 2, 2, 4, 2, 1, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, - 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, + 1, 1, 1, 1, 3, 3, 4, 4, 4, 4, + 3, 3, 4, 3, 4, 4, 4, 3, 0, 1, + 3, 4, 0, 1, 1, 3, 2, 3, 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, 1, 3, 1, 1, + 1, 4, 3, 2, 2, 6, 3, 7, 4, 3, + 7, 3, 0, 2, 4, 3, 1, 2, 0, 1, + 1, 3, 1, 2, 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, 2, 4, 2, + 4, 0, 4, 0, 5, 0, 1, 0, 4, 4, + 1, 2, 2, 4, 2, 2, 2, 4, 2, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 1, 3, 3, 3, 3, 3, 3, 1, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 1, 3, 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 1, - 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, - 3, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, - 1, 5, 4, 5, 5, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 1, 3, 3, 2, - 1, 1, 0, 1, 0, 2, 1, 1, 1, 1, - 0, 4, 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, 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, 4, 0, 1, 1, - 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, + 3, 1, 3, 3, 1, 3, 1, 5, 4, 5, + 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 1, 3, 3, 2, 1, 1, 0, 1, + 0, 2, 1, 1, 1, 1, 0, 4, 0, 4, + 0, 5, 0, 0, 7, 0, 0, 8, 1, 1, + 1, 1, 1, 1, 6, 4, 4, 1, 1, 0, + 1, 3, 0, 1, 1, 0, 6, 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, 1, 0, 1, 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, 4, 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, 0, 4, 1, 2, 2, 2, 2, 2, - 2, 1, 1, 2, 1, 1, 1, 0, 6, 0, - 7, 1, 1, 0, 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, 2, 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, 3, 2, 4, 4, 3, 0, - 1, 3, 4, 5, 3, 1, 2, 0, 1, 2, - 0, 7, 3, 6, 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, 5, 2, 1, 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, 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, + 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, + 2, 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, 3, + 2, 4, 4, 3, 0, 1, 3, 4, 5, 3, + 1, 2, 0, 1, 3, 0, 8, 3, 6, 0, + 4, 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, + 5, 2, 1, 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, 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, 1005, 0, 0, 1009, 0, + 0, 0, 11, 14, 0, 1022, 0, 0, 1026, 0, 0, 15, 17, 389, 395, 402, 390, 392, 0, 391, 0, 398, 400, 387, 0, 394, 396, 388, 399, 401, - 397, 352, 1026, 0, 393, 1016, 0, 10, 1, 0, - 0, 0, 12, 0, 832, 0, 0, 0, 0, 0, - 0, 0, 0, 430, 0, 0, 0, 0, 0, 0, - 0, 428, 0, 0, 0, 490, 0, 429, 0, 529, - 0, 927, 0, 0, 0, 678, 0, 0, 0, 0, - 0, 0, 0, 729, 0, 782, 0, 0, 0, 0, - 0, 0, 0, 0, 427, 0, 667, 0, 831, 0, - 765, 0, 0, 0, 0, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 425, 426, 674, 566, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 675, 673, 676, 677, 749, 751, 0, 747, 750, 766, - 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, - 767, 0, 0, 0, 833, 834, 852, 853, 854, 855, - 889, 890, 891, 892, 893, 894, 0, 0, 0, 20, - 0, 0, 342, 0, 344, 1013, 16, 1006, 0, 0, - 249, 248, 245, 250, 251, 244, 263, 262, 255, 256, - 252, 254, 253, 257, 246, 247, 258, 259, 265, 264, - 260, 261, 0, 0, 1029, 0, 1018, 0, 1017, 3, - 55, 0, 0, 0, 44, 41, 43, 46, 47, 48, - 49, 50, 53, 13, 0, 0, 0, 895, 544, 431, - 432, 925, 0, 0, 0, 0, 0, 0, 0, 897, - 896, 0, 554, 548, 553, 781, 830, 752, 779, 778, - 780, 753, 754, 755, 756, 757, 758, 759, 760, 761, - 762, 763, 764, 0, 0, 0, 861, 0, 0, 0, - 797, 796, 0, 0, 0, 0, 0, 0, 0, 0, - 903, 0, 0, 0, 0, 403, 0, 0, 0, 906, - 0, 0, 0, 0, 546, 926, 0, 0, 0, 795, - 791, 0, 0, 0, 0, 0, 0, 0, 371, 0, - 0, 0, 0, 0, 0, 0, 0, 670, 0, 565, - 663, 0, 561, 0, 0, 563, 559, 573, 567, 574, - 568, 562, 558, 578, 572, 577, 571, 575, 569, 576, - 570, 661, 540, 0, 424, 423, 0, 0, 0, 0, - 0, 783, 0, 341, 0, 789, 790, 0, 493, 494, - 0, 0, 0, 787, 788, 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, 1008, 748, - 798, 786, 0, 828, 829, 959, 976, 0, 0, 960, - 962, 0, 988, 945, 943, 969, 0, 0, 967, 970, - 971, 972, 973, 946, 944, 0, 0, 0, 346, 0, - 18, 0, 0, 0, 1025, 0, 353, 0, 0, 0, - 1027, 0, 0, 42, 700, 706, 698, 0, 695, 705, - 699, 697, 696, 703, 701, 702, 708, 704, 707, 709, - 0, 0, 693, 45, 54, 492, 0, 488, 489, 0, - 0, 486, 0, 800, 0, 0, 0, 859, 0, 827, - 825, 826, 0, 0, 0, 682, 0, 900, 898, 683, - 0, 0, 514, 0, 0, 0, 0, 505, 0, 509, - 519, 521, 0, 501, 0, 0, 0, 0, 0, 496, - 0, 499, 0, 503, 373, 902, 901, 0, 0, 905, - 904, 915, 0, 0, 0, 916, 0, 0, 928, 0, - 0, 794, 0, 383, 379, 380, 0, 0, 378, 381, - 382, 0, 0, 0, 579, 0, 0, 550, 0, 665, - 0, 746, 0, 0, 0, 740, 742, 743, 744, 435, - 436, 0, 349, 350, 0, 187, 186, 188, 0, 652, - 0, 0, 0, 375, 0, 647, 0, 0, 909, 0, - 0, 0, 440, 0, 443, 0, 0, 441, 0, 0, - 483, 0, 447, 0, 0, 0, 0, 472, 475, 0, - 0, 467, 474, 473, 636, 637, 638, 639, 640, 641, - 642, 643, 644, 646, 645, 583, 580, 585, 582, 584, - 581, 593, 589, 594, 590, 591, 0, 592, 0, 598, - 0, 599, 0, 605, 0, 606, 0, 607, 0, 608, - 0, 612, 0, 613, 0, 616, 0, 619, 0, 622, - 0, 625, 0, 628, 0, 630, 0, 0, 518, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 958, 957, - 0, 968, 0, 956, 0, 0, 343, 1023, 1024, 367, - 0, 0, 0, 364, 0, 0, 184, 0, 0, 1033, - 1019, 1021, 61, 63, 64, 0, 0, 56, 0, 0, - 65, 67, 30, 28, 0, 0, 0, 690, 0, 694, - 439, 0, 491, 0, 543, 0, 556, 173, 195, 0, - 0, 0, 163, 0, 0, 0, 174, 549, 0, 931, - 0, 881, 862, 0, 872, 0, 883, 0, 899, 837, - 0, 930, 0, 0, 504, 0, 520, 522, 0, 0, - 0, 459, 0, 0, 454, 0, 0, 660, 659, 484, - 0, 524, 498, 0, 0, 148, 525, 146, 147, 527, - 0, 542, 541, 840, 0, 920, 0, 913, 0, 917, - 533, 0, 0, 0, 368, 0, 531, 0, 0, 545, - 938, 0, 934, 857, 0, 949, 0, 947, 0, 0, - 680, 681, 0, 0, 0, 658, 657, 664, 0, 745, - 731, 732, 730, 741, 662, 0, 348, 650, 0, 0, - 0, 564, 560, 908, 907, 784, 444, 438, 442, 437, - 547, 482, 481, 480, 477, 476, 0, 471, 433, 434, - 445, 446, 0, 633, 0, 806, 0, 0, 977, 951, - 0, 978, 0, 961, 963, 974, 0, 989, 0, 955, - 1003, 19, 345, 728, 727, 0, 726, 0, 363, 1035, - 185, 1030, 0, 0, 60, 57, 0, 0, 0, 0, - 0, 0, 370, 0, 684, 0, 0, 85, 84, 0, - 487, 0, 0, 0, 0, 0, 178, 555, 0, 0, - 0, 0, 0, 873, 865, 863, 0, 884, 0, 0, - 929, 511, 510, 0, 462, 0, 0, 1014, 1015, 450, - 456, 0, 460, 0, 0, 0, 0, 0, 0, 838, - 923, 0, 914, 0, 539, 534, 0, 0, 530, 0, - 937, 0, 856, 950, 948, 0, 551, 0, 666, 656, - 351, 649, 648, 668, 479, 0, 470, 469, 468, 634, - 635, 632, 0, 822, 805, 0, 0, 0, 811, 0, - 953, 0, 982, 0, 0, 997, 998, 991, 0, 366, - 365, 1034, 0, 0, 66, 59, 0, 68, 29, 22, - 0, 0, 319, 0, 221, 0, 109, 0, 82, 816, - 121, 122, 0, 0, 0, 819, 193, 194, 0, 0, - 0, 0, 166, 175, 167, 169, 860, 0, 0, 0, - 0, 0, 882, 0, 0, 463, 464, 458, 461, 457, - 451, 455, 0, 516, 0, 485, 495, 449, 528, 526, - 0, 919, 0, 0, 0, 535, 0, 940, 0, 0, - 679, 671, 0, 478, 0, 0, 803, 802, 799, 812, - 952, 0, 0, 0, 966, 0, 964, 975, 0, 1004, - 1022, 0, 79, 0, 0, 73, 74, 77, 78, 0, - 336, 325, 324, 0, 685, 217, 104, 0, 801, 820, - 179, 0, 191, 0, 0, 0, 858, 942, 0, 0, - 0, 0, 864, 0, 885, 836, 500, 497, 845, 0, - 851, 0, 0, 843, 0, 847, 0, 538, 537, 939, - 935, 0, 669, 0, 0, 954, 979, 0, 965, 0, - 0, 993, 0, 80, 71, 0, 0, 0, 320, 0, - 0, 0, 0, 0, 180, 0, 170, 168, 932, 874, - 868, 866, 0, 0, 839, 844, 0, 848, 924, 0, - 0, 672, 0, 814, 0, 983, 1000, 1001, 994, 58, + 397, 0, 352, 1044, 0, 393, 1033, 0, 10, 1, + 0, 0, 0, 12, 0, 847, 0, 0, 0, 0, + 0, 0, 0, 0, 430, 0, 0, 0, 0, 0, + 0, 0, 428, 0, 0, 0, 491, 0, 429, 0, + 533, 0, 944, 0, 0, 0, 684, 0, 0, 0, + 0, 0, 0, 0, 744, 0, 797, 0, 0, 0, + 0, 0, 0, 0, 0, 427, 0, 673, 0, 846, + 0, 780, 0, 0, 0, 0, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 425, 426, 680, 570, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 681, 679, 682, 683, 764, 766, 0, 762, 765, + 781, 783, 784, 785, 786, 787, 788, 789, 790, 791, + 792, 782, 0, 0, 0, 848, 849, 867, 868, 869, + 870, 904, 905, 906, 907, 908, 909, 0, 0, 0, + 20, 0, 0, 342, 0, 344, 1030, 16, 1023, 0, + 0, 249, 248, 245, 250, 251, 244, 263, 262, 255, + 256, 252, 254, 253, 257, 246, 247, 258, 259, 265, + 264, 260, 261, 0, 1047, 1036, 0, 0, 1035, 0, + 1034, 3, 55, 0, 0, 0, 44, 41, 43, 46, + 47, 48, 49, 50, 53, 13, 0, 0, 0, 910, + 548, 431, 432, 942, 0, 0, 0, 0, 0, 0, + 0, 0, 912, 911, 0, 558, 552, 557, 796, 845, + 767, 794, 793, 795, 768, 769, 770, 771, 772, 773, + 774, 775, 776, 777, 778, 779, 0, 0, 0, 876, + 0, 0, 0, 812, 811, 0, 0, 0, 0, 0, + 0, 0, 0, 918, 0, 0, 0, 0, 403, 0, + 0, 0, 921, 0, 0, 0, 0, 550, 943, 0, + 0, 0, 810, 806, 0, 0, 0, 0, 0, 0, + 0, 371, 0, 0, 0, 0, 0, 0, 0, 0, + 676, 0, 569, 0, 0, 669, 0, 0, 565, 0, + 0, 567, 563, 577, 571, 578, 572, 566, 562, 582, + 576, 581, 575, 579, 573, 580, 574, 667, 544, 0, + 424, 423, 0, 0, 0, 0, 0, 798, 0, 341, + 0, 804, 805, 0, 494, 495, 0, 0, 0, 802, + 803, 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, 1025, 763, 813, 801, 0, 843, + 844, 976, 993, 0, 0, 977, 979, 0, 1005, 962, + 960, 986, 0, 0, 984, 987, 988, 989, 990, 963, + 961, 0, 0, 0, 346, 0, 18, 0, 0, 0, + 1043, 0, 0, 353, 0, 0, 1045, 0, 0, 42, + 714, 720, 712, 0, 709, 719, 713, 711, 710, 717, + 715, 716, 722, 718, 721, 723, 0, 0, 707, 45, + 54, 493, 0, 489, 490, 0, 0, 487, 0, 815, + 0, 0, 0, 874, 0, 842, 840, 841, 0, 0, + 0, 688, 0, 915, 913, 689, 0, 0, 518, 0, + 0, 506, 513, 0, 0, 0, 507, 0, 0, 523, + 525, 0, 502, 0, 0, 0, 0, 0, 497, 0, + 500, 0, 504, 373, 917, 916, 0, 0, 920, 919, + 930, 0, 0, 0, 931, 0, 0, 945, 0, 0, + 809, 0, 383, 379, 380, 0, 0, 378, 381, 382, + 0, 0, 0, 583, 0, 0, 554, 0, 671, 600, + 599, 0, 0, 761, 0, 0, 0, 755, 757, 758, + 759, 435, 436, 0, 349, 350, 0, 187, 186, 188, + 0, 658, 0, 0, 0, 375, 0, 653, 0, 0, + 924, 0, 0, 0, 441, 0, 444, 0, 0, 442, + 0, 0, 484, 0, 448, 0, 0, 0, 0, 473, + 476, 0, 0, 468, 475, 474, 642, 643, 644, 645, + 646, 647, 648, 649, 650, 652, 651, 587, 584, 589, + 586, 588, 585, 597, 593, 598, 594, 595, 0, 596, + 0, 604, 0, 0, 605, 0, 611, 0, 612, 0, + 613, 0, 614, 0, 618, 0, 619, 0, 622, 0, + 625, 0, 628, 0, 631, 0, 634, 0, 636, 0, + 0, 522, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 975, 974, 0, 985, 0, 973, 0, 0, 343, + 1041, 1042, 0, 0, 184, 0, 0, 1051, 367, 0, + 0, 0, 364, 1037, 1039, 61, 63, 64, 0, 0, + 56, 0, 0, 65, 67, 30, 28, 0, 0, 0, + 704, 0, 708, 439, 0, 492, 0, 547, 0, 560, + 173, 195, 0, 0, 0, 163, 0, 0, 0, 174, + 553, 0, 948, 0, 896, 877, 0, 887, 0, 898, + 0, 914, 852, 0, 947, 0, 0, 505, 0, 514, + 524, 526, 0, 0, 0, 460, 0, 0, 455, 0, + 0, 666, 665, 485, 0, 528, 499, 0, 0, 148, + 529, 146, 147, 531, 0, 546, 545, 855, 0, 0, + 0, 0, 928, 0, 932, 537, 0, 0, 0, 368, + 0, 535, 0, 0, 549, 955, 0, 951, 872, 0, + 966, 0, 964, 0, 0, 686, 687, 0, 0, 0, + 664, 663, 670, 0, 440, 760, 746, 747, 745, 756, + 668, 0, 348, 656, 0, 0, 0, 568, 564, 923, + 922, 799, 445, 438, 443, 437, 551, 483, 482, 481, + 478, 477, 0, 472, 433, 434, 446, 447, 0, 639, + 0, 821, 0, 0, 994, 968, 0, 995, 0, 978, + 980, 991, 0, 1006, 0, 972, 1020, 19, 345, 1053, + 185, 1048, 0, 743, 742, 0, 741, 0, 363, 0, + 60, 57, 0, 0, 0, 0, 0, 0, 370, 0, + 698, 0, 0, 85, 84, 0, 488, 0, 0, 0, + 0, 0, 178, 559, 0, 0, 0, 0, 0, 888, + 880, 878, 0, 899, 0, 0, 946, 515, 512, 0, + 463, 0, 0, 1031, 1032, 451, 457, 0, 461, 0, + 0, 0, 0, 0, 0, 853, 0, 938, 0, 935, + 929, 0, 543, 538, 0, 0, 534, 0, 954, 0, + 871, 967, 965, 0, 555, 0, 672, 662, 351, 655, + 654, 674, 480, 0, 471, 470, 469, 640, 641, 638, + 0, 837, 820, 0, 0, 0, 826, 0, 970, 0, + 999, 0, 0, 1014, 1015, 1008, 0, 1052, 366, 365, + 0, 0, 66, 59, 0, 68, 29, 22, 0, 0, + 319, 0, 221, 0, 109, 0, 82, 831, 121, 122, + 0, 0, 0, 834, 193, 194, 0, 0, 0, 0, + 166, 175, 167, 169, 875, 0, 0, 0, 0, 0, + 897, 0, 0, 464, 465, 459, 462, 458, 452, 456, + 0, 520, 0, 486, 496, 450, 532, 530, 0, 0, + 934, 0, 0, 0, 539, 0, 957, 0, 0, 685, + 677, 0, 479, 0, 0, 818, 817, 814, 827, 969, + 0, 0, 0, 983, 0, 981, 992, 0, 1021, 1040, + 0, 79, 0, 0, 73, 74, 77, 78, 0, 336, + 325, 324, 0, 699, 217, 104, 0, 816, 835, 179, + 0, 191, 0, 0, 0, 873, 959, 0, 0, 0, + 0, 879, 0, 900, 851, 501, 498, 860, 0, 866, + 0, 0, 858, 0, 862, 941, 0, 542, 541, 956, + 952, 0, 675, 0, 0, 971, 996, 0, 982, 0, + 0, 1010, 0, 80, 71, 0, 0, 0, 320, 0, + 0, 0, 0, 0, 180, 0, 170, 168, 949, 889, + 883, 881, 0, 0, 854, 859, 0, 863, 939, 0, + 0, 678, 0, 829, 0, 1000, 1017, 1018, 1011, 58, 0, 75, 76, 0, 0, 0, 0, 0, 0, 0, - 821, 177, 0, 190, 0, 0, 886, 850, 849, 736, - 922, 936, 823, 0, 0, 0, 81, 0, 0, 337, - 0, 0, 335, 321, 0, 329, 386, 0, 384, 0, - 686, 0, 715, 218, 105, 181, 933, 870, 867, 0, - 0, 879, 0, 980, 0, 995, 0, 0, 0, 317, - 0, 0, 712, 0, 0, 0, 716, 0, 0, 0, - 0, 0, 984, 27, 26, 23, 338, 334, 0, 0, - 330, 385, 718, 0, 0, 0, 106, 869, 737, 0, - 0, 0, 0, 32, 322, 723, 0, 724, 721, 0, - 719, 102, 0, 99, 0, 0, 88, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 100, 101, 149, 0, - 0, 234, 226, 227, 228, 229, 230, 231, 232, 233, - 0, 0, 224, 0, 0, 981, 0, 339, 333, 0, - 0, 0, 687, 89, 0, 733, 735, 277, 272, 276, - 0, 219, 225, 0, 987, 985, 722, 720, 0, 0, - 0, 0, 0, 0, 0, 286, 0, 0, 235, 0, - 0, 243, 0, 161, 150, 160, 0, 0, 0, 107, - 0, 0, 271, 0, 0, 270, 0, 154, 0, 0, - 357, 318, 0, 355, 0, 0, 196, 0, 0, 0, - 0, 0, 688, 0, 220, 0, 112, 110, 293, 0, + 694, 0, 725, 0, 691, 836, 177, 0, 190, 0, + 0, 901, 865, 864, 0, 953, 838, 0, 0, 0, + 81, 0, 0, 337, 0, 0, 335, 321, 0, 329, + 0, 386, 0, 384, 0, 0, 700, 0, 730, 218, + 0, 181, 950, 885, 882, 0, 0, 894, 748, 750, + 937, 997, 0, 1012, 0, 0, 0, 317, 0, 0, + 692, 727, 0, 696, 0, 0, 731, 0, 105, 0, + 0, 0, 1001, 27, 26, 23, 338, 334, 0, 0, + 330, 385, 0, 733, 0, 0, 0, 0, 884, 0, + 0, 0, 0, 0, 32, 322, 0, 738, 0, 739, + 736, 0, 734, 102, 0, 99, 0, 0, 88, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 100, 101, + 149, 0, 0, 234, 226, 227, 228, 229, 230, 231, + 232, 233, 0, 0, 224, 106, 749, 0, 998, 0, + 339, 333, 697, 0, 0, 0, 701, 89, 0, 277, + 272, 276, 0, 219, 225, 0, 1004, 1002, 737, 735, + 0, 0, 0, 0, 0, 0, 0, 286, 0, 0, + 235, 0, 0, 243, 0, 161, 150, 160, 0, 0, + 0, 0, 0, 271, 0, 0, 270, 0, 154, 0, + 0, 357, 318, 0, 355, 0, 0, 196, 0, 0, + 0, 0, 0, 702, 220, 107, 112, 110, 293, 0, 354, 0, 0, 0, 0, 125, 0, 0, 0, 0, 0, 0, 159, 151, 0, 0, 200, 0, 358, 0, - 238, 237, 236, 0, 734, 108, 0, 290, 0, 268, - 127, 0, 266, 0, 0, 0, 129, 0, 359, 0, - 0, 197, 0, 0, 0, 356, 241, 120, 118, 0, + 238, 237, 236, 0, 0, 0, 290, 0, 268, 127, + 0, 266, 0, 0, 0, 129, 0, 359, 0, 0, + 197, 0, 0, 0, 356, 241, 108, 120, 118, 0, 0, 295, 0, 0, 0, 0, 0, 155, 0, 274, 0, 0, 0, 0, 133, 0, 0, 0, 0, 360, 361, 0, 0, 0, 0, 0, 115, 310, 0, 291, @@ -10337,683 +10527,682 @@ void case_1035() 0, 203, 281, 283, }; protected static readonly short [] yyDgoto = { 7, - 8, 49, 9, 50, 10, 11, 51, 232, 740, 702, - 12, 13, 52, 22, 23, 326, 235, 725, 901, 1100, - 1219, 1266, 1576, 898, 236, 237, 238, 239, 240, 241, - 242, 243, 718, 462, 719, 720, 1004, 721, 722, 1008, - 899, 1095, 1096, 1097, 267, 619, 1191, 110, 910, 780, - 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, - 1305, 1306, 1307, 1308, 481, 729, 1384, 1018, 1198, 1162, - 1231, 1259, 1324, 1396, 1227, 1450, 1427, 1475, 1476, 1477, - 1020, 1473, 1021, 789, 902, 1438, 1411, 1463, 534, 1456, - 1432, 1492, 984, 1461, 1464, 1465, 1560, 1493, 1494, 1490, - 1309, 1365, 1335, 1385, 742, 1440, 1539, 1408, 1496, 1569, - 482, 268, 743, 744, 745, 746, 747, 705, 592, 1203, - 706, 707, 916, 1387, 1416, 1507, 1468, 1541, 1388, 1443, - 1544, 1589, 1508, 1509, 1587, 1573, 1574, 1016, 1161, 1258, - 1321, 1369, 1322, 1323, 1359, 1423, 1391, 1360, 329, 223, - 1472, 1362, 1457, 1454, 1310, 1339, 1380, 1536, 1498, 1340, - 1537, 620, 1582, 1583, 1379, 1453, 1429, 1485, 1480, 1451, - 1517, 1522, 1483, 1486, 1487, 1568, 1523, 1481, 1482, 1578, - 1566, 1567, 1013, 1104, 1224, 1196, 1251, 1225, 1226, 1269, - 1158, 1248, 1282, 555, 193, 112, 366, 195, 585, 457, - 224, 1403, 703, 704, 886, 903, 330, 422, 554, 305, - 1228, 1229, 45, 114, 306, 116, 117, 118, 119, 120, + 8, 50, 9, 51, 10, 11, 52, 234, 753, 754, + 12, 13, 53, 22, 23, 329, 237, 738, 917, 1119, + 1243, 1296, 1606, 914, 238, 239, 240, 241, 242, 243, + 244, 245, 731, 468, 732, 733, 1022, 734, 735, 1026, + 915, 1114, 1115, 1116, 270, 631, 1211, 111, 926, 794, + 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, + 1337, 1338, 1339, 1340, 487, 742, 1415, 1036, 1224, 1182, + 1222, 1257, 1308, 1376, 1455, 1252, 1480, 1456, 1505, 1506, + 1507, 1038, 1503, 1039, 803, 918, 1467, 1441, 1493, 543, + 1486, 1461, 1522, 1002, 1491, 1494, 1495, 1590, 1523, 1524, + 1520, 1341, 1397, 1369, 1416, 755, 1469, 1569, 1438, 1526, + 1599, 488, 271, 756, 757, 758, 759, 760, 713, 604, + 1228, 714, 715, 932, 1418, 1446, 1537, 1498, 1571, 1419, + 1472, 1574, 1619, 1538, 1539, 1617, 1603, 1604, 1034, 1181, + 1288, 1353, 1400, 1354, 1355, 1391, 1453, 1422, 1392, 332, + 224, 1502, 1394, 1487, 1484, 1342, 1371, 1411, 1566, 1528, + 1271, 1567, 632, 1612, 1613, 1410, 1483, 1458, 1515, 1510, + 1481, 1547, 1552, 1513, 1516, 1517, 1598, 1553, 1511, 1512, + 1608, 1596, 1597, 1031, 1123, 1248, 1216, 1279, 1249, 1250, + 1299, 1178, 1276, 1313, 564, 194, 113, 372, 196, 597, + 464, 227, 1433, 722, 723, 906, 919, 333, 428, 563, + 308, 1253, 1254, 46, 115, 309, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 253, 861, 785, 1057, - 1047, 773, 940, 774, 775, 1048, 137, 198, 781, 622, - 623, 624, 855, 491, 492, 298, 1055, 783, 423, 300, - 517, 518, 519, 520, 523, 791, 314, 808, 809, 956, - 264, 497, 823, 265, 496, 138, 139, 140, 141, 142, + 131, 132, 133, 134, 135, 136, 137, 255, 877, 799, + 1075, 1065, 787, 956, 788, 789, 1066, 138, 199, 795, + 634, 635, 636, 871, 497, 498, 301, 1073, 797, 429, + 303, 526, 527, 528, 529, 532, 805, 317, 823, 824, + 974, 267, 503, 838, 268, 502, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 595, 596, 597, 828, 829, 153, 582, 571, 825, 367, - 1073, 569, 1142, 154, 511, 1014, 1160, 1256, 1363, 483, - 1232, 1233, 1290, 1291, 887, 574, 344, 833, 1367, 1211, - 1243, 575, 576, 269, 270, 271, 157, 158, 159, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 171, 284, 602, 172, 173, 322, 868, 678, 987, - 1079, 913, 736, 1024, 985, 988, 1120, 989, 1025, 1026, - 285, 174, 175, 176, 1132, 1061, 1133, 1134, 1135, 1136, - 177, 178, 179, 180, 753, 504, 754, 1123, 1042, 1124, - 1239, 1206, 1240, 755, 1041, 756, 1242, 1173, 181, 182, - 183, 184, 185, 186, 307, 545, 546, 1063, 1180, 318, - 1040, 923, 1205, 1070, 962, 1181, 187, 435, 188, 436, - 990, 1082, 437, 438, 694, 685, 686, 1087, 994, 439, - 440, 441, 442, 443, 995, 680, 992, 1185, 1262, 1326, - 1084, 1215, 1281, 878, 688, 879, 1151, 1089, 1152, 1216, - 999, 17, 19, 46, 47, 227, 708, 894, 458, 709, - 710, + 153, 607, 608, 609, 843, 844, 154, 594, 582, 840, + 373, 1092, 578, 1162, 155, 517, 1219, 1220, 1223, 1303, + 1032, 1180, 1286, 1395, 489, 1258, 1259, 1322, 1323, 907, + 586, 350, 849, 1291, 0, 0, 587, 588, 272, 273, + 274, 158, 159, 160, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 172, 287, 614, 173, + 174, 325, 884, 691, 1005, 1098, 929, 749, 1042, 1003, + 1006, 1139, 1007, 1043, 1044, 288, 175, 176, 177, 1151, + 1079, 1152, 1153, 1154, 1155, 178, 179, 180, 181, 766, + 510, 767, 1142, 1060, 1143, 1265, 1231, 1266, 768, 1059, + 769, 1268, 1193, 182, 183, 184, 185, 186, 187, 310, + 554, 555, 1082, 812, 1200, 321, 1058, 939, 1230, 1089, + 980, 1201, 188, 441, 189, 442, 1008, 1101, 443, 444, + 707, 698, 699, 1106, 1012, 445, 446, 447, 448, 449, + 1013, 693, 1010, 1205, 1292, 1359, 1103, 1239, 1312, 894, + 701, 895, 1171, 1108, 1172, 1240, 1017, 17, 19, 47, + 48, 226, 716, 910, 462, 717, 718, }; - protected static readonly short [] yySindex = { -100, - 0, -179, -141, -43, 33,17069, 0, 162, 0, 0, - 33, -43, 0, 0, 19, 0, 7076, 33, 0, -164, - 63, 0, 0, 0, 0, 0, 0, 0, 180, 0, - 191, 0, 0, 0, 3956, 0, 0, 0, 0, 0, - 0, 0, 0, 700, 0, 0, 726, 0, 0, 162, - 224, 33, 0, 184, 0, 333, 251, -183,16498, -63, - -266, 288, 7233, 0, -266, -266, -266, -185, -266, -266, - 757, 0, 9077, -266, -266, 0, 9234, 0, 319, 0, - -163, 0, -266, 420, -266, 0,17088,17088, 450, -266, - -266, 17,10307, 0,15737, 0,10438,10569,10700,10831, -10962,11093,11224,11355, 0, 151, 0, 8035, 0, 205, - 0, 123, 434, 437, 337, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1080, 795, - 227, -258, 588, 389, 460, 478, 504, 523, -274, 564, - 0, 0, 0, 0, 0, 0, 3657, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 123, 612, -286, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 225, 272, 224, 0, - 445, 219, 0, 608, 0, 0, 0, 0, 8035, 8035, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 635, 596, 0, 617, 0, -236, 0, 0, - 0, 224, 1481, 487, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 790, 123,15873, 0, 0, 0, - 0, 0,15737, -197, -161, 778, 370, 437, 123, 0, - 0, 8035, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -180, 215,16498, 0, 8035,15737, 692, - 0, 0, 703,15737,15737,14106, 677, -201, 718, 8192, - 0,10307, 151, 835, 721, 0, 739, 8035,15737, 0, - 882, 769, 536, -266, 0, 0,15737, 319,15329, 0, - 0, 420,15737, 420, -276, 530, 863, 123, 0, 612, - 337, 868, 123,15737,15737,15737, 288, 0, 841, 0, - 0,11486, 0, 7390, -264, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1406, 0, 0,16895, -276, 817, 816, -15737, 0, 783, 0, 181, 0, 0, 254, 0, 0, - 784, 9391, 7704, 0, 0,15737,15737,15737,15737,15737, -15737,15737,15737,15737,15737,15737,11617,11748,11879, 4222, - 4540,12010,12141,12272,12403,12534,12665,12796,12927,13058, -13189,13320,13451,13582,13713,13844,16281,15737, 0, 0, - 0, 0, 612, 0, 0, 0, 0,17088,17088, 0, - 0, 123, 0, 0, 0, 0, 489, 856, 0, 0, - 0, 0, 0, 0, 0, 224, 487, 823, 0, 826, - 0, 783, 635, 635, 0, 129, 0, 539, 635, 881, - 0, -111, 1481, 0, 0, 0, 0, -158, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 289,17624, 0, 0, 0, 0, 783, 0, 0, 840, - 732, 0, 885, 0, 896, 198, 319, 0, -266, 0, - 0, 0, 123,15329, -176, 0, 878, 0, 0, 0, - 53, 100, 0, 370, 894, 0, 910, 0, 906, 0, - 0, 0, 742, 0, 8447, 744, 9548, 718,15193, 0, - 7861, 0, 420, 0, 0, 0, 0, 106, 125, 0, - 0, 0, 214, 319, 499, 0, 1129, 915, 0, 143, - 123, 0, 146, 0, 0, 0,15737, 988, 0, 0, - 0,15737, 994, 916, 0, 917, 919, 0,16895, 0, - 84, 0, -125, 127, 7390, 0, 0, 0, 0, 0, - 0, 84, 0, 0, -267, 0, 0, 0, 420, 0, - -276, 123, 8623, 0, 918, 0, 921,13975, 0, 1038, - 920, 7390, 0, 869, 0, 783, 875, 0, 783, 783, - 0, -168, 0,15737,15737, 928, 1046, 0, 0, 201, - -131, 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, 795, 0, 795, 0, - 227, 0, 227, 0, -258, 0, -258, 0, -258, 0, - -258, 0, 588, 0, 588, 0, 389, 0, 460, 0, - 478, 0, 504, 0, 523, 0, 54, -155, 0, 9548, - 1014, 123, 1017, 123, 9548, 9548, 931,15737, 0, 0, - 856, 0, 123, 0, 534, 783, 0, 0, 0, 0, - 223, 224, 322, 0, 8623, 539, 0, 941, 940, 0, - 0, 0, 0, 0, 0, -98, 942, 0, 945, 943, - 0, 0, 0, 0, 948, 8780, 898, 0, -162, 0, - 0, 631, 0,15873, 0, 949, 0, 0, 0, 577, - 131, 950, 0, 952, 958, 969, 0, 0,15737, 0, - 123, 0, 0, 764, 0, 971, 0, 372, 0, 0, - 7233, 0, 7233, 8606, 0,14106, 0, 0,10176, 8763, - 271, 0, 134, 102, 0, 895, 923, 0, 0, 0, - 767, 0, 0, 975, 976, 0, 0, 0, 0, 0, - 978, 0, 0, 0, 982, 0, 4699, 0, 319, 0, - 0, 420, 562, 932, 0, 150, 0, 983, 984, 0, - 0, 7233, 0, 0, 7233, 0,15737, 0,15737, 8035, - 0, 0, 319, 986, 84, 0, 0, 0,15737, 0, - 0, 0, 0, 0, 0, 8035, 0, 0, 123,16895, - 1020, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,15057, 0, 0, 0, - 0, 0, 8018, 0, 8920, 0, 8175, 992, 0, 0, - 1066, 0, 1073, 0, 0, 0, 797, 0, 996, 0, - 0, 0, 0, 0, 0, 953, 0, 129, 0, 0, - 0, 0, 539, 539, 0, 0, 823, 998, 1002, 956, - 1008, 898, 0, 1001, 0, 1121, 1122, 0, 0, 9548, - 0,15465, 1005, 577, 8623, 8035, 0, 0, -227, 1124, - 1126, 164, 1003, 0, 0, 0,15737, 0,15737, 1103, - 0, 0, 0,15601, 0, 451,15601, 0, 0, 0, - 0, 8311, 0, 1131, 612, 9548, 1021, 8606, 1022, 0, - 0, 123, 0, 266, 0, 0, 783, 932, 0, 123, - 0, 82, 0, 0, 0, 1019, 0, 1049, 0, 0, - 0, 0, 0, 0, 0, 801, 0, 0, 0, 0, - 0, 0, 8192, 0, 0, 123, 486, 992, 0, 9548, - 0, 9548, 0, 165, 9548, 0, 0, 0, 743, 0, - 0, 0, 1025, 823, 0, 0, 9705, 0, 0, 0, - 1018, 4864, 0, 898, 0, 898, 0, 898, 0, 0, - 0, 0, 123, 1024, 1005, 0, 0, 0, -174, -147, - 1023, 1027, 0, 0, 0, 0, 0, 1030, 8606, 992, - -155,15737, 0, 1026, 7233, 0, 0, 0, 0, 0, - 0, 0, 1041, 0, 718, 0, 0, 0, 0, 0, - -184, 0, 1040, 783, 932, 0, 932, 0, 992, 1042, - 0, 0, 84, 0, 990, 1037, 0, 0, 0, 0, - 0, 9548, 1074, 9548, 0, 9548, 0, 0,15737, 0, - 0, 943, 0, 302, 813, 0, 0, 0, 0, -43, - 0, 0, 0, 1053, 0, 0, 0, 1044, 0, 0, - 0, 383, 0, 1045, 1166, 1167, 0, 0, 992, 1056, - 992, 1058, 0, 1059, 0, 0, 0, 0, 0,15737, - 0, 1064, -138, 0, 6917, 0, 1180, 0, 0, 0, - 0, 84, 0,15737, 8175, 0, 0, 1090, 0, 811, - 1065, 0, 1068, 0, 0, 9705, 33, 198, 0, 1067, - 1067, 1067,15465, 1076, 0,15737, 0, 0, 0, 0, - 0, 0, 7233, 74, 0, 0, 7390, 0, 0, 1083, - 7233, 0, 1084, 0, 9548, 0, 0, 0, 0, 0, -15737, 0, 0, 224, 1071, 224, 8035, 1114, 1114, 1114, - 0, 0,15737, 0, 7233, 9862, 0, 0, 0, 0, - 0, 0, 0, 1107, 9548,15737, 0, 224, 1089, 0, - 1047, 574, 0, 0, 1088, 0, 0, 103, 0, 1051, - 0, 1114, 0, 0, 0, 0, 0, 0, 0, 1092, - 971, 0, 7390, 0, 1123, 0, 41, 1114, 1214, 0, - 1104, 224, 0, 8035, 78, 1108, 0, 1109, 1110, 7233, - 1111, 9548, 0, 0, 0, 0, 0, 0, 1097, 1105, - 0, 0, 0,16577, 137, 224, 0, 0, 0, 1137, - 9548, 1118,15737, 0, 0, 0, 1132, 0, 0, 1134, - 0, 0,17624, 0, 1127, 137, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 621, -17624, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1143, 224, 0, 137, 123, 0, 1137, 0, 0, 1125, -16577,16743, 0, 0, 515, 0, 0, 0, 0, 0, -16775, 0, 0, 1144, 0, 0, 0, 0, 8035, 8035, - 83, 8192, 419, 420, 1176, 0, -276,14925, 0, 1209, - 0, 0, 1105, 0, 0, 0, 7390,14963, 1105, 0, - -145, -144, 0, 8035, -137, 0, 8035, 0, 1099, 1148, - 0, 0, -276, 0, 55,14993, 0, 1146, 1112, 119, - 554, 3956, 0, 1153, 0, 1105, 0, 0, 0, -276, - 0, 1155, 1113, 1152, 1151, 0, 1157, 1115, 1158, 198, - 1154, 1159, 0, 0, 1163, 1171, 0, 783, 0, 604, - 0, 0, 0, 1168, 0, 0, 87, 0, 1160, 0, - 0, 1173, 0, 1174, 1172, 1178, 0, 1177, 0, 198, - 198, 0, 198, 1175, 1179, 0, 0, 0, 0, 1184, - 183, 0, 1185, 198, 1290, 1186, 198, 0, 515, 0, - 8606, 1135, 1191, 1177, 0, 1182, 1189, 189, 1192, 0, - 0, 198,15465, 1150, 1193, 1184, 0, 0,17624, 0, - 224, 224, 0, 1156, 1194, 1185, 0, 1199, 0,15737, - 1161, 1197, 1186, 0, 1203, 198, 0, 91, 0, 1195, - 0, 0, 0, 0, 0,17624, 0, 189, 189, 0, - 1205, 0, 87, 0, 0, 97, 1210,17624, 0,17624, - 0, 0, 8606, 1202, 0, 0, 0, 1215, 1173, 0, - 0, 0, 1212, 0, 287, 0, 0, 0, 1114, 814, - 1218, 0, 0, 1221, 0, 0, 0, 0, 0, 1286, - 1339, 0, 0, 0, 0, 0, 0, 1232, 1233, 8606, - 0, 0, 0, 0, 189, 580, 580, 0, 1114, 0, - 0, 0, 24, 24, 0, 0, 0, 0, 0, 0, - 0,15193,15193, 0, 0, 0, 0, 0, 1237, 1234, - 1235, 0, 0, 0, + protected static readonly short [] yySindex = { -98, + 0, -176, 55, -199, 34,17217, 0, 149, 0, 0, + 34, -199, 0, 0, 28, 0, 7035, 34, 0, -170, + -239, 0, 0, 0, 0, 0, 0, 0, 200, 0, + 297, 0, 0, 0, 1389, 0, 0, 0, 0, 0, + 0, 320, 0, 0, 678, 0, 0, 732, 0, 0, + 149, 366, 34, 0, 443, 0, 30, 529, -141,16646, + -77, 298, 548, 7192, 0, 298, 298, 298, 38, 298, + 298, 788, 0, 9169, 298, 298, 0, 9326, 0, 512, + 0, -118, 0, 298, 554, 298, 0, 777, 777, 587, + 298, 298, -73, 9485, 0,15885, 0,10665,10796,10927, +11058,11189,11320,11451,11582, 0, 226, 0, 9029, 0, + 230, 0, 212, 551, 744, -223, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1744, + 805, 96, 465, 640, 714, 617, 576, 654, 661, 164, + 679, 0, 0, 0, 0, 0, 0, 3587, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 212, 711, 319, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 158, 387, 366, + 0, 472, 626, 0, 700, 0, 0, 0, 0, 9029, + 9029, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 320, 0, 0, 681, 713, 0, 18, + 0, 0, 0, 366,17762, 802, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 818, 212,16021, 0, + 0, 0, 0, 0,15885, -180, -174, 857, 771, 409, + 744, 212, 0, 0, 9029, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 108, -279,16646, 0, + 9029,15885, 808, 0, 0, 811,15885,15885, 5423, 218, + -110, 793, 9186, 0, 9485, 226, 946, 837, 0, 842, + 9029,15885, 0, 957, 851, 549, 298, 0, 0,15885, + 512,15477, 0, 0, 554,15885, 554, 176, 557, 940, + 212, 0, 711, -223, 943, 212,15885,15885,15885, 548, + 0, 898, 0, 9029, 9029, 0,10534, 212, 0, 7349, + -240, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 4470, + 0, 0,17043, 176, 872, 888,15885, 0, 854, 0, + 173, 0, 0, 217, 0, 0, 853, 9616, 7663, 0, + 0,15885,15885,15885,15885,15885,15885,15885,15885,15885, +15885,15885,11713,11844,11975, 4629, 4794,12106,12237,12368, +12499,12630,12761,12892,13023,13154,13285,13416,13547,13678, +13809,13940,16429,15885, 0, 0, 0, 0, 711, 0, + 0, 0, 0, 777, 777, 0, 0, 212, 0, 0, + 0, 0, 442, 932, 0, 0, 0, 0, 0, 0, + 0, 366, 802, 867, 0, 896, 0, 854, 320, 320, + 0, 643, 171, 0, 320, 935, 0, -131,17762, 0, + 0, 0, 0, -162, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 93,17794, 0, 0, + 0, 0, 854, 0, 0, 970, 503, 0, 950, 0, + 977, 157, 512, 0, 298, 0, 0, 0, 212,15477, + -185, 0, 974, 0, 0, 0, 110, 111, 0, 771, + 409, 0, 0, 975, 0, 985, 0, 981, 941, 0, + 0, 645, 0, 8406, 705, 9773, 793,15341, 0, 7820, + 0, 554, 0, 0, 0, 0, 117, 134, 0, 0, + 0, 70, 512, -151, 0, 4152, 991, 0, 152, 212, + 0, 161, 0, 0, 0,15885, 1070, 0, 0, 0, +15885, 1075, 997, 0, 1002, 1003, 0,17043, 0, 0, + 0, 170, 854, 0, -206, 133, 7349, 0, 0, 0, + 0, 0, 0, 170, 0, 0, -254, 0, 0, 0, + 554, 0, 176, 212, 9790, 0, 1004, 0, 1020,14071, + 0, 1137, 1021, 7349, 0, 968, 0, 854, 971, 0, + 854, 854, 0, 77, 0,15885,15885, 1027, 1144, 0, + 0, 189, -154, 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, 805, 0, + 805, 0,10403, 96, 0, 96, 0, 465, 0, 465, + 0, 465, 0, 465, 0, 640, 0, 640, 0, 714, + 0, 617, 0, 576, 0, 654, 0, 661, 0, -58, + -172, 0, 9773, 1108, 212, 1110, 212, 9773, 9773, 1029, +15885, 0, 0, 932, 0, 212, 0, 665, 854, 0, + 0, 0, 9790, 643, 0, 1039, 1040, 0, 0, 377, + 366, 390, 0, 0, 0, 0, 0, 0, -203, 1047, + 0, 1038, 1051, 0, 0, 0, 0, 1048, 9947, 1017, + 0, 424, 0, 0, 530, 0,16021, 0, 1055, 0, + 0, 0, 591, 177, 1065, 0, 1064, 1067, 1068, 0, + 0,15885, 0, 212, 0, 0, 754, 0, 1069, 0, + 327, 0, 0, 7192, 0, 7192, 8565, 0,14202, 0, + 0, 0, 8724, 8855, 242, 0, 166, -81, 0, 1010, + 1022, 0, 0, 0, 751, 0, 0, 1072, 1074, 0, + 0, 0, 0, 0, 1076, 0, 0, 0, 1082, 298, + 7680, 512, 0, 512, 0, 0, 554, 581, 1030, 0, + 274, 0, 1080, 1081, 0, 0, 7192, 0, 0, 7192, + 0,15885, 0,15885, 9029, 0, 0, 512, 1086, 170, + 0, 0, 0,15885, 0, 0, 0, 0, 0, 0, + 0, 9029, 0, 0, 212,17043, 1116, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,15205, 0, 0, 0, 0, 0, 7977, 0, + 9012, 0, 8134, 1079, 0, 0, 1166, 0, 1167, 0, + 0, 0, 923, 0, 1089, 0, 0, 0, 0, 0, + 0, 0, 643, 0, 0, 1049, 0, 171, 0, 643, + 0, 0, 867, 1096, 1097, 1054, 1102, 1017, 0, 1098, + 0, 1219, 1220, 0, 0, 9773, 0,15613, 1106, 591, + 9790, 9029, 0, 0, 386, 1225, 1226, 163, 1104, 0, + 0, 0,15885, 0,15885, 1203, 0, 0, 0,15749, + 0, 555,15749, 0, 0, 0, 0, 8270, 0, 1244, + 711, 9773, 1134, 8565, 1138, 0,15885, 0, 212, 0, + 0, 301, 0, 0, 854, 1030, 0, 212, 0, -168, + 0, 0, 0, 1130, 0, 1164, 0, 0, 0, 0, + 0, 0, 0, 804, 0, 0, 0, 0, 0, 0, + 9186, 0, 0, 212, 595, 1079, 0, 9773, 0, 9773, + 0, 141, 9773, 0, 0, 0, 789, 0, 0, 0, + 1139, 867, 0, 0, 9930, 0, 0, 0, 1140, 7837, + 0, 1017, 0, 1017, 0, 1017, 0, 0, 0, 0, + 212, 1132, 1106, 0, 0, 0, -171, -150, 1136, 1141, + 0, 0, 0, 0, 0, 1143, 8565, 1079, -172,15885, + 0, 1145, 7192, 0, 0, 0, 0, 0, 0, 0, + 1142, 0, 793, 0, 0, 0, 0, 0, -212, 1148, + 0, 1149, 854, 1030, 0, 1030, 0, 1079, 1153, 0, + 0, 170, 0, 1090, 1135, 0, 0, 0, 0, 0, + 9773, 1179, 9773, 0, 9773, 0, 0,15885, 0, 0, + 1051, 0, 368, 825, 0, 0, 0, 0, -199, 0, + 0, 0, 1160, 0, 0, 0, 1147, 0, 0, 0, + 509, 0, 1150, 1273, 1274, 0, 0, 1079, 1161, 1079, + 1165, 0, 1156, 0, 0, 0, 0, 0,15885, 0, + 1170, -167, 0, 6876, 0, 0, 1283, 0, 0, 0, + 0, 170, 0,15885, 8134, 0, 0, 1194, 0, 938, + 1168, 0, 1173, 0, 0, 9930, 34, 157, 0, 302, + 1169, 1175,15613, 1181, 0,15885, 0, 0, 0, 0, + 0, 0, 7192, 40, 0, 0, 7349, 0, 0, 1260, + 7192, 0, 1183, 0, 9773, 0, 0, 0, 0, 0, +15885, 0, 0, 366, 1184, 366, 157, 9029, 1169, 1218, + 0, 1218, 0, 1169, 0, 0, 0,15885, 0, 7192, +10087, 0, 0, 0, 884, 0, 0, 1210, 9773,15885, + 0, 366, 1195, 0, 1146, 931, 0, 0, 1188, 0, + 1196, 0, 97, 0, 1198, 1152, 0, 1218, 0, 0, + 1218, 0, 0, 0, 0, 1200, 1069, 0, 0, 0, + 0, 0, 1227, 0, 52, 1218, 1311, 0, 1209, 366, + 0, 0, 9029, 0, 63, 1211, 0, 1212, 0, 7192, + 7349, 9773, 0, 0, 0, 0, 0, 0, 1199, 1206, + 0, 0,15341, 0,16725, 183, 366, 1216, 0, 1217, + 1228, 9773, 1213,15885, 0, 0, 1232, 0, 1221, 0, + 0, 1214, 0, 0,17794, 0, 1222, 183, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 534,17794, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1223, 366, 0, 0, 0, 212, 0, 1228, + 0, 0, 0, 1233,16725,16891, 0, 0, -222, 0, + 0, 0,16923, 0, 0, 183, 0, 0, 0, 0, + 9029, 9029, -165, 9186, 460, 554, 1261, 0, 176,15059, + 0, 1292, 0, 0, 1206, 0, 0, 0,15097, 1206, + 1239, -147, -132, 0, 9029, -126, 0, 9029, 0, 1201, + 1249, 0, 0, 176, 0, 168,15135, 0, 1254, 1208, + 175, 453, 1389, 0, 0, 0, 0, 0, 0, 176, + 0, 1257, 1224, 1256, 1252, 0, 1264, 1231, 1268, 157, + 1250, 1270, 0, 0, 1279, 1286, 0, 854, 0, 911, + 0, 0, 0, 1284, 1206, -49, 0, 1285, 0, 0, + 1295, 0, 1294, 1282, 1296, 0, 1293, 0, 157, 157, + 0, 157, 1297, 1298, 0, 0, 0, 0, 0, 1299, + 184, 0, 1302, 157, 1413, 1303, 157, 0, -222, 0, + 8565, 1266, 1310, 1293, 0, 1300, 1307, 187, 1317, 0, + 0, 157,15613, 1272, 1312, 1299, 0, 0,17794, 0, + 366, 366, 0, 1275, 1316, 1302, 0, 1322, 0,15885, + 1278, 1323, 1303, 0, 1329, 157, 0, 95, 0, 1321, + 0, 0, 0, 0, 0,17794, 0, 187, 187, 0, + 1331, 0, -49, 0, 0, -146, 1336,17794, 0,17794, + 0, 0, 8565, 1324, 0, 0, 0, 1337, 1295, 0, + 0, 0, 1338, 0, -120, 0, 0, 0, 1218, 965, + 1340, 0, 0, 1342, 0, 0, 0, 0, 0, 1396, + 1449, 0, 0, 0, 0, 0, 0, 1343, 1346, 8565, + 0, 0, 0, 0, 187, 508, 508, 0, 1218, 0, + 0, 0, -60, -60, 0, 0, 0, 0, 0, 0, + 0,15341,15341, 0, 0, 0, 0, 0, 1345, 1350, + 1351, 0, 0, 0, }; - protected static readonly short [] yyRindex = { 3086, - 0, 0, 7547, 3086, 0, 0, 0, 1608, 0, 0, - 3272, 1804, 0, 0, 0, 0, 0, 3272, 0, 0, - 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1609, 0, 0, 1609, 0, 0, 1608, - 3315, 3155, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1245, 0, 0, 0, 0, 0, 0, 0, 0, - 8937, 0, 1240, 0, 0, 0, 1240, 0, 0, 0, - 0, 0, 0, 310, 0, 0, 0, 0, 0, 0, - 0, 0, 233, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 4857, 0, 0, 0, 0, - 0, 0, 311, 4950, 4292, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 5106, 5174, - 5414, 5618, 5958, 1839, 6230, 6366, 6502, 6638, 1243, 524, - 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 294, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 3378, 0, - 603, 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, 1609, 67, 0, 0, 0, 0, 0, 0, - 0, 3425, 632, 3492, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3903, 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, - 0, 0, 0, 0, 0, 1246, 0, 0, 0, 0, - 0, 0, 3903, 1244, 0, 0, 0, 0, 0, 0, - 1244, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2404, 0, 2768, 341, 2534, 0, 0, 0, 2664, - 2534, 0, 0, 0, 0, 0, 1245, 0, 0, 0, - 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1249, 1674, 0, 0, - 1240, 0, 3903, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 235, 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, 0, 0, 0, 0, - 0, 0, 1964, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 4024, 0, 0, - 0, 0, 0, 0, 0, 3535, 3578, 0, 0, 0, - 0, 2258, 1609, 1609, 0, -207, 0, 7721, 1609, 1622, - 0, 0, 207, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 425,16430, 0, 0, 0, 0, 3903, 0, 0, 0, - 0, 0, 0, 0, 0,16819, 0, 0, 0, 0, - 0, 0, 0, 771, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 836, 682, 936, 0, 0, 1255, 0, - 0, 0, 0, 0, 226, 0, 0, 4380, 1252, 0, - 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1581, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1249, 0, -16009, 0, 6757, 0, 252, 0, 0, 0, 0, 0, - 0,16009, 0, 0, 0, 0, 0, 0, -28, 0, - 680, 0, 0, 0, 1253, 0, 0, 0, 0, 1244, - 0, 0, 0, 3744, 0, 3903, 3744, 0, 3903, 4539, - 0, 0, 0, 0, 0, -195, 0, 0, 0, 0, - 238, 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, 5278, 0, 5346, 0, - 5482, 0, 5550, 0, 5686, 0, 5754, 0, 5822, 0, - 5890, 0, 6026, 0, 6094, 0, 6162, 0, 6298, 0, - 6434, 0, 6570, 0, 6694, 0, 0, 660, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4024, 0, 0, 0, 0, 2258, 0, 0, 0, 0, - 1208,14268, 0, 0, 0, 9094, 0, 0, 818, 0, - 0, 0, 0, 0, 0, 760, 687, 0, 0, 1257, - 0, 0, 0, 0, 3023, 0, 0, 0, 0, 0, - 0,10019, 0, 0, 0, 820, 0, 0, 0, 9251, -16966, 0, 0, 831, 846, 849, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 772, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1260, 0, 0, 0, 0, - 3810, 0, 0, 258, 0, 99, 4062, 0, 0, 0, - 0, 0, 0, 0, 1258, 0, 0, 0, 0, 0, - 1261, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 260, 626, 0, 0, 0, 0, 0, 1262, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,16009, 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, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 618, 0, 0, - 0, 0, 0, 0, 0, 0, -177, 0, 613, 0, - 0, 0, 0, 0, 0, 0, 0, -207, 0, 0, - 0, 0, 9251, 7878, 0, 0, 1268, 0, 780, 0, - 0, 0, 0, 1265, 0, 1241, 1242, 0, 0, 0, - 0, 0, 1263, 9408, 0, 0, 0, 0,16998, 0, - 0, 0, 834, 0, 0, 0, 0, 0, 0, 2132, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 4221, 0, 4698, 1288, 0, 0, - 0, 950, 0, 0, 0, 0, -240, 0, 0, 0, - 0, 834, 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, 633, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 848, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1282, 0, 0, 0, 0, 0, - 866, 870, 0, 0, 0, 0, 0, 0, 0, 1289, - 512, 1287, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 4380, 0, 0, 0, 0, 0, - 1296, 0, 0, -240, 0, 0, 853, 0, 1289, 0, - 0, 0,16009, 0, 735, 749, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1257, 0,14107, 0, 0, 0, 0, 0,17136, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 704, 0, 716, 0, 0, 0, 0, 915, 0, - 787, 1291, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1297, 0, 0, 0, 1302, 0, 0, 0, - 0,16009, 0, 0, 0, 0, 0, 0, 0, -154, - 671, 0, 0, 0, 0, 0,17212,16819, 0, 432, - 432, 432, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -182, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,17317, 0, -255, 0, 1303, 1303, 1303, - 0, 0, 0, 0, 0, 1306, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0,17360, 0, 0, - 0,14571, 0, 0, 1307, 0, 0, 447, 0, 0, - 0, 591, 0, 0, 0, 0, 0, 0, 0, 0, - 1308, 0, 1311, 0, 0, 0, 3229, 1310, 363, 0, - 0, -54, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2937, - 0, 0, 0, 0,14373,14657, 0, 0, 0, 731, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 442, - 0, 0,16601, 0, 0,14472, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16669, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0,14751, 0,14373, 0, 0, 731, 0, 0, 0, - 0, 425, 0, 0, 0, 0, 0, 0, 0, 0, - 425, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 5080, 443, 0,14793, 0, 0, 0, -14863, 0, 2937, 0, 0, 0, 1311, 0, 2937, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 275, 0, 1315, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 2937, 0, 0, 0, 565, - 0, 664, 0, 0, 0, 0, 0, 0, 0,16819, - 877, 0, 0, 0, 0, 0, 0, 1314, 0, 402, - 0, 0, 0, 0, 0, 0, 0, 0, 886, 0, - 0, 0, 0, 0, 0, 0, 0, 1312, 0,16819, -16819, 0,16851, 0, 0, 0, 0, 0, 0, 1313, -17584, 0, 1316,16819,16145, 1319,16819, 0, 0, 0, - 0, 0, 0, 1320, 0, 0, 0,17554, 0, 0, - 0,16819, 0, 0, 0, 1321, 0, 0, 407, 0, -17478,17516, 0, 0, 0, 1322, 0, 0, 0, 0, - 0, 0, 1323, 0, 0,16819, 0, 665, 0, 887, - 0, 0, 0, 0, 0, 867, 0,17402,17440, 0, - 0, 0, 0, 0, 0, 0, 0, 1368, 0, 1421, - 0, 0, 0, 891, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 593, 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,17554,16317,17254, 0, 593, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1252, 1252, 0, 0, 0, 0, 0, 0, 0, + protected static readonly short [] yyRindex = { 3016, + 0, 0, 7506, 3016, 0, 0, 0, 1718, 0, 0, + 3202, 1926, 0, 0, 0, 0, 0, 3202, 0, 0, + 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1725, 0, 0, 1725, 0, 0, 1725, 0, 0, + 1718, 3245, 3085, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1359, 0, 0, 0, 0, 0, 0, 0, + 0,10104, 0, 1352, 0, 0, 0, 1352, 0, 0, + 0, 0, 0, 0, 311, 0, 0, 0, 0, 0, + 0, 0, 0, 292, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 4787, 0, 0, 0, + 0, 0, 0, 345, 4880, 4222, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 5036, + 5104, 1033, 5577, 5917, 6121, 6257, 1476, 6461, 6597, 4967, + 3954, 0, 0, 0, 0, 0, 0, 43, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 303, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 3308, + 0, 687, 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, 1725, 0, 0, 92, 0, 0, 0, + 0, 0, 0, 3355, 604, 3422, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 3833, + 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, 0, 0, 0, 0, 0, 1361, 0, + 0, 0, 0, 0, 0, 3833, 1354, 0, 0, 0, + 0, 0, 0, 1354, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2334, 0, 1262, 955, 2464, 0, + 0, 0, 2594, 2464, 0, 0, 0, 0, 0, 1359, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 205, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1362, 2698, 0, 0, 1352, 0, 3833, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 243, 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, 0, 0, 0, 0, 0, 0, 1581, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 635, 0, 0, 0, 0, 0, 0, + 0, 3465, 3508, 0, 0, 0, 0, 2188, 1725, 1725, + 0, 7994, -184, 0, 1725, 1731, 0, 0, 180, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 511,16578, 0, 0, + 0, 0, 3833, 0, 0, 0, 0, 0, 0, 0, + 0,16967, 0, 0, 0, 0, 0, 0, 0, 773, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 268, + 1489, 0, 0, -235, 1792, 0, 0, 1367, 602, 0, + 0, 0, 0, 210, 0, 0, 4310, 1366, 0, 0, + 0, 934, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1373, 0, 1752, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1362, 0, 0, + 0,16157, 3833, 0, 6716, 0, 228, 0, 0, 0, + 0, 0, 0,16157, 0, 0, 0, 0, 0, 0, + 26, 0, 852, 0, 0, 0, 1369, 0, 0, 0, + 0, 1354, 0, 0, 0, 3674, 0, 3833, 3674, 0, + 3833, 4469, 0, 0, 0, 0, 0, -208, 0, 0, + 0, 0, 286, 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, 5208, 0, + 5276, 0, 0, 5425, 0, 5509, 0, 5645, 0, 5713, + 0, 5781, 0, 5849, 0, 5985, 0, 6053, 0, 6189, + 0, 6325, 0, 6393, 0, 6529, 0, 6653, 0, 0, + 638, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 635, 0, 0, 0, 0, 2188, 0, + 0, 0, 0,17241, 0, 0, 844, 0, 0, 1325, +14364, 0, 0, 0, 0, 0, 0, 0, 749, 683, + 0, 0, 1372, 0, 0, 0, 0, 2953, 0, 0, + 0, 0, 0, 0,10244, 0, 0, 0, 843, 0, + 0, 0,17291,17114, 0, 0, 860, 863, 885, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 774, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1377, 0, + 0, 0, 0, 0, 3740, 0, 0, 236, 0, 112, + 3992, 0, 0, 0, 0, 0, 0, 0, 1374, 0, + 0, 0, 0, 0, 1379, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 369, 608, 0, 0, + 0, 0, 0, 1376, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,16157, + 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, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 649, 0, 0, 0, 0, 0, 0, + 0, 0, -179, 0, 505, 0, 0, 0, 0, 0, + 0, 0,17291, 0, 0, 0, 0, -184, 0, 8151, + 0, 0, 1380, 0, 784, 0, 0, 0, 0, 1382, + 0, 1333, 1335, 0, 0, 0, 0, 0, 1381,17315, + 0, 0, 0, 0,17146, 0, 0, 0, 886, 0, + 0, 0, 0, 0, 0, 2062, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4151, 0, 4628, 1387, 0, 0, 0, 0, 1384, 0, + 0, 0, 0, 0, 321, 0, 0, 0, 0, 886, + 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, 659, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 889, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1383, 0, 0, 0, 0, 0, 897, 904, + 0, 0, 0, 0, 0, 0, 0, 1386, 730, 1388, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 4310, 0, 0, 0, 0, 0, 1392, 0, + 0, 0, 321, 0, 0, 959, 0, 1386, 0, 0, + 0,16157, 0, 656, 694, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1372, 0,14203, 0, 0, 0, 0, 0,17366, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 791, 0, 809, 0, 0, 0, 0, 991, 0, 813, + 1394, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1395, 0, 0, 0, 0, 196, 0, 0, 0, + 0,16157, 0, 0, 0, 0, 0, 0, 0, 360, + 543, 0, 0, 0, 0, 0,17409,16967, 0, 232, + 473, 513, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -152, 0, 0, 966, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,17495, 0, -215,16967, 0, 531, 1412, + 0, 1412, 0, 473, 0, 0, 0, 0, 0, 0, + 1408, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,17538, 0, 0, 0,14667, 0, 0, 1421, 0, + 0, 0, 494, 0, 0, 0, 0, 536, 0, 0, + 1412, 0, 0, 0, 0, 0, 1418, 0, 0, 0, + 0, 0, 0, 0, 3159, 1415, 539, 0, 0, -16, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1424, 0, 0, 0, 0, 0, 0, 0, 0, 2867, + 0, 0, 1366, 0, 0,14469,14753, 0, 0, 0, + 748, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 446, 0, 0,16749, 0, 0,14568, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,16817, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,14847, 0, 0, 0, 0, 0, 748, + 0, 0, 0, 0, 0, 511, 0, 0, 0, 0, + 0, 0, 511, 0, 0,14469, 0, 0, 0, 0, + 0, 0, 0, 0, 0,14959, 518, 0,14889, 0, + 0, 0,15021, 0, 2867, 0, 0, 0, 0, 2867, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 395, 0, 1429, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 869, + 0, 697, 0, 0, 0, 0, 0, 0, 0,16967, + 907, 0, 0, 0, 0, 0, 0, 1441, 0, 174, + 0, 0, 0, 0, 2867, 0, 0, 922, 0, 0, + 0, 0, 0, 0, 0, 0, 1440, 0,16967,16967, + 0,16999, 0, 0, 0, 0, 0, 0, 0, 1442, +17732, 0, 1443,16967,16293, 1445,16967, 0, 0, 0, + 0, 0, 0, 1457, 0, 0, 0, 1238, 0, 0, + 0,16967, 0, 0, 0, 1458, 0, 0, 179, 0, +17656,17694, 0, 0, 0, 1459, 0, 0, 0, 0, + 0, 0, 1460, 0, 0,16967, 0, 585, 0, 933, + 0, 0, 0, 0, 0, 972, 0,17580,17618, 0, + 0, 0, 0, 0, 0, 0, 0, 1447, 0, 1534, + 0, 0, 0, 947, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 568, 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, 1238,16465,17452, 0, 568, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1366, 1366, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; protected static readonly short [] yyGindex = { 0, - 0, 1641, 0, 0, 0, 1, -15, -178, -41, -38, - 0, 1688, 1698, 342, 0, 8, 0, 0, 0, 0, - 0, 0, -974, -741, -214, -550, 0, 0, 0, 0, - 0, -220, 0, 0, 0, 701, 0, 807, 0, 0, - 0, 0, 551, 552, -17, -230, 0, -46, 0, -562, - 385, 0, 415, -615, -587, -568, -567, -540, -527, -526, - -525, 0,-1102, 0,-1230, 0, 13, 0, 85, 0, --1142, 0, 0, 0, -79, 199, 0, 0, 0, 237, --1120, 0, -269, -297, -350, 0, 0, 0, -945, 185, - 0, 0, -516, 0, 0, 255, 0, 0, 222, 0, - 0, 257, 0, -607, -853, 0, 0, 0, 0, 0, - -534, -10, 0, 0, 799, 802, 804, 987, -548, 0, - 0, -314, 812, 357, 0,-1412, 0, 0, 0, 0, - 0, 0, 0, 0, 156, 0, 0, 0, 0, 0, - 0, 0, 0, 409, 0, 0, 0, 0, -302, 340, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -523, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 170, 0, 0, 253, 0, 0, 264, 267, 187, - 0, 0, 0, 0, 0, 0, 0, 0, 495, 0, - 0, 0, 0, -45, 0, 403, -56, 0, 0, 330, - 0, -515, 0, 876, 0, 1204, -288, -268, -61, 905, - 0, 502, 0, -33, 188, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -257, 0, 1435, 0, -349, 0, - -271, 0, 0, 0, 815, 821, -301, -126, 989, 0, - 897, 0, 1147, 1384, 1033, 0, 0, 713, 1699, 0, - 0, 0, 0, 1006, 0, 0, 0, 0, 0, -483, - 1432, 0, 0, 0, 0, 0, 1238, 871, 872, 763, - 874, 1361, 1363, 1360, 1364, 1365, 0, 1367, 0, 0, - 0, 946, 1216, -546, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -299, 0, 0, 0, 0, -461, - 0, 555, 0, 463, 0,-1121, 0, 0, 0, 0, - 0, 661, -538, -16, -319, -13, 0, 1638, 0, 57, - 0, 58, 68, 111, 142, 147, 163, 195, 200, 204, - 247, 0, -712, 0, -24, 0, 0, 756, 0, 678, - 0, 0, 0, 0, 655, -246, 734, -884, 0, 776, - -472, 0, 0, 0, 0, 0, 0, 672, 0, 673, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 600, 0, 0, 0, 0, - 0, 0, 0, 0, -30, 0, 1264, 0, 0, 0, - 845, 0, 0, 0, 0, 0, 0, -172, 0, 0, - 0, 0, 0, 1373, 1136, 0, 0, 0, 0, 1375, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 488, - 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, - 0, 0, 0, 0, 0, -7, 922, 0, 0, 0, - 925, + 0, 1766, 0, 0, 0, -3, -15, -181, -41, -34, + 0, 1826, 1834, 342, 0, 4, 0, 0, 0, 0, + 0, 0,-1219, -767, -229, -675, 0, 0, 0, 0, + 0, -226, 0, 0, 0, 823, 0, 936, 0, 0, + 0, 0, 671, 677, -17, -216, 0, -47, 0, -481, + 478, 0, 527, -699, -582, -579, -561, -530, -509, -506, + -504, 0,-1153, 0,-1274, 0, 14, 0, 0, 0, + 632,-1183, 0, 0, 0, -14, 315, 0, 0, 0, + 353,-1146, 0, -280, -300, -527, 0, 0, 0, -972, + 305, 0, 0, -532, 0, 0, 373, 0, 0, 346, + 0, 0, 379, 0, -660, -858, 0, 0, 0, 0, + 0, -435, -10, 0, 0, 937, 945, 949, 1118, -570, + 0, 0, -305, 964, 470, 0, -892, 0, 0, 0, + 0, 0, 0, 0, 0, 270, 0, 0, 0, 0, + 0, 0, 0, 0, 521, 0, 0, 0, 0, -290, + 462, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 545, 0, -523, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 299, 0, 0, 380, 0, 0, 383, 388, + 306, 0, 0, 0, 0, 0, 0, 0, 0, 620, + 0, 0, 0, 0, -69, 0, 316, -24, 0, 0, + 454, 0, -424, 0, 999, 0, 1355, -299, -274, -62, + 909, 0, 625, 0, -35, 165, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -259, 0, 37, 0, -355, + 0, -275, 0, 0, 0, 958, 960, -306, -128, 1131, + 0, 1042, 0, 1313, 1535, 1191, 0, 0, 849, 1869, + 0, 0, 0, 0, 1163, 0, 0, 0, 0, 0, + -516, 1605, 0, 0, 0, 0, 0, 1390, 939, 929, + 792, 944, 1528, 1531, 1527, 1537, 1539, 0, 1572, 0, + 0, 0, 1151, 1420, -562, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -307, 814, 0, -681, 0, + 0, 0, 0, 0, -475, 0, 745, 0, 637, 0, + 715, 0, 0, 0, 0, 0, 858, -559, -11, -329, + -1, 0, 1847, 0, 48, 0, 56, 73, 81, 83, + 125, 160, 167, 182, 207, 252, 0, -716, 0, 2, + 0, 0, 952, 0, 873, 0, 0, 0, 0, 850, + -927, 926, -919, 0, 978, -493, 0, 0, 0, 0, + 0, 0, 881, 0, 870, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 803, 0, 0, 0, 0, 0, 0, 0, 0, -42, + 0, 1481, 0, 836, 0, 0, 1058, 0, 0, 0, + 0, 0, 0, -175, 0, 0, 0, 0, 0, 1602, + 1344, 0, 0, 0, 0, 1603, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 689, 0, 0, 0, 0, + 0, 0, 0, 0, 810, 0, 0, 0, 0, 0, + 0, 19, 1154, 0, 0, 0, 1155, }; - protected static readonly short [] yyTable = { 109, - 155, 532, 189, 156, 18, 784, 111, 328, 333, 233, - 446, 535, 234, 485, 790, 445, 489, 464, 43, 507, - 730, 293, 321, 553, 578, 258, 530, 192, 369, 528, - 419, 752, 564, 621, 259, 835, 834, 1075, 516, 229, - 327, 332, 1201, 1012, 839, 339, 312, 252, 930, 949, - 931, 377, 593, 385, 524, 304, 1234, 1235, 249, 311, - 678, 559, 1332, 846, 594, 373, 362, 376, 313, 384, - 316, 1129, 249, 160, 161, 498, 14, 345, 996, 757, - 1341, 1111, 289, 1130, 162, 846, 51, 852, 460, 424, - 290, 190, 315, 1223, 315, 1542, 1543, 723, 51, 961, - 866, 999, 963, 1080, 250, 1267, 836, 580, 1113, 905, - 1397, 1399, 326, 1031, 363, 16, 347, 869, 1405, 453, - 454, 1261, 874, 875, 862, 421, 416, 163, 347, 1130, - 830, 347, 347, 906, 449, 404, 405, 364, 417, 109, - 155, 231, 425, 156, 713, 347, 111, 233, 837, 1223, - 447, 489, 1575, 251, 679, 1, 890, 895, 164, 499, - 907, 996, 51, 165, 581, 525, 996, 526, 996, 250, - 714, 996, 996, 250, 996, 996, 678, 291, 678, 166, - 796, 42, 495, 94, 999, 846, 291, 250, 291, 999, - 463, 999, 260, 447, 999, 999, 996, 999, 999, 487, - 490, 853, 715, 94, 115, 734, 6, 250, 505, 250, - 51, 167, 494, 160, 161, 455, 168, 362, 251, 999, - 169, 527, 251, 776, 162, 867, 485, 376, 538, 488, - 782, 464, 292, 678, 1080, 493, 251, 1131, 15, 846, - 461, 292, 863, 292, 805, 1394, 115, 932, 1516, 515, - 115, 996, 258, 191, 593, 578, 251, 2, 251, 724, - 552, 503, 258, 170, 556, 363, 594, 163, 449, 561, - 1114, 506, 1398, 1400, 999, 1540, 510, 512, 969, 1584, - 1406, 558, 578, 1131, 584, 560, 563, 1550, 364, 1551, - 594, 539, 363, 337, 551, 1285, 1264, 374, 164, 548, - 1012, 550, 365, 165, 1195, 510, 716, 549, 760, 864, - 1413, 449, 261, 328, 2, 364, 603, 566, 567, 166, - 643, 645, 362, 3, 4, 5, 6, 577, 606, 1208, - 579, 609, 1126, 1273, 376, 490, 490, 1068, 1373, 826, - 601, 376, 1448, 376, 115, 376, 1534, 1019, 682, 684, - 1153, 167, 1512, 600, 1012, 762, 168, 941, 1253, 1547, - 169, 792, 197, 51, 488, 618, 1029, 20, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 291, - 794, 681, 683, 1056, 700, 687, 917, 1374, 1393, 376, - 94, 891, 1292, 197, 1395, 697, 1561, 20, 811, 1585, - 677, 814, 594, 170, 233, 362, 1375, 447, 374, 374, - 374, 1548, 374, 374, 701, 374, 1265, 374, 48, 1037, - 1085, 1426, 194, 805, 761, 1414, 1581, 1081, 865, 1083, - 731, 1059, 1088, 362, 292, 338, 54, 362, 1478, 362, - 362, 362, 362, 1419, 1505, 698, 699, 362, 1209, 922, - 94, 711, 1274, 738, 1043, 695, 750, 741, 758, 374, - 1207, 374, 1039, 6, 374, 1535, 1012, 1449, 1212, 717, - 370, 763, 1012, 115, 1066, 942, 1254, 793, 691, 751, - 426, 485, 490, 691, 199, 291, 748, 691, 400, 194, - 194, 196, 1237, 362, 831, 200, 795, 231, 797, 231, - 804, 938, 691, 489, 813, 231, 115, 976, 516, 779, - 194, 618, 291, 788, 812, 1086, 884, 815, 371, 1146, - 485, 1148, 1118, 1149, 401, 593, 1143, 426, 885, 691, - 352, 115, 796, 798, 449, 1038, 1420, 594, 739, 816, - 292, 363, 1557, 291, 818, 838, 797, 1278, 691, 848, - 1558, 231, 850, 851, 803, 832, 1436, 231, 577, 244, - 827, 579, 939, 427, 364, 726, 231, 957, 428, 727, - 429, 827, 859, 430, 431, 738, 432, 433, 365, 372, - 94, 1138, 500, 1139, 250, 577, 1466, 1467, 579, 1469, - 501, 450, 231, 452, 451, 1182, 854, 854, 604, 1027, - 1488, 194, 194, 1495, 402, 403, 465, 797, 605, 466, - 427, 1559, 594, 362, 1022, 428, 291, 429, 1511, 739, - 430, 431, 1214, 432, 433, 453, 248, 928, 291, 860, - 728, 369, 978, 251, 796, 871, 738, 873, 834, 883, - 776, 352, 1533, 502, 362, 352, 881, 347, 123, 943, - 123, 937, 1245, 434, 452, 123, 785, 362, 263, 449, - 1313, 363, 779, 465, 194, 929, 466, 779, 779, 691, - 877, 607, 792, 340, 1376, 1058, 1054, 369, 792, 340, - 739, 608, 1154, 1064, 364, 94, 453, 490, 1314, 352, - 194, 115, 363, 374, 535, 888, 689, 347, 365, 1280, - 444, 245, 194, 347, 924, 246, 1313, 1315, 1316, 347, - 194, 785, 347, 347, 690, 364, 488, 952, 1327, 515, - 689, 691, 320, 1377, 1294, 1312, 347, 792, 340, 365, - 331, 510, 258, 752, 1314, 1317, 331, 889, 690, 904, - 966, 556, 1122, 332, 689, 1294, 788, 689, 1318, 1319, - 1320, 1164, 779, 1315, 1316, 247, 971, 782, 347, 958, - 363, 796, 115, 1165, 1401, 690, 194, 543, 362, 194, - 710, 1312, 362, 1294, 347, 362, 1099, 362, 1415, 631, - 717, 1317, 362, 364, 799, 711, 410, 411, 953, 115, - 374, 542, 972, 1119, 1318, 1319, 1320, 365, 710, 964, - 1434, 965, 194, 194, 543, 320, 375, 250, 717, 378, - 490, 970, 967, 711, 827, 578, 490, 717, 1049, 320, - 334, 544, 1119, 1386, 946, 448, 1090, 427, 379, 380, - 194, 194, 428, 1386, 429, 363, 1030, 430, 431, 618, - 432, 433, 1390, 412, 586, 618, 701, 982, 381, 788, - 194, 587, 1390, 1077, 484, 231, 251, 578, 364, 382, - 1174, 1078, 631, 588, 194, 1022, 413, 631, 990, 631, - 631, 631, 631, 631, 631, 631, 631, 631, 631, 631, - 741, 94, 586, 804, 914, 804, 374, 804, 414, 587, - 1364, 631, 779, 631, 506, 631, 1204, 631, 631, 631, - 697, 588, 450, 691, 717, 1062, 450, 1065, 691, 882, - 44, 1044, 691, 1067, 1011, 320, 1046, 690, 374, 1046, - 94, 113, 415, 578, 730, 1099, 992, 691, 779, 1421, - 788, 352, 1103, 1236, 954, 352, 908, 347, 352, 1076, - 352, 1250, 231, 909, 1499, 352, 94, 320, 115, 806, - 115, 990, 631, 418, 691, 1284, 990, 714, 990, 713, - 490, 990, 990, 113, 990, 990, 714, 113, 713, 406, - 407, 194, 779, 691, 779, 347, 1108, 779, 347, 352, - 297, 1358, 1112, 408, 409, 807, 986, 1336, 1337, 1098, - 1368, 331, 331, 807, 340, 194, 1338, 340, 426, 115, - 808, 485, 115, 464, 808, 225, 1552, 883, 808, 992, - 456, 717, 331, 1329, 992, 1218, 992, 364, 456, 992, - 992, 788, 992, 992, 510, 452, 1105, 804, 1106, 1361, - 1107, 278, 278, 804, 459, 804, 347, 288, 1361, 288, - 278, 990, 347, 1572, 288, 486, 521, 578, 347, 512, - 522, 651, 347, 651, 337, 512, 69, 69, 1590, 1591, - 69, 113, 827, 535, 779, 347, 779, 508, 779, 986, - 225, 1150, 226, 176, 986, 176, 986, 176, 509, 986, - 986, 427, 986, 986, 531, 189, 428, 189, 429, 189, - 536, 430, 431, 375, 432, 433, 225, 347, 228, 992, - 1157, 733, 824, 331, 331, 734, 824, 194, 824, 490, - 824, 767, 506, 777, 537, 768, 813, 522, 577, 741, - 813, 579, 813, 296, 813, 297, 1183, 788, 194, 347, - 347, 827, 347, 347, 62, 925, 945, 540, 1098, 926, - 946, 1194, 871, 875, 541, 506, 871, 875, 506, 70, - 996, 997, 233, 70, 1221, 447, 557, 1222, 807, 986, - 577, 562, 807, 579, 1187, 1188, 331, 779, 655, 657, - 659, 661, 1074, 1217, 863, 1022, 233, 1562, 1563, 447, - 397, 398, 399, 570, 1155, 506, 1156, 1032, 598, 1032, - 113, 599, 331, 815, 1289, 815, 364, 779, 1150, 194, - 164, 610, 164, 796, 331, 941, 347, 941, 347, 796, - 1221, 693, 331, 1222, 732, 171, 796, 171, 172, 72, - 172, 72, 194, 113, 536, 536, 577, 347, 347, 579, - 691, 691, 115, 1293, 1311, 195, 1222, 195, 194, 165, - 368, 165, 194, 696, 779, 1199, 1200, 347, 113, 712, - 128, 1289, 128, 759, 1293, 347, 735, 1222, 347, 294, - 135, 294, 135, 779, 301, 506, 301, 737, 331, 1371, - 1372, 331, 647, 649, 764, 651, 653, 765, 1345, 766, - 1311, 817, 1293, 663, 665, 1222, 810, 819, 821, 820, - 822, 840, 841, 844, 1404, 845, 847, 1407, 857, 194, - 449, 858, 849, 513, 331, 331, 425, 870, 425, 513, - 872, 876, 892, 893, 450, 42, 897, 194, 194, 896, - 900, 918, 115, 196, 1366, 919, 1412, 425, 425, 912, - 343, 920, 331, 331, 347, 349, 351, 353, 355, 357, - 359, 361, 921, 1412, 927, 944, 947, 425, 950, 863, - 577, 948, 955, 579, 959, 425, 960, 968, 425, 991, - 115, 1444, 974, 1445, 115, 986, 993, 1006, 115, 998, - 1000, 741, 1007, 1009, 1010, 1012, 1015, 1017, 1023, 1035, - 1422, 1036, 1045, 1039, 801, 194, 1053, 525, 1101, 1060, - 1071, 1072, 115, 24, 1091, 25, 1115, 1125, 26, 1109, - 1116, 741, 741, 27, 741, 1117, 194, 28, 113, 1479, - 1127, 1137, 1144, 1141, 194, 741, 30, 1145, 741, 1159, - 1147, 1167, 1168, 32, 1163, 1166, 1506, 1169, 33, 1171, - 115, 1175, 34, 741, 1172, 1179, 1186, 1190, 1189, 1518, - 1520, 1197, 1220, 788, 36, 1202, 37, 115, 1366, 1210, - 38, 331, 1230, 1213, 1244, 506, 1247, 741, 39, 40, - 386, 1252, 41, 1260, 1249, 802, 1506, 1506, 1255, 1268, - 1263, 1270, 1528, 331, 1275, 1276, 1277, 1283, 1279, 113, - 1284, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 291, 1325, 1328, 1333, 262, 1347, 331, 629, 286, - 287, 288, 1330, 294, 295, 788, 113, 1331, 308, 309, - 1342, 1370, 1378, 1392, 1417, 317, 1409, 319, 1410, 323, - 1425, 1428, 1430, 1506, 335, 336, 1431, 1433, 1435, 1418, - 1420, 1439, 1400, 1441, 1437, 490, 490, 1442, 1447, 343, - 1452, 1455, 788, 1459, 1458, 1489, 325, 1470, 383, 1460, - 1462, 1471, 1500, 1503, 115, 1577, 1577, 1474, 1484, 1491, - 1504, 1510, 1586, 1586, 618, 618, 1501, 1513, 1514, 1525, - 1527, 565, 1530, 1524, 1532, 1538, 1545, 1549, 1529, 343, - 912, 629, 1553, 1556, 1554, 1564, 629, 1565, 629, 629, - 629, 629, 629, 629, 629, 629, 629, 629, 629, 194, - 1548, 1547, 1570, 1571, 1592, 1593, 1594, 9, 1028, 331, - 629, 552, 629, 507, 629, 910, 629, 629, 629, 911, - 653, 1020, 508, 465, 654, 725, 33, 506, 33, 466, - 331, 323, 629, 532, 637, 639, 641, 34, 817, 565, - 565, 565, 565, 565, 565, 565, 565, 565, 565, 565, - 565, 565, 565, 565, 565, 34, 194, 818, 216, 103, - 809, 583, 876, 841, 842, 113, 877, 113, 921, 713, - 24, 629, 25, 347, 327, 26, 194, 878, 738, 880, - 27, 354, 691, 691, 28, 713, 347, 131, 113, 317, - 230, 297, 383, 30, 138, 132, 114, 298, 139, 53, - 32, 331, 21, 1005, 1092, 33, 1192, 1193, 1344, 34, - 1334, 1546, 1515, 1555, 1531, 1497, 113, 1032, 1502, 113, - 1033, 36, 1034, 37, 331, 1028, 915, 38, 1402, 1588, - 1343, 1424, 529, 194, 194, 39, 40, 1580, 1526, 41, - 331, 465, 324, 194, 331, 1521, 1271, 1519, 547, 1446, - 807, 194, 194, 1579, 194, 1272, 1052, 1050, 936, 979, - 1389, 856, 565, 1001, 466, 612, 911, 1128, 568, 299, - 1389, 933, 667, 671, 1389, 669, 194, 467, 673, 194, - 675, 468, 469, 676, 824, 973, 1257, 470, 1389, 471, - 472, 473, 474, 1348, 420, 1177, 1121, 475, 1170, 1184, - 1110, 476, 1140, 38, 1176, 1241, 1069, 1178, 800, 691, - 1389, 692, 1246, 477, 1346, 1003, 478, 1002, 479, 331, - 331, 0, 0, 368, 0, 0, 880, 0, 0, 0, - 0, 0, 0, 0, 0, 843, 912, 912, 0, 0, - 0, 0, 480, 0, 912, 912, 912, 912, 912, 0, - 912, 912, 0, 912, 912, 912, 912, 912, 912, 912, - 912, 0, 0, 0, 0, 912, 0, 912, 912, 912, - 912, 912, 912, 0, 0, 912, 0, 0, 0, 912, - 912, 0, 912, 912, 912, 0, 0, 331, 0, 0, - 0, 0, 0, 0, 912, 0, 912, 0, 912, 912, - 0, 0, 912, 0, 912, 912, 912, 912, 912, 912, - 912, 912, 912, 912, 912, 912, 331, 912, 0, 0, - 912, 912, 0, 0, 912, 912, 0, 0, 0, 347, - 0, 0, 0, 749, 0, 347, 0, 0, 0, 912, - 912, 912, 912, 912, 0, 0, 0, 912, 912, 113, - 0, 912, 0, 0, 0, 0, 912, 912, 912, 912, - 912, 0, 0, 517, 912, 0, 912, 0, 0, 0, - 0, 347, 912, 912, 0, 0, 0, 797, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 912, 912, 912, - 912, 0, 912, 0, 0, 0, 343, 0, 0, 912, - 0, 0, 347, 0, 0, 0, 0, 347, 0, 347, - 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, - 347, 0, 0, 0, 0, 0, 347, 0, 0, 113, - 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, - 0, 347, 347, 0, 0, 347, 347, 347, 347, 347, - 38, 0, 347, 347, 38, 0, 0, 347, 347, 347, - 347, 347, 347, 347, 347, 38, 0, 113, 0, 0, - 38, 113, 0, 0, 38, 113, 347, 38, 0, 347, - 0, 347, 0, 347, 614, 0, 347, 0, 0, 38, - 38, 331, 347, 0, 38, 38, 0, 0, 0, 113, - 38, 0, 38, 38, 38, 38, 0, 0, 0, 0, - 38, 0, 0, 0, 38, 0, 38, 0, 0, 0, - 0, 835, 0, 0, 0, 0, 38, 0, 38, 38, - 0, 38, 0, 0, 0, 38, 0, 113, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 331, 0, - 0, 0, 0, 0, 113, 38, 0, 0, 0, 0, - 0, 38, 38, 0, 0, 0, 0, 614, 331, 565, - 0, 0, 614, 0, 614, 614, 614, 614, 614, 614, - 614, 614, 614, 614, 614, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 614, 0, 614, 0, - 614, 0, 614, 614, 614, 0, 0, 0, 0, 517, - 0, 0, 614, 614, 517, 517, 0, 614, 614, 0, - 0, 0, 0, 0, 0, 331, 331, 0, 614, 614, - 0, 0, 0, 0, 0, 331, 0, 517, 0, 0, - 0, 614, 0, 331, 331, 0, 331, 347, 0, 0, - 517, 517, 0, 0, 0, 517, 0, 614, 517, 0, - 517, 113, 517, 517, 517, 517, 0, 0, 331, 0, - 517, 331, 0, 0, 517, 0, 0, 0, 517, 0, - 0, 0, 0, 0, 0, 0, 517, 0, 0, 517, - 0, 517, 517, 0, 0, 0, 0, 517, 0, 517, - 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, - 0, 0, 0, 0, 0, 517, 517, 0, 0, 0, - 517, 517, 0, 517, 517, 517, 517, 517, 517, 517, - 0, 517, 517, 0, 517, 517, 517, 517, 517, 517, - 517, 517, 517, 517, 0, 517, 517, 517, 517, 517, - 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, - 517, 517, 517, 517, 517, 517, 517, 0, 0, 517, - 0, 517, 0, 517, 0, 0, 517, 835, 835, 0, - 0, 0, 517, 0, 0, 835, 835, 835, 835, 835, - 0, 835, 835, 793, 835, 835, 835, 835, 835, 835, - 835, 0, 0, 0, 0, 0, 835, 0, 835, 835, - 835, 835, 835, 835, 0, 0, 835, 0, 0, 0, - 835, 835, 0, 835, 835, 835, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 835, 0, 835, 0, 835, - 835, 0, 0, 835, 0, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 0, 835, 0, - 0, 835, 835, 0, 0, 835, 835, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 835, 835, 835, 835, 835, 0, 0, 0, 835, 835, - 0, 0, 835, 0, 0, 0, 0, 835, 835, 835, - 835, 835, 0, 347, 0, 835, 0, 835, 347, 347, - 0, 0, 0, 835, 835, 0, 0, 0, 0, 0, + protected static readonly short [] yyTable = { 110, + 18, 541, 190, 544, 470, 156, 112, 804, 452, 491, + 235, 513, 743, 451, 798, 157, 765, 236, 562, 44, + 590, 296, 324, 193, 261, 539, 537, 850, 1094, 425, + 573, 851, 495, 633, 855, 315, 1226, 965, 1260, 525, + 330, 335, 1029, 1148, 382, 342, 390, 684, 254, 846, + 1366, 383, 911, 391, 862, 1149, 307, 946, 568, 947, + 314, 262, 1247, 229, 161, 379, 231, 605, 1373, 316, + 770, 319, 162, 331, 336, 251, 1013, 1289, 351, 14, + 1316, 318, 606, 882, 1130, 191, 1099, 1087, 506, 163, + 1404, 362, 1297, 736, 375, 20, 507, 164, 265, 165, + 1149, 878, 289, 290, 291, 1132, 297, 298, 1427, 51, + 979, 311, 312, 981, 251, 861, 1577, 552, 320, 852, + 322, 51, 326, 1429, 726, 427, 1247, 338, 339, 1435, + 1138, 592, 516, 380, 814, 1587, 368, 318, 516, 1405, + 110, 166, 900, 1588, 95, 533, 156, 112, 235, 508, + 727, 389, 326, 1396, 692, 453, 157, 1, 2, 1013, + 1138, 853, 323, 684, 1013, 684, 1013, 455, 1578, 1013, + 1013, 495, 1013, 1013, 957, 1424, 167, 294, 263, 6, + 1425, 116, 728, 168, 369, 459, 460, 369, 593, 197, + 252, 294, 469, 516, 1013, 1614, 252, 880, 169, 453, + 493, 496, 51, 340, 1589, 161, 1478, 370, 883, 1150, + 370, 885, 1057, 162, 500, 861, 890, 891, 1099, 879, + 684, 371, 470, 170, 116, 95, 491, 790, 116, 252, + 163, 494, 295, 51, 1546, 1477, 796, 499, 164, 253, + 165, 15, 461, 467, 948, 253, 295, 192, 95, 1013, + 501, 524, 252, 261, 1150, 737, 534, 590, 535, 2, + 252, 1570, 561, 261, 569, 820, 565, 1133, 171, 861, + 1428, 570, 605, 1580, 512, 1581, 511, 987, 253, 516, + 518, 376, 166, 567, 590, 1430, 729, 606, 572, 294, + 509, 1436, 958, 320, 548, 1233, 547, 389, 264, 1029, + 583, 253, 557, 455, 559, 292, 95, 1294, 516, 253, + 558, 16, 536, 293, 606, 1615, 881, 167, 1304, 1215, + 575, 576, 116, 560, 168, 3, 4, 5, 6, 580, + 581, 1479, 868, 618, 613, 195, 621, 538, 589, 169, + 496, 496, 466, 1173, 295, 341, 1145, 362, 591, 455, + 1564, 328, 1282, 556, 615, 596, 1542, 406, 1251, 612, + 1047, 810, 198, 504, 170, 773, 775, 1029, 20, 739, + 494, 630, 806, 740, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 1591, 694, 696, 376, 808, + 700, 655, 657, 407, 198, 376, 1104, 376, 247, 376, + 294, 51, 248, 195, 195, 49, 690, 826, 901, 171, + 235, 1406, 751, 432, 1234, 1611, 829, 453, 1055, 695, + 697, 720, 606, 1443, 195, 841, 719, 1295, 721, 362, + 362, 1077, 933, 710, 741, 43, 6, 1305, 1324, 1508, + 252, 705, 1535, 376, 1037, 55, 869, 505, 820, 1061, + 747, 705, 249, 116, 938, 295, 705, 708, 362, 1085, + 705, 763, 362, 771, 362, 362, 362, 362, 744, 1565, + 1283, 730, 362, 408, 409, 705, 1232, 711, 712, 1029, + 1074, 774, 776, 724, 1236, 1029, 116, 936, 807, 253, + 496, 1105, 761, 705, 491, 376, 433, 752, 1221, 1449, + 847, 434, 705, 435, 200, 809, 436, 437, 819, 438, + 439, 764, 828, 1263, 116, 195, 195, 994, 793, 525, + 630, 705, 802, 827, 1137, 233, 1100, 491, 1102, 1163, + 495, 1107, 830, 954, 1056, 294, 95, 1255, 1444, 233, + 362, 762, 813, 377, 362, 233, 347, 362, 831, 362, + 605, 233, 233, 833, 362, 233, 854, 812, 845, 818, + 875, 848, 936, 936, 422, 606, 369, 1158, 368, 1159, + 693, 842, 753, 1309, 294, 589, 423, 453, 455, 294, + 195, 1465, 944, 842, 368, 591, 440, 530, 811, 370, + 616, 531, 1450, 864, 955, 754, 866, 867, 693, 1202, + 617, 201, 589, 454, 378, 812, 195, 1345, 870, 870, + 1496, 1497, 591, 1499, 466, 1016, 369, 876, 195, 1166, + 945, 1168, 953, 1169, 1045, 1518, 195, 1040, 1525, 295, + 1326, 1344, 369, 753, 619, 812, 294, 850, 453, 370, + 606, 812, 432, 1541, 620, 1572, 1573, 887, 812, 889, + 352, 790, 1326, 371, 1345, 370, 754, 467, 897, 195, + 195, 959, 996, 294, 454, 800, 812, 1563, 252, 371, + 904, 466, 1217, 807, 116, 793, 1218, 347, 1344, 807, + 793, 793, 905, 893, 899, 195, 1072, 1076, 195, 347, + 225, 975, 347, 347, 430, 921, 812, 702, 1016, 496, + 1326, 544, 1605, 1016, 455, 1016, 347, 340, 1016, 1016, + 368, 1016, 1016, 340, 467, 1407, 940, 253, 1083, 922, + 800, 195, 195, 1238, 1346, 433, 1049, 1347, 807, 494, + 434, 524, 435, 1016, 233, 436, 437, 765, 438, 439, + 369, 811, 1431, 261, 516, 1348, 923, 431, 1174, 195, + 195, 116, 1141, 920, 233, 565, 1445, 1273, 369, 802, + 1007, 352, 340, 908, 1408, 352, 793, 347, 123, 195, + 123, 1346, 796, 976, 1347, 123, 1349, 1463, 116, 1317, + 433, 370, 703, 195, 732, 434, 369, 435, 1016, 704, + 436, 437, 1348, 438, 439, 371, 969, 1350, 1009, 369, + 1351, 970, 1352, 971, 551, 909, 703, 990, 1118, 352, + 1311, 724, 732, 704, 982, 450, 983, 552, 246, 95, + 984, 732, 370, 1349, 590, 496, 988, 985, 1451, 842, + 1360, 496, 726, 703, 553, 924, 371, 989, 1390, 724, + 704, 1109, 925, 1007, 1350, 1399, 967, 1351, 1007, 1352, + 1007, 690, 454, 1007, 1007, 630, 1007, 1007, 410, 411, + 726, 630, 369, 1000, 726, 802, 720, 590, 1194, 695, + 703, 821, 746, 721, 95, 705, 747, 1184, 95, 690, + 705, 1009, 1040, 1315, 705, 370, 1009, 690, 1009, 1185, + 1019, 1009, 1009, 195, 1009, 1009, 598, 695, 930, 705, + 1269, 1270, 729, 599, 250, 1229, 331, 380, 793, 1370, + 512, 729, 331, 380, 45, 600, 730, 1048, 266, 332, + 195, 1081, 1067, 381, 1084, 114, 705, 1062, 962, 456, + 1086, 1029, 1064, 1007, 728, 1064, 323, 380, 116, 323, + 116, 743, 323, 728, 793, 705, 802, 1262, 598, 1080, + 710, 278, 278, 972, 1417, 599, 1095, 337, 1529, 1118, + 278, 590, 1096, 1417, 419, 1421, 323, 600, 114, 511, + 1097, 1009, 114, 1019, 1421, 511, 340, 496, 1019, 340, + 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, + 793, 116, 793, 1127, 116, 793, 334, 334, 456, 1131, + 418, 457, 1019, 1003, 1019, 819, 1019, 1117, 1019, 1019, + 1019, 819, 470, 819, 781, 1122, 822, 334, 782, 491, + 1582, 412, 413, 839, 822, 730, 823, 839, 195, 839, + 823, 839, 1242, 1362, 823, 414, 415, 456, 420, 802, + 898, 24, 516, 25, 432, 1124, 26, 1125, 225, 1126, + 228, 27, 69, 69, 195, 28, 69, 1602, 899, 347, + 421, 828, 347, 1019, 30, 828, 114, 828, 424, 828, + 288, 32, 288, 492, 791, 1393, 33, 288, 531, 300, + 34, 842, 1393, 793, 544, 793, 1003, 793, 1620, 1621, + 1170, 1003, 36, 1003, 37, 463, 1003, 1003, 38, 1003, + 1003, 819, 225, 819, 230, 819, 39, 40, 334, 334, + 41, 416, 417, 327, 252, 1177, 384, 458, 347, 347, + 961, 347, 347, 62, 962, 941, 195, 433, 496, 942, + 465, 512, 434, 340, 435, 385, 386, 436, 437, 294, + 438, 439, 589, 348, 886, 890, 1203, 802, 886, 890, + 195, 842, 591, 70, 299, 387, 300, 70, 1117, 540, + 176, 1214, 176, 253, 176, 512, 388, 195, 512, 490, + 233, 195, 235, 334, 1245, 1093, 1003, 879, 189, 453, + 189, 1246, 189, 514, 822, 589, 515, 793, 822, 374, + 403, 404, 405, 1241, 328, 591, 1175, 114, 1176, 334, + 235, 545, 1040, 668, 670, 672, 674, 453, 347, 381, + 512, 334, 549, 1050, 347, 1050, 830, 546, 830, 334, + 347, 793, 1170, 657, 347, 657, 550, 116, 195, 164, + 114, 164, 171, 566, 171, 352, 571, 347, 1245, 352, + 579, 347, 352, 610, 352, 1246, 195, 195, 811, 352, + 1269, 1270, 334, 334, 172, 496, 172, 958, 114, 958, + 72, 372, 72, 611, 1325, 1343, 195, 370, 195, 347, + 622, 1246, 721, 165, 793, 165, 1014, 1015, 334, 589, + 128, 334, 128, 352, 374, 630, 1325, 706, 601, 591, + 1321, 1207, 1208, 1246, 793, 294, 512, 294, 1278, 233, + 374, 374, 374, 725, 374, 374, 135, 374, 135, 374, + 1377, 347, 1343, 709, 334, 334, 195, 347, 116, 721, + 301, 748, 301, 347, 370, 463, 347, 347, 1592, 1593, + 540, 540, 940, 940, 1325, 705, 705, 195, 664, 666, + 347, 1246, 334, 334, 745, 195, 659, 661, 750, 772, + 1321, 374, 778, 374, 779, 777, 374, 116, 1398, 676, + 678, 116, 825, 832, 455, 116, 1402, 1403, 834, 780, + 835, 601, 347, 836, 837, 811, 601, 856, 601, 601, + 601, 601, 601, 601, 601, 601, 601, 601, 601, 1442, + 1434, 857, 860, 1437, 116, 863, 861, 873, 865, 874, + 601, 886, 601, 888, 601, 1442, 601, 601, 601, 892, + 902, 1452, 912, 903, 601, 601, 601, 601, 114, 456, + 916, 601, 601, 1473, 913, 1474, 601, 601, 601, 601, + 601, 601, 601, 601, 43, 928, 934, 935, 197, 1509, + 936, 937, 943, 963, 960, 601, 721, 879, 966, 964, + 973, 977, 1004, 978, 116, 116, 1536, 986, 992, 1009, + 1011, 601, 1016, 721, 334, 1024, 1019, 1025, 1028, 1548, + 1550, 1027, 1030, 802, 1033, 1035, 721, 721, 1398, 1041, + 1053, 1054, 1063, 349, 1057, 512, 334, 353, 355, 357, + 359, 361, 363, 365, 367, 114, 1536, 1536, 51, 1071, + 534, 1090, 1558, 721, 721, 1078, 1091, 1128, 1110, 1134, + 1120, 1146, 1164, 334, 1135, 1165, 1144, 372, 1136, 1156, + 1157, 51, 114, 372, 1161, 1167, 1179, 1183, 1187, 1188, + 1186, 1192, 1189, 195, 51, 802, 1191, 1195, 1199, 51, + 1206, 1209, 1210, 1218, 51, 1217, 51, 51, 51, 51, + 1227, 810, 1237, 1536, 51, 1244, 1256, 1272, 51, 372, + 721, 1280, 1275, 1277, 496, 496, 1298, 1281, 1284, 1285, + 51, 1290, 802, 51, 1293, 51, 1300, 1306, 1307, 1314, + 521, 1315, 1356, 1358, 1357, 1607, 1607, 1365, 1361, 1367, + 1374, 1364, 1616, 1616, 630, 630, 1423, 1409, 195, 51, + 372, 51, 51, 1363, 1379, 372, 1426, 372, 372, 372, + 372, 372, 372, 372, 372, 372, 372, 372, 1439, 1440, + 195, 334, 1447, 1457, 372, 1448, 1459, 1460, 372, 372, + 1466, 372, 372, 372, 1462, 372, 372, 372, 1464, 372, + 372, 1450, 1468, 372, 372, 372, 372, 334, 1430, 1470, + 372, 372, 1471, 1489, 1476, 372, 372, 372, 372, 372, + 372, 372, 372, 1485, 1488, 1482, 1492, 1490, 1519, 1500, + 1501, 1533, 1504, 202, 372, 1514, 1521, 372, 1534, 372, + 195, 195, 114, 1530, 114, 1531, 1540, 1544, 195, 1543, + 372, 1555, 1554, 1557, 349, 1559, 195, 195, 1560, 195, + 1562, 1568, 1575, 1579, 1583, 1420, 1584, 1594, 1595, 1586, + 1578, 1577, 1622, 1600, 1420, 203, 1601, 9, 1420, 334, + 195, 1623, 1624, 195, 1046, 556, 574, 925, 509, 926, + 1038, 626, 1420, 659, 510, 114, 349, 466, 114, 940, + 660, 33, 740, 334, 508, 467, 33, 536, 323, 34, + 216, 927, 103, 1420, 34, 933, 832, 824, 833, 856, + 334, 705, 857, 891, 334, 204, 205, 206, 207, 892, + 208, 209, 210, 211, 212, 213, 214, 215, 728, 893, + 216, 217, 218, 219, 220, 221, 222, 223, 327, 895, + 728, 753, 649, 651, 653, 354, 705, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 347, 626, 131, 232, 113, 297, 626, + 138, 626, 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 132, 114, 298, 139, 521, 54, 21, 334, + 334, 521, 521, 626, 1111, 626, 1212, 626, 1023, 626, + 626, 626, 1213, 1401, 1368, 1261, 811, 1576, 1545, 347, + 626, 347, 811, 1585, 521, 626, 1532, 1527, 1561, 811, + 931, 1050, 1432, 1618, 1375, 626, 626, 521, 521, 1051, + 347, 347, 521, 1052, 1454, 521, 1372, 521, 626, 521, + 521, 521, 521, 1046, 1551, 1556, 1610, 521, 1549, 1301, + 347, 521, 1609, 1475, 626, 521, 1020, 1302, 347, 334, + 822, 347, 1068, 521, 952, 1070, 521, 811, 521, 521, + 997, 1147, 624, 574, 521, 38, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 927, 334, 872, + 302, 949, 521, 521, 577, 680, 684, 521, 521, 682, + 521, 521, 521, 521, 521, 521, 521, 686, 521, 521, + 688, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 114, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 689, 1225, 521, 839, 521, 859, + 521, 1380, 1287, 521, 426, 1310, 991, 927, 927, 521, + 1140, 1197, 1190, 1160, 1204, 927, 927, 927, 927, 927, + 1129, 927, 927, 1198, 927, 927, 927, 927, 927, 927, + 927, 927, 1196, 1267, 815, 1235, 927, 1088, 927, 927, + 927, 927, 927, 927, 704, 705, 927, 896, 1378, 1274, + 927, 927, 349, 927, 927, 927, 0, 1018, 0, 0, + 0, 850, 114, 1021, 0, 927, 0, 927, 0, 927, + 927, 0, 0, 927, 0, 927, 927, 927, 927, 927, + 927, 927, 927, 927, 927, 927, 927, 0, 927, 0, + 0, 927, 927, 0, 0, 927, 927, 0, 0, 0, + 0, 114, 0, 0, 0, 114, 0, 0, 0, 114, + 927, 927, 927, 927, 927, 0, 0, 0, 927, 927, + 0, 0, 927, 0, 392, 0, 334, 927, 927, 927, + 927, 927, 0, 0, 0, 927, 0, 927, 114, 0, + 0, 0, 0, 927, 927, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 0, 0, 0, 0, 517, + 0, 0, 425, 0, 425, 517, 0, 0, 927, 927, + 927, 927, 349, 927, 0, 0, 0, 0, 0, 0, + 927, 0, 38, 425, 425, 0, 38, 347, 0, 0, + 0, 334, 0, 0, 0, 0, 0, 38, 114, 114, + 0, 0, 38, 425, 0, 0, 38, 0, 0, 38, + 0, 425, 0, 334, 425, 0, 0, 0, 0, 0, + 517, 38, 38, 0, 0, 0, 38, 38, 0, 0, + 0, 0, 38, 0, 38, 38, 38, 38, 0, 0, + 0, 0, 38, 0, 0, 0, 38, 0, 38, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, + 38, 38, 0, 38, 0, 0, 0, 38, 0, 0, + 0, 0, 0, 334, 334, 0, 0, 0, 0, 0, + 0, 334, 0, 0, 0, 0, 0, 38, 0, 334, + 334, 0, 334, 38, 38, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 334, 0, 0, 334, 850, 850, 0, + 0, 0, 0, 0, 0, 850, 850, 850, 850, 850, + 0, 850, 850, 808, 850, 850, 850, 850, 850, 850, + 850, 0, 0, 0, 0, 0, 850, 574, 850, 850, + 850, 850, 850, 850, 0, 0, 850, 0, 0, 0, + 850, 850, 0, 850, 850, 850, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 850, 0, 850, 0, 850, + 850, 0, 0, 850, 0, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 0, 850, 0, + 0, 850, 850, 0, 0, 850, 850, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 850, 850, 850, 850, 850, 0, 0, 0, 850, 850, + 0, 0, 850, 0, 0, 0, 0, 850, 850, 850, + 850, 850, 0, 347, 0, 850, 0, 850, 347, 347, + 0, 0, 0, 850, 850, 0, 0, 0, 0, 0, 0, 0, 0, 340, 0, 0, 0, 0, 0, 0, - 0, 347, 0, 0, 0, 0, 0, 0, 835, 835, - 835, 835, 0, 835, 347, 347, 0, 0, 0, 347, - 835, 0, 347, 0, 347, 0, 347, 347, 347, 347, + 0, 347, 0, 0, 0, 0, 0, 0, 850, 850, + 850, 850, 0, 850, 347, 347, 0, 0, 0, 347, + 850, 0, 347, 0, 347, 0, 347, 347, 347, 347, 0, 0, 0, 0, 347, 0, 0, 0, 347, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 347, 0, 347, 347, 0, 0, 0, @@ -11022,25 +11211,25 @@ void case_1035() 347, 0, 0, 0, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 0, 347, 347, 0, 0, 347, 347, 347, 347, 347, 0, 0, 347, 347, 0, 0, - 0, 347, 347, 347, 347, 347, 347, 347, 347, 793, - 0, 0, 0, 377, 793, 793, 0, 0, 0, 0, + 0, 347, 347, 347, 347, 347, 347, 347, 347, 808, + 0, 0, 0, 377, 808, 808, 0, 0, 0, 0, 347, 0, 0, 347, 0, 347, 0, 347, 0, 0, - 347, 0, 0, 0, 0, 0, 347, 793, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 793, 793, 0, 0, 0, 793, 0, 0, 793, 0, - 793, 0, 793, 793, 793, 793, 0, 0, 0, 0, - 793, 0, 0, 0, 793, 0, 0, 0, 793, 0, - 0, 0, 0, 0, 0, 0, 793, 0, 0, 793, - 0, 793, 793, 0, 0, 0, 0, 793, 0, 793, - 793, 793, 793, 793, 793, 793, 793, 793, 793, 793, - 0, 0, 0, 0, 0, 793, 793, 372, 0, 0, - 793, 793, 793, 793, 793, 793, 0, 793, 793, 793, - 0, 793, 793, 0, 0, 793, 793, 793, 793, 340, - 0, 0, 793, 793, 340, 340, 0, 793, 793, 793, - 793, 793, 793, 793, 793, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 793, 340, 0, 793, - 0, 793, 0, 793, 0, 0, 793, 0, 0, 0, - 340, 340, 793, 0, 0, 340, 0, 0, 340, 0, + 347, 0, 0, 0, 0, 0, 347, 808, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 808, 808, 0, 0, 0, 808, 0, 0, 808, 0, + 808, 0, 808, 808, 808, 808, 0, 0, 0, 0, + 808, 0, 0, 0, 808, 0, 0, 0, 808, 0, + 0, 0, 0, 0, 0, 0, 808, 0, 0, 808, + 0, 808, 808, 0, 0, 0, 0, 808, 0, 808, + 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, + 0, 0, 0, 0, 0, 808, 808, 347, 0, 0, + 808, 808, 808, 808, 808, 808, 0, 808, 808, 808, + 0, 808, 808, 0, 0, 808, 808, 808, 808, 340, + 0, 0, 808, 808, 340, 340, 0, 808, 808, 808, + 808, 808, 808, 808, 808, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 808, 340, 0, 808, + 0, 808, 0, 808, 0, 0, 808, 0, 0, 0, + 340, 340, 808, 0, 0, 340, 0, 0, 340, 0, 340, 0, 340, 340, 340, 340, 0, 0, 0, 0, 340, 0, 0, 0, 340, 0, 0, 0, 340, 0, 0, 0, 0, 0, 0, 0, 340, 0, 0, 340, @@ -11059,24 +11248,24 @@ void case_1035() 0, 0, 0, 0, 0, 0, 377, 0, 0, 377, 0, 377, 377, 0, 0, 0, 0, 377, 0, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - 0, 0, 24, 372, 0, 377, 377, 0, 0, 372, + 0, 0, 24, 347, 0, 377, 377, 0, 0, 347, 377, 377, 0, 377, 377, 377, 0, 377, 377, 377, 0, 377, 377, 0, 0, 377, 377, 377, 377, 0, 0, 0, 377, 377, 0, 0, 0, 377, 377, 377, - 377, 377, 377, 377, 377, 372, 0, 0, 0, 0, + 377, 377, 377, 377, 377, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 377, 0, 0, 377, 0, 377, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 377, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 372, 0, 0, 0, - 0, 372, 0, 372, 372, 372, 372, 372, 372, 372, - 372, 372, 372, 372, 0, 0, 0, 0, 0, 0, - 372, 0, 0, 0, 372, 372, 0, 372, 372, 372, - 0, 372, 372, 372, 0, 372, 372, 0, 0, 372, - 372, 372, 372, 0, 36, 0, 372, 372, 0, 0, - 0, 372, 372, 372, 372, 372, 372, 372, 372, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 372, 0, 0, 372, 0, 372, 0, 0, 0, 0, - 0, 0, 31, 31, 0, 0, 372, 31, 0, 0, + 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, + 0, 347, 0, 347, 347, 347, 347, 347, 347, 347, + 347, 347, 347, 347, 347, 0, 0, 0, 0, 0, + 347, 0, 0, 0, 347, 347, 347, 347, 347, 347, + 347, 347, 347, 347, 0, 347, 347, 0, 0, 347, + 347, 347, 347, 347, 36, 0, 347, 347, 0, 0, + 0, 347, 347, 347, 347, 347, 347, 347, 347, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 347, 0, 0, 347, 0, 347, 0, 347, 0, 0, + 347, 0, 31, 31, 0, 0, 347, 31, 0, 0, 0, 31, 0, 31, 0, 0, 31, 0, 31, 31, 0, 31, 0, 31, 0, 31, 0, 31, 31, 31, 31, 0, 0, 31, 31, 0, 0, 0, 25, 31, @@ -11094,7 +11283,7 @@ void case_1035() 0, 0, 37, 24, 0, 24, 37, 0, 0, 0, 0, 0, 0, 0, 31, 24, 0, 37, 24, 0, 24, 0, 37, 0, 24, 0, 37, 0, 0, 37, - 0, 0, 0, 0, 0, 0, 0, 1010, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1027, 0, 0, 0, 37, 37, 0, 24, 0, 37, 37, 0, 21, 24, 24, 37, 0, 37, 37, 37, 37, 0, 0, 0, 0, 37, 0, 0, 0, 37, 0, 37, 0, @@ -11110,7 +11299,7 @@ void case_1035() 25, 0, 0, 0, 0, 25, 0, 0, 0, 25, 0, 0, 25, 0, 0, 0, 36, 0, 0, 0, 0, 0, 36, 36, 25, 25, 0, 0, 35, 25, - 25, 0, 35, 0, 1011, 25, 0, 25, 25, 25, + 25, 0, 35, 0, 1028, 25, 0, 25, 25, 25, 25, 0, 0, 35, 0, 25, 0, 0, 35, 25, 0, 25, 35, 0, 0, 35, 0, 0, 0, 0, 0, 25, 0, 0, 25, 0, 25, 35, 35, 0, @@ -11120,7 +11309,7 @@ void case_1035() 0, 0, 0, 0, 35, 0, 0, 35, 0, 35, 51, 51, 0, 35, 0, 51, 51, 0, 0, 0, 0, 51, 0, 51, 51, 51, 51, 0, 0, 0, - 0, 51, 0, 35, 1010, 51, 0, 51, 51, 0, + 0, 51, 0, 35, 1027, 51, 0, 51, 51, 0, 35, 0, 0, 0, 0, 0, 0, 51, 0, 51, 51, 0, 51, 0, 51, 0, 51, 0, 51, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, @@ -11136,7 +11325,7 @@ void case_1035() 51, 0, 51, 52, 0, 0, 51, 0, 52, 0, 0, 0, 52, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 52, 52, 0, - 0, 1011, 52, 52, 0, 51, 0, 0, 52, 0, + 0, 1028, 52, 52, 0, 51, 0, 0, 52, 0, 52, 52, 52, 52, 0, 0, 51, 0, 52, 0, 0, 51, 52, 0, 52, 51, 0, 0, 51, 0, 0, 0, 0, 0, 52, 0, 0, 52, 0, 52, @@ -11148,103 +11337,103 @@ void case_1035() 0, 0, 0, 0, 52, 0, 52, 52, 52, 52, 0, 0, 0, 0, 52, 0, 51, 0, 52, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 52, 0, 55, 52, 0, 52, 0, 0, 0, 52, - 56, 24, 57, 25, 0, 0, 26, 58, 0, 59, - 60, 27, 61, 62, 63, 28, 0, 0, 0, 52, - 0, 64, 0, 65, 30, 66, 67, 68, 69, 0, - 0, 32, 0, 0, 0, 70, 33, 0, 71, 72, + 52, 0, 56, 52, 0, 52, 0, 0, 0, 52, + 57, 24, 58, 25, 0, 0, 26, 59, 0, 60, + 61, 27, 62, 63, 64, 28, 0, 0, 0, 52, + 0, 65, 0, 66, 30, 67, 68, 69, 70, 0, + 0, 32, 0, 0, 0, 71, 33, 0, 72, 73, 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, 796, - 87, 88, 0, 0, 0, 796, 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, 796, 102, 0, 0, 0, 0, 0, 103, 104, + 74, 0, 36, 0, 37, 75, 0, 0, 38, 0, + 76, 77, 78, 79, 80, 81, 39, 40, 82, 83, + 41, 84, 0, 85, 0, 0, 86, 87, 0, 811, + 88, 89, 0, 0, 0, 811, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 90, 91, 92, 93, 94, + 0, 0, 0, 95, 0, 0, 0, 96, 0, 0, + 0, 0, 97, 98, 99, 100, 101, 0, 0, 0, + 102, 811, 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, - 0, 347, 0, 105, 106, 107, 108, 0, 0, 0, - 0, 0, 796, 0, 0, 196, 0, 796, 0, 796, - 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, - 796, 0, 0, 0, 0, 0, 796, 347, 0, 0, - 0, 796, 796, 796, 796, 796, 796, 796, 796, 796, - 0, 796, 796, 0, 796, 796, 796, 796, 796, 796, - 796, 796, 796, 796, 0, 796, 796, 796, 796, 796, - 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, - 796, 796, 796, 796, 796, 796, 796, 796, 347, 0, - 0, 796, 0, 796, 347, 0, 796, 0, 0, 0, - 0, 0, 796, 0, 0, 0, 0, 347, 0, 0, + 0, 347, 0, 106, 107, 108, 109, 0, 0, 0, + 0, 0, 811, 0, 0, 197, 0, 811, 0, 811, + 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + 811, 0, 0, 0, 0, 0, 811, 347, 0, 0, + 0, 811, 811, 811, 811, 811, 811, 811, 811, 811, + 0, 811, 811, 0, 811, 811, 811, 811, 811, 811, + 811, 811, 811, 811, 0, 811, 811, 811, 811, 811, + 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + 811, 811, 811, 811, 811, 811, 811, 811, 347, 0, + 0, 811, 0, 811, 347, 0, 811, 0, 0, 0, + 0, 0, 811, 0, 0, 0, 0, 347, 0, 0, 347, 0, 347, 347, 0, 0, 0, 347, 347, 0, 0, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 347, 0, 0, 0, 0, 0, 0, 347, 0, 0, 347, 0, 0, 0, 0, 0, 347, 0, - 201, 347, 0, 0, 0, 0, 347, 0, 347, 347, + 0, 347, 0, 0, 0, 0, 347, 0, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, - 347, 347, 347, 347, 347, 347, 347, 347, 347, 1002, - 347, 347, 202, 347, 347, 347, 347, 347, 347, 347, + 347, 347, 347, 347, 347, 347, 347, 347, 347, 637, + 347, 347, 0, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 0, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, - 347, 347, 347, 347, 347, 347, 0, 519, 0, 0, - 347, 0, 347, 519, 0, 347, 0, 0, 0, 0, - 0, 347, 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, 519, - 0, 0, 1002, 0, 0, 0, 0, 1002, 0, 1002, - 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1002, 0, 1002, 0, 1002, 0, 1002, 1002, 1002, - 519, 0, 0, 0, 0, 519, 0, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 0, 519, - 519, 0, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 1002, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 0, 515, 642, 0, 0, - 0, 519, 515, 0, 0, 0, 24, 0, 25, 0, - 519, 26, 0, 0, 0, 0, 27, 0, 0, 0, + 347, 347, 347, 347, 347, 347, 0, 523, 0, 0, + 347, 0, 347, 523, 0, 347, 0, 0, 0, 0, + 0, 347, 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, 523, + 0, 0, 637, 0, 0, 0, 0, 637, 0, 637, + 637, 637, 637, 637, 637, 637, 637, 637, 637, 637, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 637, 0, 637, 0, 637, 0, 637, 637, 637, + 523, 0, 0, 0, 0, 523, 0, 523, 523, 523, + 523, 523, 523, 523, 523, 523, 523, 523, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 523, 523, + 523, 523, 523, 523, 523, 523, 523, 523, 0, 523, + 523, 0, 523, 523, 523, 523, 523, 523, 523, 523, + 523, 523, 637, 523, 523, 523, 523, 523, 523, 523, + 523, 523, 523, 523, 523, 523, 523, 523, 523, 523, + 523, 523, 523, 523, 523, 0, 519, 816, 0, 0, + 0, 523, 519, 0, 0, 0, 24, 0, 25, 0, + 523, 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, 515, 0, + 0, 0, 0, 0, 0, 0, 32, 0, 519, 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, 403, 0, 0, - 0, 39, 40, 403, 0, 41, 0, 0, 324, 515, - 0, 0, 0, 0, 515, 0, 515, 515, 515, 515, - 515, 515, 515, 515, 515, 515, 515, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 515, 515, 403, - 515, 515, 515, 515, 515, 515, 515, 0, 515, 515, - 0, 515, 515, 515, 515, 515, 515, 515, 515, 515, - 515, 0, 515, 515, 515, 515, 515, 515, 515, 515, - 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, - 515, 515, 515, 515, 0, 523, 0, 0, 0, 368, - 515, 523, 0, 515, 0, 0, 0, 0, 0, 515, + 0, 39, 40, 403, 0, 41, 0, 0, 817, 519, + 0, 0, 0, 0, 519, 0, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 0, 0, 0, + 0, 0, 0, 0, 294, 0, 0, 519, 519, 403, + 519, 519, 519, 519, 519, 519, 519, 0, 519, 519, + 0, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 0, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 0, 527, 0, 0, 0, 328, + 519, 527, 0, 519, 0, 0, 0, 0, 0, 519, 0, 0, 0, 0, 340, 0, 0, 0, 0, 403, 340, 0, 403, 403, 403, 403, 0, 403, 0, 403, - 403, 0, 403, 403, 403, 403, 403, 523, 403, 403, + 403, 0, 403, 403, 403, 403, 403, 527, 403, 403, 403, 403, 0, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 0, 0, 0, 0, 340, - 0, 403, 0, 0, 403, 0, 0, 0, 523, 0, - 403, 0, 0, 523, 0, 523, 523, 523, 523, 523, - 523, 523, 523, 523, 523, 523, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 523, 0, 523, - 523, 523, 523, 523, 523, 523, 0, 523, 523, 0, - 523, 523, 523, 523, 523, 523, 523, 523, 523, 523, - 0, 523, 523, 523, 523, 523, 523, 523, 523, 523, - 523, 523, 523, 523, 523, 523, 523, 523, 523, 523, - 523, 523, 523, 0, 347, 644, 0, 0, 0, 523, - 347, 0, 523, 0, 24, 0, 25, 0, 523, 26, + 0, 403, 0, 0, 403, 0, 0, 0, 527, 0, + 403, 0, 0, 527, 0, 527, 527, 527, 527, 527, + 527, 527, 527, 527, 527, 527, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 527, 0, 527, + 527, 527, 527, 527, 527, 527, 0, 527, 527, 0, + 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, + 0, 527, 527, 527, 527, 527, 527, 527, 527, 527, + 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, + 527, 527, 527, 0, 347, 595, 0, 0, 0, 527, + 347, 0, 527, 0, 24, 0, 25, 0, 527, 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, 347, 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, 324, 347, 0, 0, + 40, 0, 0, 41, 0, 0, 327, 347, 0, 0, 0, 0, 347, 0, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 347, 347, @@ -11252,1554 +11441,1571 @@ void case_1035() 347, 347, 347, 347, 347, 347, 347, 347, 347, 0, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, - 347, 347, 0, 448, 951, 0, 0, 368, 347, 448, + 347, 347, 0, 449, 654, 0, 0, 374, 347, 449, 0, 347, 0, 24, 0, 25, 0, 347, 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, 448, 0, 0, 33, 0, + 0, 0, 0, 32, 0, 449, 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, 324, 448, 0, 0, 0, - 0, 448, 0, 448, 448, 448, 448, 448, 448, 448, - 448, 448, 448, 448, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 448, 0, 448, 448, 448, - 448, 448, 448, 448, 0, 448, 448, 0, 448, 448, - 448, 448, 448, 448, 448, 448, 448, 448, 0, 448, - 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, - 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, - 448, 0, 347, 0, 0, 0, 368, 448, 347, 1102, - 448, 0, 796, 0, 0, 0, 448, 0, 24, 0, + 0, 0, 41, 0, 0, 327, 449, 0, 0, 0, + 0, 449, 0, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 449, 0, 449, 449, 449, + 449, 449, 449, 449, 0, 449, 449, 0, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 0, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 0, 347, 0, 0, 0, 374, 449, 347, 656, + 449, 0, 811, 0, 0, 0, 449, 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, 347, 0, 0, 0, 32, 0, 0, 0, 0, 33, 0, 0, 0, 34, 0, 0, - 796, 0, 0, 0, 0, 0, 0, 0, 0, 36, + 811, 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, - 324, 0, 0, 0, 0, 557, 0, 0, 0, 0, - 0, 557, 0, 347, 0, 0, 0, 0, 0, 347, + 327, 0, 0, 0, 0, 561, 0, 0, 0, 0, + 0, 561, 0, 347, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 347, 347, 347, 347, 347, 347, - 347, 796, 347, 0, 347, 347, 0, 347, 347, 347, - 347, 347, 347, 347, 347, 347, 347, 557, 347, 347, + 347, 811, 347, 0, 347, 347, 0, 347, 347, 347, + 347, 347, 347, 347, 347, 347, 347, 561, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 0, 0, 0, 0, 347, 0, 347, 0, 0, 347, - 0, 368, 0, 0, 0, 347, 0, 0, 557, 0, - 0, 0, 0, 557, 0, 557, 557, 557, 557, 557, - 557, 557, 557, 557, 557, 557, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 557, 0, 557, - 0, 557, 0, 557, 557, 557, 0, 557, 557, 0, - 557, 557, 557, 557, 557, 557, 557, 557, 557, 557, - 369, 0, 0, 557, 557, 557, 557, 557, 557, 557, - 557, 557, 557, 557, 557, 557, 557, 557, 557, 557, - 557, 579, 557, 369, 0, 0, 0, 579, 0, 0, - 0, 0, 0, 0, 0, 0, 369, 0, 557, 0, - 0, 369, 0, 0, 240, 0, 369, 0, 369, 369, - 369, 369, 0, 0, 0, 0, 369, 0, 0, 0, - 369, 0, 0, 579, 369, 0, 0, 0, 0, 0, - 0, 0, 369, 0, 0, 369, 0, 369, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 586, - 0, 0, 0, 0, 0, 586, 0, 0, 0, 0, - 0, 369, 0, 0, 579, 0, 0, 369, 0, 579, - 0, 579, 579, 579, 579, 579, 579, 579, 579, 579, - 579, 579, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 586, 0, 579, 0, 579, 0, 579, 0, 579, - 579, 579, 0, 579, 579, 0, 0, 579, 579, 579, - 579, 579, 579, 579, 579, 579, 0, 369, 0, 579, - 579, 579, 579, 579, 579, 579, 579, 0, 0, 0, - 0, 0, 586, 0, 0, 0, 0, 586, 579, 586, - 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, - 0, 0, 0, 587, 579, 0, 0, 0, 0, 587, - 0, 586, 0, 586, 0, 586, 0, 586, 586, 586, - 0, 586, 586, 0, 0, 586, 586, 586, 586, 0, - 0, 0, 586, 586, 0, 0, 0, 586, 586, 586, - 586, 586, 586, 586, 586, 587, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 586, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 588, 586, 0, 0, 0, 0, 588, 0, 0, - 0, 0, 0, 0, 0, 0, 587, 0, 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, 588, 0, 587, 0, 587, 0, 587, - 0, 587, 587, 587, 0, 587, 587, 0, 0, 587, - 587, 587, 587, 0, 0, 0, 587, 587, 0, 595, - 0, 587, 587, 587, 587, 587, 587, 587, 587, 0, - 0, 0, 0, 0, 588, 0, 0, 0, 0, 588, - 587, 588, 588, 588, 588, 588, 588, 588, 588, 588, - 588, 588, 0, 0, 0, 0, 587, 0, 0, 0, - 0, 0, 0, 588, 0, 588, 0, 588, 0, 588, - 588, 588, 0, 588, 588, 0, 0, 588, 588, 588, - 588, 0, 0, 0, 588, 588, 0, 596, 0, 588, - 588, 588, 588, 588, 588, 588, 588, 0, 0, 0, - 0, 0, 595, 0, 0, 0, 0, 595, 588, 595, - 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, - 0, 0, 0, 0, 588, 0, 0, 0, 0, 0, - 0, 595, 0, 595, 0, 595, 0, 595, 595, 595, - 0, 0, 0, 0, 0, 595, 595, 595, 595, 0, - 0, 0, 595, 595, 0, 597, 0, 595, 595, 595, - 595, 595, 595, 595, 595, 0, 0, 0, 0, 0, - 596, 0, 0, 0, 0, 596, 595, 596, 596, 596, - 596, 596, 596, 596, 596, 596, 596, 596, 0, 0, - 0, 0, 595, 0, 0, 0, 0, 0, 0, 596, - 0, 596, 0, 596, 0, 596, 596, 596, 0, 0, - 0, 0, 0, 596, 596, 596, 596, 0, 0, 0, - 596, 596, 0, 600, 0, 596, 596, 596, 596, 596, - 596, 596, 596, 0, 0, 0, 0, 0, 597, 0, - 0, 0, 0, 597, 596, 597, 597, 597, 597, 597, - 597, 597, 597, 597, 597, 597, 0, 0, 0, 0, - 596, 0, 0, 0, 0, 0, 0, 597, 0, 597, - 0, 597, 0, 597, 597, 597, 0, 0, 0, 0, - 0, 597, 597, 597, 597, 0, 0, 0, 597, 597, - 0, 601, 0, 597, 597, 597, 597, 597, 597, 597, - 597, 0, 0, 0, 0, 0, 600, 0, 0, 0, - 0, 600, 597, 600, 600, 600, 600, 600, 600, 600, - 600, 600, 600, 600, 0, 0, 0, 0, 597, 0, - 0, 0, 0, 0, 0, 600, 0, 600, 0, 600, - 0, 600, 600, 600, 0, 0, 0, 0, 0, 600, - 600, 600, 600, 0, 0, 0, 600, 600, 0, 602, - 0, 0, 0, 600, 600, 600, 600, 600, 600, 0, - 0, 0, 0, 0, 601, 0, 0, 0, 0, 601, - 600, 601, 601, 601, 601, 601, 601, 601, 601, 601, - 601, 601, 0, 0, 0, 0, 600, 0, 0, 0, - 0, 0, 0, 601, 0, 601, 0, 601, 0, 601, - 601, 601, 0, 0, 0, 0, 0, 601, 601, 601, - 601, 0, 0, 0, 601, 601, 0, 603, 0, 0, - 0, 601, 601, 601, 601, 601, 601, 0, 0, 0, - 0, 0, 602, 0, 0, 0, 0, 602, 601, 602, + 0, 374, 0, 0, 0, 347, 0, 0, 561, 0, + 0, 0, 635, 561, 0, 561, 561, 561, 561, 561, + 561, 561, 561, 561, 561, 561, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 561, 0, 561, + 0, 561, 0, 561, 561, 561, 0, 561, 561, 0, + 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, + 0, 0, 0, 561, 561, 561, 561, 561, 561, 561, + 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, + 561, 583, 561, 0, 0, 0, 0, 583, 0, 0, + 0, 0, 0, 0, 0, 635, 0, 0, 561, 0, + 635, 0, 635, 635, 635, 635, 635, 635, 635, 635, + 635, 635, 635, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 583, 635, 0, 635, 0, 635, 0, + 635, 635, 635, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 635, 0, 0, 590, + 0, 0, 0, 0, 0, 590, 0, 0, 0, 0, + 0, 0, 0, 0, 583, 0, 0, 0, 0, 583, + 0, 583, 583, 583, 583, 583, 583, 583, 583, 583, + 583, 583, 0, 0, 0, 635, 0, 0, 0, 0, + 0, 590, 0, 583, 0, 583, 0, 583, 0, 583, + 583, 583, 0, 583, 583, 0, 0, 583, 583, 583, + 583, 583, 583, 583, 583, 583, 0, 0, 0, 583, + 583, 583, 583, 583, 583, 583, 583, 0, 0, 0, + 0, 0, 590, 0, 0, 0, 0, 590, 583, 590, + 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, + 0, 0, 0, 591, 583, 0, 0, 0, 0, 591, + 0, 590, 0, 590, 0, 590, 0, 590, 590, 590, + 0, 590, 590, 0, 0, 590, 590, 590, 590, 0, + 0, 0, 590, 590, 0, 0, 0, 590, 590, 590, + 590, 590, 590, 590, 590, 591, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 590, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 592, 590, 0, 0, 0, 0, 592, 0, 0, + 0, 0, 0, 0, 0, 0, 591, 0, 0, 0, + 0, 591, 0, 591, 591, 591, 591, 591, 591, 591, + 591, 591, 591, 591, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 592, 0, 591, 0, 591, 0, 591, + 0, 591, 591, 591, 0, 591, 591, 0, 0, 591, + 591, 591, 591, 0, 0, 0, 591, 591, 0, 0, + 0, 591, 591, 591, 591, 591, 591, 591, 591, 0, + 0, 0, 0, 0, 592, 0, 0, 0, 0, 592, + 591, 592, 592, 592, 592, 592, 592, 592, 592, 592, + 592, 592, 0, 0, 0, 0, 591, 0, 0, 0, + 0, 0, 0, 592, 0, 592, 0, 592, 0, 592, + 592, 592, 0, 592, 592, 0, 0, 592, 592, 592, + 592, 0, 0, 0, 592, 592, 0, 0, 0, 592, + 592, 592, 592, 592, 592, 592, 592, 0, 519, 0, + 602, 0, 0, 0, 0, 0, 57, 24, 592, 25, + 0, 0, 26, 256, 0, 0, 0, 27, 62, 63, + 0, 28, 0, 0, 592, 0, 0, 65, 0, 0, + 30, 0, 0, 0, 0, 0, 0, 32, 0, 0, + 0, 0, 33, 0, 72, 73, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, + 37, 75, 0, 0, 38, 0, 0, 77, 0, 79, + 0, 81, 39, 40, 257, 0, 41, 0, 0, 0, + 0, 0, 0, 602, 603, 0, 0, 0, 602, 0, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, - 0, 0, 0, 0, 601, 0, 0, 0, 0, 0, - 0, 602, 0, 602, 0, 602, 0, 602, 602, 602, - 0, 0, 0, 0, 0, 602, 602, 602, 602, 0, - 0, 0, 602, 602, 0, 604, 0, 0, 0, 602, - 602, 602, 602, 602, 602, 0, 0, 0, 0, 0, - 603, 0, 0, 0, 0, 603, 602, 603, 603, 603, - 603, 603, 603, 603, 603, 603, 603, 603, 0, 0, - 0, 0, 602, 0, 0, 0, 0, 0, 0, 603, - 0, 603, 0, 603, 0, 603, 603, 603, 0, 0, - 0, 0, 0, 603, 603, 603, 603, 0, 0, 0, - 603, 603, 0, 609, 0, 0, 0, 603, 603, 603, - 603, 603, 603, 0, 0, 0, 0, 0, 604, 0, - 0, 0, 0, 604, 603, 604, 604, 604, 604, 604, - 604, 604, 604, 604, 604, 604, 0, 0, 0, 0, - 603, 0, 0, 0, 0, 0, 0, 604, 0, 604, - 0, 604, 0, 604, 604, 604, 0, 0, 0, 0, - 0, 604, 604, 604, 604, 0, 0, 0, 604, 604, - 0, 610, 0, 0, 0, 604, 604, 604, 604, 604, - 604, 0, 0, 0, 0, 0, 609, 0, 0, 0, - 0, 609, 604, 609, 609, 609, 609, 609, 609, 609, - 609, 609, 609, 609, 0, 0, 0, 0, 604, 0, - 0, 0, 0, 0, 0, 609, 0, 609, 0, 609, - 0, 609, 609, 609, 0, 0, 0, 0, 0, 0, - 0, 609, 609, 0, 0, 0, 609, 609, 0, 611, - 0, 0, 0, 0, 0, 609, 609, 609, 609, 0, - 0, 0, 0, 0, 610, 0, 0, 0, 0, 610, - 609, 610, 610, 610, 610, 610, 610, 610, 610, 610, - 610, 610, 0, 0, 0, 0, 609, 0, 0, 0, - 0, 0, 0, 610, 0, 610, 0, 610, 0, 610, - 610, 610, 0, 0, 0, 0, 0, 0, 0, 610, - 610, 0, 0, 0, 610, 610, 0, 615, 0, 0, - 0, 0, 0, 610, 610, 610, 610, 0, 0, 0, - 0, 0, 611, 0, 0, 0, 0, 611, 610, 611, - 611, 611, 611, 611, 611, 611, 611, 611, 611, 611, - 0, 0, 0, 0, 610, 0, 0, 0, 0, 0, - 0, 611, 0, 611, 0, 611, 0, 611, 611, 611, - 0, 0, 0, 0, 0, 0, 0, 611, 611, 0, - 0, 0, 611, 611, 0, 617, 0, 0, 0, 0, - 0, 611, 611, 611, 611, 0, 0, 0, 0, 0, - 615, 0, 0, 0, 0, 615, 611, 615, 615, 615, - 615, 615, 615, 615, 615, 615, 615, 615, 0, 0, - 0, 0, 611, 0, 0, 0, 0, 0, 0, 615, - 0, 615, 0, 615, 0, 615, 615, 615, 0, 0, - 0, 0, 0, 0, 0, 615, 615, 0, 0, 0, - 615, 615, 0, 618, 0, 0, 0, 0, 0, 0, - 0, 615, 615, 0, 0, 0, 0, 0, 617, 0, - 0, 0, 0, 617, 615, 617, 617, 617, 617, 617, - 617, 617, 617, 617, 617, 617, 0, 0, 0, 0, - 615, 0, 0, 0, 0, 0, 0, 617, 0, 617, - 0, 617, 0, 617, 617, 617, 0, 0, 0, 0, - 0, 0, 0, 0, 617, 0, 0, 0, 617, 617, - 0, 620, 0, 0, 0, 0, 0, 0, 0, 617, - 617, 0, 0, 0, 0, 0, 618, 0, 0, 0, - 0, 618, 617, 618, 618, 618, 618, 618, 618, 618, - 618, 618, 618, 618, 0, 0, 0, 0, 617, 0, - 0, 0, 0, 0, 0, 618, 0, 618, 0, 618, - 0, 618, 618, 618, 0, 0, 0, 0, 0, 0, - 0, 0, 618, 0, 0, 0, 618, 618, 0, 621, - 0, 0, 0, 0, 0, 0, 0, 618, 618, 0, - 0, 0, 0, 0, 620, 0, 0, 0, 0, 620, - 618, 620, 620, 620, 620, 620, 620, 620, 620, 620, - 620, 620, 0, 0, 0, 0, 618, 0, 0, 0, - 0, 0, 0, 620, 0, 620, 0, 620, 0, 620, - 620, 620, 0, 0, 0, 0, 0, 0, 0, 0, - 620, 0, 0, 0, 0, 620, 0, 623, 0, 0, - 0, 0, 0, 0, 0, 620, 620, 0, 0, 0, - 0, 0, 621, 0, 0, 0, 0, 621, 620, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 0, 0, 0, 0, 620, 0, 0, 0, 0, 0, - 0, 621, 0, 621, 0, 621, 0, 621, 621, 621, - 0, 0, 0, 0, 0, 0, 0, 0, 621, 0, - 0, 0, 0, 621, 0, 624, 0, 0, 0, 0, - 0, 0, 0, 621, 621, 0, 0, 0, 0, 0, - 623, 0, 0, 0, 0, 623, 621, 623, 623, 623, - 623, 623, 623, 623, 623, 623, 623, 623, 0, 0, - 0, 0, 621, 0, 0, 0, 0, 0, 0, 623, - 0, 623, 0, 623, 0, 623, 623, 623, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 623, 0, 626, 0, 0, 0, 0, 0, 0, - 0, 623, 623, 0, 0, 0, 0, 0, 624, 0, - 0, 0, 0, 624, 623, 624, 624, 624, 624, 624, - 624, 624, 624, 624, 624, 624, 0, 0, 0, 0, - 623, 0, 0, 0, 0, 0, 0, 624, 0, 624, - 0, 624, 0, 624, 624, 624, 0, 0, 0, 627, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 624, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 624, - 624, 0, 0, 0, 0, 0, 626, 0, 0, 0, - 0, 626, 624, 626, 626, 626, 626, 626, 626, 626, - 626, 626, 626, 626, 0, 0, 0, 0, 624, 0, - 0, 0, 0, 0, 0, 626, 0, 626, 0, 626, - 0, 626, 626, 626, 0, 0, 0, 0, 347, 0, - 0, 0, 796, 0, 0, 0, 0, 626, 0, 0, - 0, 0, 627, 0, 0, 0, 0, 627, 626, 627, - 627, 627, 627, 627, 627, 627, 627, 627, 627, 627, - 626, 0, 0, 0, 347, 0, 0, 0, 0, 0, - 0, 627, 0, 627, 0, 627, 626, 627, 627, 627, - 796, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 627, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 627, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 627, 0, 0, 0, - 0, 0, 0, 347, 0, 0, 0, 0, 0, 347, - 0, 0, 627, 0, 347, 347, 0, 347, 0, 347, - 0, 796, 347, 0, 347, 347, 0, 347, 347, 347, - 347, 347, 347, 347, 347, 347, 347, 0, 347, 347, - 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + 602, 90, 91, 92, 258, 520, 0, 0, 0, 0, + 0, 0, 602, 96, 602, 0, 602, 0, 602, 602, + 602, 0, 0, 0, 0, 0, 602, 602, 602, 602, + 0, 0, 0, 602, 602, 0, 0, 0, 602, 602, + 602, 602, 602, 602, 602, 602, 0, 0, 0, 0, + 0, 0, 606, 0, 0, 0, 0, 602, 0, 106, + 521, 0, 0, 0, 0, 0, 0, 603, 0, 0, + 522, 523, 603, 602, 603, 603, 603, 603, 603, 603, + 603, 603, 603, 603, 603, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 603, 0, 603, 0, + 603, 0, 603, 603, 603, 0, 0, 0, 0, 0, + 603, 603, 603, 603, 0, 0, 0, 603, 603, 0, + 607, 0, 603, 603, 603, 603, 603, 603, 603, 603, + 0, 0, 0, 0, 0, 606, 0, 0, 0, 0, + 606, 603, 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 0, 0, 0, 0, 603, 0, 0, + 0, 0, 0, 0, 606, 0, 606, 0, 606, 0, + 606, 606, 606, 0, 0, 0, 0, 0, 606, 606, + 606, 606, 0, 0, 0, 606, 606, 0, 608, 0, + 0, 0, 606, 606, 606, 606, 606, 606, 0, 0, + 0, 0, 0, 607, 0, 0, 0, 0, 607, 606, + 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, + 607, 0, 0, 0, 0, 606, 0, 0, 0, 0, + 0, 0, 607, 0, 607, 0, 607, 0, 607, 607, + 607, 0, 0, 0, 0, 0, 607, 607, 607, 607, + 0, 0, 0, 607, 607, 0, 609, 0, 0, 0, + 607, 607, 607, 607, 607, 607, 0, 0, 0, 0, + 0, 608, 0, 0, 0, 0, 608, 607, 608, 608, + 608, 608, 608, 608, 608, 608, 608, 608, 608, 0, + 0, 0, 0, 607, 0, 0, 0, 0, 0, 0, + 608, 0, 608, 0, 608, 0, 608, 608, 608, 0, + 0, 0, 0, 0, 608, 608, 608, 608, 0, 0, + 0, 608, 608, 0, 610, 0, 0, 0, 608, 608, + 608, 608, 608, 608, 0, 0, 0, 0, 0, 609, + 0, 0, 0, 0, 609, 608, 609, 609, 609, 609, + 609, 609, 609, 609, 609, 609, 609, 0, 0, 0, + 0, 608, 0, 0, 0, 0, 0, 0, 609, 0, + 609, 0, 609, 0, 609, 609, 609, 0, 0, 0, + 0, 0, 609, 609, 609, 609, 0, 0, 0, 609, + 609, 0, 615, 0, 0, 0, 609, 609, 609, 609, + 609, 609, 0, 0, 0, 0, 0, 610, 0, 0, + 0, 0, 610, 609, 610, 610, 610, 610, 610, 610, + 610, 610, 610, 610, 610, 0, 0, 0, 0, 609, + 0, 0, 0, 0, 0, 0, 610, 0, 610, 0, + 610, 0, 610, 610, 610, 0, 0, 0, 0, 0, + 610, 610, 610, 610, 0, 0, 0, 610, 610, 0, + 616, 0, 0, 0, 610, 610, 610, 610, 610, 610, + 0, 0, 0, 0, 0, 615, 0, 0, 0, 0, + 615, 610, 615, 615, 615, 615, 615, 615, 615, 615, + 615, 615, 615, 0, 0, 0, 0, 610, 0, 0, + 0, 0, 0, 0, 615, 0, 615, 0, 615, 0, + 615, 615, 615, 0, 0, 0, 0, 0, 0, 0, + 615, 615, 0, 0, 0, 615, 615, 0, 617, 0, + 0, 0, 0, 0, 615, 615, 615, 615, 0, 0, + 0, 0, 0, 616, 0, 0, 0, 0, 616, 615, + 616, 616, 616, 616, 616, 616, 616, 616, 616, 616, + 616, 0, 0, 0, 0, 615, 0, 0, 0, 0, + 0, 0, 616, 0, 616, 0, 616, 0, 616, 616, + 616, 0, 0, 0, 0, 0, 0, 0, 616, 616, + 0, 0, 0, 616, 616, 0, 620, 0, 0, 0, + 0, 0, 616, 616, 616, 616, 0, 0, 0, 0, + 0, 617, 0, 0, 0, 0, 617, 616, 617, 617, + 617, 617, 617, 617, 617, 617, 617, 617, 617, 0, + 0, 0, 0, 616, 0, 0, 0, 0, 0, 0, + 617, 0, 617, 0, 617, 0, 617, 617, 617, 0, + 0, 0, 0, 0, 0, 0, 617, 617, 0, 0, + 0, 617, 617, 0, 621, 0, 0, 0, 0, 0, + 617, 617, 617, 617, 0, 0, 0, 0, 0, 620, + 0, 0, 0, 0, 620, 617, 620, 620, 620, 620, + 620, 620, 620, 620, 620, 620, 620, 0, 0, 0, + 0, 617, 0, 0, 0, 0, 0, 0, 620, 0, + 620, 0, 620, 0, 620, 620, 620, 0, 0, 0, + 0, 0, 0, 0, 620, 620, 0, 0, 0, 620, + 620, 0, 623, 0, 0, 0, 0, 0, 0, 0, + 620, 620, 0, 0, 0, 0, 0, 621, 0, 0, + 0, 0, 621, 620, 621, 621, 621, 621, 621, 621, + 621, 621, 621, 621, 621, 0, 0, 0, 0, 620, + 0, 0, 0, 0, 0, 0, 621, 0, 621, 0, + 621, 0, 621, 621, 621, 0, 0, 0, 0, 0, + 0, 0, 621, 621, 0, 0, 0, 621, 621, 0, + 624, 0, 0, 0, 0, 0, 0, 0, 621, 621, + 0, 0, 0, 0, 0, 623, 0, 0, 0, 0, + 623, 621, 623, 623, 623, 623, 623, 623, 623, 623, + 623, 623, 623, 0, 0, 0, 0, 621, 0, 0, + 0, 0, 0, 0, 623, 0, 623, 0, 623, 0, + 623, 623, 623, 0, 0, 0, 0, 0, 0, 0, + 0, 623, 0, 0, 0, 623, 623, 0, 627, 0, + 0, 0, 0, 0, 0, 0, 623, 623, 0, 0, + 0, 0, 0, 624, 0, 0, 0, 0, 624, 623, + 624, 624, 624, 624, 624, 624, 624, 624, 624, 624, + 624, 0, 0, 0, 0, 623, 0, 0, 0, 0, + 0, 0, 624, 0, 624, 0, 624, 0, 624, 624, + 624, 0, 0, 0, 0, 0, 0, 0, 0, 624, + 0, 0, 0, 624, 624, 0, 629, 0, 0, 0, + 0, 0, 0, 0, 624, 624, 0, 0, 0, 0, + 0, 627, 0, 0, 0, 0, 627, 624, 627, 627, + 627, 627, 627, 627, 627, 627, 627, 627, 627, 0, + 0, 0, 0, 624, 0, 0, 0, 0, 0, 0, + 627, 0, 627, 0, 627, 0, 627, 627, 627, 0, + 0, 0, 0, 0, 0, 0, 0, 627, 0, 0, + 0, 0, 627, 0, 630, 0, 0, 0, 0, 0, + 0, 0, 627, 627, 0, 0, 0, 0, 0, 629, + 0, 0, 0, 0, 629, 627, 629, 629, 629, 629, + 629, 629, 629, 629, 629, 629, 629, 0, 0, 0, + 0, 627, 0, 0, 0, 0, 0, 0, 629, 0, + 629, 0, 629, 0, 629, 629, 629, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 629, 0, 632, 0, 0, 0, 0, 0, 0, 0, + 629, 629, 0, 0, 0, 0, 0, 630, 0, 0, + 0, 0, 630, 629, 630, 630, 630, 630, 630, 630, + 630, 630, 630, 630, 630, 0, 0, 0, 0, 629, + 0, 0, 0, 0, 0, 0, 630, 0, 630, 0, + 630, 0, 630, 630, 630, 0, 0, 0, 633, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 630, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 630, 630, + 0, 0, 0, 0, 0, 632, 0, 0, 0, 0, + 632, 630, 632, 632, 632, 632, 632, 632, 632, 632, + 632, 632, 632, 0, 0, 0, 0, 630, 0, 0, + 0, 0, 0, 0, 632, 0, 632, 0, 632, 0, + 632, 632, 632, 0, 0, 0, 0, 347, 0, 0, + 0, 811, 0, 0, 0, 0, 632, 0, 0, 0, + 0, 633, 0, 0, 0, 0, 633, 632, 633, 633, + 633, 633, 633, 633, 633, 633, 633, 633, 633, 632, + 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, + 633, 0, 633, 0, 633, 632, 633, 633, 633, 811, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 633, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 633, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 633, 0, 0, 0, 0, + 0, 0, 347, 0, 0, 0, 0, 0, 347, 0, + 0, 633, 0, 347, 347, 0, 347, 0, 347, 0, + 811, 347, 0, 347, 347, 0, 347, 347, 347, 347, + 347, 347, 347, 347, 347, 347, 0, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, - 0, 0, 572, 0, 347, 0, 347, 0, 0, 347, - 56, 24, 57, 25, 1130, 347, 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, 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, 0, - 87, 88, 0, 0, 0, 0, 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, 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, 0, - 0, 55, 0, 105, 573, 107, 108, 0, 1131, 56, - 24, 57, 25, 0, 0, 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, 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, 0, 87, - 88, 0, 0, 0, 0, 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, - 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, 266, 0, - 0, 0, 105, 106, 107, 108, 56, 24, 57, 25, - 0, 0, 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, 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, 0, 87, 88, 0, 0, - 0, 0, 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, 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, 572, 0, 0, 0, 105, - 106, 107, 108, 56, 24, 57, 25, 0, 0, 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, 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, 0, 87, 88, 0, 0, 0, 0, 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, 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, 1007, 0, 0, 0, 105, 573, 107, 108, - 1007, 1007, 1007, 1007, 0, 0, 1007, 1007, 0, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 0, 0, 0, 0, - 0, 1007, 0, 1007, 1007, 1007, 1007, 1007, 1007, 0, - 0, 1007, 0, 0, 0, 1007, 1007, 0, 1007, 1007, - 1007, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1007, 0, 1007, 0, 1007, 1007, 0, 0, 1007, 0, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 0, 1007, 0, 0, 1007, 1007, 0, 0, - 1007, 1007, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1007, 1007, 1007, 1007, 1007, - 0, 0, 0, 1007, 0, 0, 0, 1007, 0, 0, - 0, 0, 1007, 1007, 1007, 1007, 1007, 0, 0, 0, - 1007, 0, 1007, 0, 0, 0, 0, 0, 1007, 1007, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 613, - 0, 0, 0, 1007, 1007, 1007, 1007, 56, 24, 0, - 25, 0, 0, 26, 254, 0, 0, 0, 27, 61, - 62, 0, 28, 0, 0, 182, 0, 182, 64, 0, - 182, 30, 0, 0, 0, 182, 0, 0, 32, 182, - 0, 0, 0, 33, 0, 71, 72, 34, 182, 614, - 0, 0, 0, 0, 0, 182, 615, 0, 0, 36, - 182, 37, 74, 0, 182, 38, 0, 0, 76, 0, - 78, 0, 80, 39, 40, 255, 182, 41, 182, 0, - 0, 0, 182, 0, 616, 0, 0, 87, 88, 0, - 182, 182, 0, 0, 182, 0, 0, 182, 0, 0, - 0, 0, 89, 90, 91, 92, 93, 0, 0, 0, - 0, 0, 0, 0, 95, 0, 0, 617, 0, 0, - 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, - 0, 0, 1031, 0, 0, 103, 104, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 786, 0, 0, 0, - 105, 106, 107, 108, 56, 24, 0, 25, 0, 0, - 26, 254, 0, 0, 0, 27, 61, 62, 182, 28, - 0, 0, 182, 0, 182, 64, 0, 182, 30, 0, - 0, 0, 182, 0, 0, 32, 182, 0, 0, 0, - 33, 0, 71, 72, 34, 182, 0, 0, 0, 0, - 0, 0, 182, 0, 0, 0, 36, 182, 37, 74, - 0, 182, 38, 0, 0, 76, 0, 78, 0, 80, - 39, 40, 255, 182, 41, 182, 0, 0, 0, 182, - 0, 86, 0, 0, 87, 88, 0, 182, 182, 0, - 0, 182, 0, 0, 182, 0, 0, 0, 0, 89, - 90, 91, 92, 302, 0, 0, 0, 531, 787, 0, - 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, - 100, 0, 0, 0, 101, 0, 102, 1031, 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, 977, 0, 0, 0, 105, 303, 107, - 108, 56, 24, 0, 25, 0, 0, 26, 254, 0, - 0, 0, 27, 61, 62, 182, 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, 614, 0, 0, 0, 0, 0, 32, - 615, 0, 0, 36, 33, 37, 74, 0, 34, 38, - 0, 0, 76, 0, 78, 0, 80, 39, 40, 255, - 36, 41, 37, 0, 0, 0, 38, 0, 616, 0, - 0, 87, 88, 0, 39, 40, 0, 0, 41, 0, - 0, 324, 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, 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, - 786, 0, 0, 0, 105, 106, 107, 108, 56, 24, - 0, 25, 0, 0, 26, 254, 0, 0, 0, 27, - 61, 62, 368, 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, 983, 34, 38, 0, 0, 76, - 0, 78, 0, 80, 39, 40, 255, 36, 41, 37, - 0, 0, 0, 38, 0, 86, 0, 0, 87, 88, - 0, 39, 40, 0, 0, 41, 0, 0, 533, 0, - 0, 0, 0, 89, 90, 91, 92, 302, 0, 0, - 0, 531, 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, 56, 24, 0, 25, 0, 0, - 26, 254, 0, 0, 0, 27, 61, 62, 0, 28, - 0, 105, 303, 107, 108, 64, 0, 0, 30, 0, - 0, 0, 0, 0, 0, 32, 0, 0, 0, 368, - 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, 40, 255, 0, 41, 0, 0, 0, 0, 0, - 0, 86, 0, 0, 87, 88, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, - 90, 91, 92, 769, 0, 0, 0, 770, 1051, 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, - 56, 24, 0, 25, 0, 0, 26, 254, 0, 0, - 0, 27, 61, 62, 0, 28, 0, 105, 771, 107, - 108, 64, 0, 0, 30, 0, 0, 0, 772, 0, - 0, 32, 0, 0, 0, 0, 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, 40, 255, 0, - 41, 0, 0, 0, 0, 0, 0, 86, 0, 0, - 87, 88, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 89, 90, 91, 92, 769, - 0, 0, 0, 770, 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, 0, - 0, 786, 0, 105, 771, 107, 108, 0, 0, 56, - 24, 0, 25, 0, 772, 26, 254, 0, 0, 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, 255, 36, 41, - 37, 0, 0, 0, 38, 0, 86, 0, 0, 87, - 88, 0, 39, 40, 0, 0, 41, 0, 0, 589, - 0, 0, 0, 0, 89, 90, 91, 92, 302, 0, - 0, 0, 531, 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, 778, 0, - 0, 0, 105, 303, 107, 108, 56, 24, 0, 25, - 0, 0, 26, 254, 0, 0, 0, 27, 61, 62, - 368, 28, 0, 0, 24, 0, 25, 64, 0, 26, + 347, 347, 347, 347, 347, 347, 347, 347, 347, 0, + 0, 584, 0, 347, 0, 347, 0, 0, 347, 57, + 24, 58, 25, 1149, 347, 26, 59, 0, 60, 61, + 27, 62, 63, 64, 28, 0, 0, 0, 0, 0, + 65, 0, 66, 30, 67, 68, 69, 70, 0, 0, + 32, 0, 0, 0, 71, 33, 0, 72, 73, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 0, 36, 0, 37, 75, 0, 0, 38, 0, 76, + 77, 78, 79, 80, 81, 39, 40, 82, 83, 41, + 84, 0, 85, 0, 0, 86, 87, 0, 0, 88, + 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 90, 91, 92, 93, 94, 0, + 0, 0, 95, 0, 0, 0, 96, 0, 0, 0, + 0, 97, 98, 99, 100, 101, 0, 0, 0, 102, + 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 56, 0, 106, 585, 108, 109, 0, 1150, 57, 24, + 58, 25, 0, 0, 26, 59, 0, 60, 61, 27, + 62, 63, 64, 28, 0, 0, 0, 0, 0, 65, + 0, 66, 30, 67, 68, 69, 70, 0, 0, 32, + 0, 0, 0, 71, 33, 0, 72, 73, 34, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 74, 0, + 36, 0, 37, 75, 0, 0, 38, 0, 76, 77, + 78, 79, 80, 81, 39, 40, 82, 83, 41, 84, + 0, 85, 0, 0, 86, 87, 0, 0, 88, 89, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, + 0, 95, 0, 0, 0, 96, 0, 0, 0, 0, + 97, 98, 99, 100, 101, 0, 0, 0, 102, 0, + 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 269, 0, 0, + 0, 106, 107, 108, 109, 57, 24, 58, 25, 0, + 0, 26, 59, 0, 60, 61, 27, 62, 63, 64, + 28, 0, 0, 0, 0, 0, 65, 0, 66, 30, + 67, 68, 69, 70, 0, 0, 32, 0, 0, 0, + 71, 33, 0, 72, 73, 34, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 74, 0, 36, 0, 37, + 75, 0, 0, 38, 0, 76, 77, 78, 79, 80, + 81, 39, 40, 82, 83, 41, 84, 0, 85, 0, + 0, 86, 87, 0, 0, 88, 89, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 90, 91, 92, 93, 94, 0, 0, 0, 95, 0, + 0, 0, 96, 0, 0, 0, 0, 97, 98, 99, + 100, 101, 0, 0, 0, 102, 0, 103, 0, 0, + 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 584, 0, 0, 0, 106, 107, + 108, 109, 57, 24, 58, 25, 0, 0, 26, 59, + 0, 60, 61, 27, 62, 63, 64, 28, 0, 0, + 0, 0, 0, 65, 0, 66, 30, 67, 68, 69, + 70, 0, 0, 32, 0, 0, 0, 71, 33, 0, + 72, 73, 34, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 74, 0, 36, 0, 37, 75, 0, 0, + 38, 0, 76, 77, 78, 79, 80, 81, 39, 40, + 82, 83, 41, 84, 0, 85, 0, 0, 86, 87, + 0, 0, 88, 89, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, + 93, 94, 0, 0, 0, 95, 0, 0, 0, 96, + 0, 0, 0, 0, 97, 98, 99, 100, 101, 0, + 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, + 104, 105, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1024, 0, 0, 0, 106, 585, 108, 109, 1024, + 1024, 1024, 1024, 0, 0, 1024, 1024, 0, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 0, 0, 0, 0, 0, + 1024, 0, 1024, 1024, 1024, 1024, 1024, 1024, 0, 0, + 1024, 0, 0, 0, 1024, 1024, 0, 1024, 1024, 1024, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, + 0, 1024, 0, 1024, 1024, 0, 0, 1024, 0, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 0, 1024, 0, 0, 1024, 1024, 0, 0, 1024, + 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1024, 1024, 1024, 1024, 1024, 0, + 0, 0, 1024, 0, 0, 0, 1024, 0, 0, 0, + 0, 1024, 1024, 1024, 1024, 1024, 0, 0, 0, 1024, + 0, 1024, 0, 0, 0, 0, 0, 1024, 1024, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 625, 0, + 0, 0, 1024, 1024, 1024, 1024, 57, 24, 0, 25, + 0, 0, 26, 256, 0, 968, 0, 27, 62, 63, + 0, 28, 0, 0, 24, 0, 25, 65, 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, 255, 36, 41, 37, 0, 0, - 0, 38, 0, 86, 0, 0, 87, 88, 0, 39, - 40, 0, 0, 41, 0, 0, 802, 0, 0, 0, - 0, 89, 90, 91, 92, 302, 0, 0, 0, 0, - 935, 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, 980, 0, 0, 0, 105, - 303, 107, 108, 56, 24, 0, 25, 0, 0, 26, - 254, 0, 0, 0, 27, 61, 62, 368, 28, 0, - 0, 502, 0, 502, 64, 0, 502, 30, 0, 0, - 0, 502, 0, 0, 32, 502, 0, 0, 0, 33, - 0, 71, 72, 34, 502, 0, 0, 0, 0, 0, - 0, 502, 0, 0, 0, 36, 502, 37, 74, 0, - 502, 38, 0, 0, 76, 0, 78, 0, 80, 39, - 40, 255, 502, 41, 502, 0, 0, 0, 502, 0, - 86, 0, 0, 87, 88, 0, 502, 502, 0, 0, - 502, 0, 0, 502, 0, 0, 0, 0, 89, 90, - 91, 92, 302, 0, 0, 0, 0, 981, 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, 301, 0, 0, 0, 105, 303, 107, 108, - 56, 24, 0, 25, 0, 0, 26, 254, 0, 0, - 0, 27, 61, 62, 502, 28, 0, 0, 183, 0, - 183, 64, 0, 183, 30, 0, 0, 0, 183, 0, - 0, 32, 183, 0, 0, 0, 33, 0, 71, 72, - 34, 183, 0, 0, 0, 0, 0, 0, 183, 0, - 0, 0, 36, 183, 37, 74, 0, 183, 38, 0, - 0, 76, 0, 78, 0, 80, 39, 40, 255, 183, - 41, 183, 0, 0, 0, 183, 0, 86, 0, 0, - 87, 88, 0, 183, 183, 0, 0, 183, 0, 0, - 183, 0, 0, 0, 0, 89, 90, 91, 92, 302, - 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, 310, - 0, 0, 0, 105, 303, 107, 108, 56, 24, 0, - 25, 0, 0, 26, 254, 0, 0, 0, 27, 61, - 62, 183, 28, 0, 0, 182, 0, 182, 64, 0, + 0, 0, 33, 0, 72, 73, 34, 30, 626, 0, + 0, 0, 0, 0, 32, 627, 0, 0, 36, 33, + 37, 75, 0, 34, 38, 0, 0, 77, 0, 79, + 0, 81, 39, 40, 257, 36, 41, 37, 0, 0, + 0, 38, 0, 628, 0, 0, 88, 89, 0, 39, + 40, 0, 0, 41, 0, 0, 327, 0, 0, 0, + 0, 90, 91, 92, 93, 94, 0, 0, 0, 0, + 0, 0, 0, 96, 0, 0, 629, 0, 0, 98, + 99, 100, 101, 0, 0, 0, 102, 0, 103, 0, + 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 800, 0, 0, 0, 106, + 107, 108, 109, 57, 24, 0, 25, 0, 0, 26, + 256, 0, 1121, 0, 27, 62, 63, 374, 28, 0, + 0, 24, 0, 25, 65, 0, 26, 30, 0, 0, + 0, 27, 0, 0, 32, 28, 0, 0, 0, 33, + 0, 72, 73, 34, 30, 0, 0, 0, 0, 0, + 0, 32, 0, 0, 0, 36, 33, 37, 75, 0, + 34, 38, 0, 0, 77, 0, 79, 0, 81, 39, + 40, 257, 36, 41, 37, 0, 0, 0, 38, 0, + 87, 0, 0, 88, 89, 0, 39, 40, 0, 0, + 41, 0, 0, 327, 0, 0, 0, 0, 90, 91, + 92, 93, 305, 0, 0, 0, 540, 801, 0, 0, + 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, + 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, + 0, 104, 105, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 995, 0, 0, 0, 106, 306, 108, 109, + 57, 24, 0, 25, 0, 0, 26, 256, 0, 0, + 0, 27, 62, 63, 374, 28, 0, 0, 182, 0, + 182, 65, 0, 182, 30, 0, 0, 0, 182, 0, + 0, 32, 182, 0, 0, 0, 33, 0, 72, 73, + 34, 182, 626, 0, 0, 0, 0, 0, 182, 627, + 0, 0, 36, 182, 37, 75, 0, 182, 38, 0, + 0, 77, 0, 79, 0, 81, 39, 40, 257, 182, + 41, 182, 0, 0, 0, 182, 0, 628, 0, 0, + 88, 89, 0, 182, 182, 0, 0, 182, 0, 0, + 182, 0, 0, 0, 0, 90, 91, 92, 93, 94, + 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, + 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, + 102, 0, 103, 0, 0, 1049, 0, 0, 104, 105, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 800, + 0, 0, 0, 106, 107, 108, 109, 57, 24, 0, + 25, 0, 0, 26, 256, 0, 0, 0, 27, 62, + 63, 182, 28, 0, 0, 182, 0, 182, 65, 0, 182, 30, 0, 0, 0, 182, 0, 0, 32, 182, - 0, 0, 0, 33, 0, 71, 72, 34, 182, 0, + 0, 0, 0, 33, 0, 72, 73, 34, 182, 0, 0, 0, 0, 0, 0, 182, 0, 0, 0, 36, - 182, 37, 74, 0, 182, 38, 0, 0, 76, 0, - 78, 0, 80, 39, 40, 255, 182, 41, 182, 0, - 0, 0, 182, 0, 86, 0, 0, 87, 88, 0, + 182, 37, 75, 1001, 182, 38, 0, 0, 77, 0, + 79, 0, 81, 39, 40, 257, 182, 41, 182, 0, + 0, 0, 182, 0, 87, 0, 0, 88, 89, 0, 182, 182, 0, 0, 182, 0, 0, 182, 0, 0, - 0, 0, 89, 90, 91, 92, 302, 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, 611, 0, 0, 0, - 105, 303, 107, 108, 56, 24, 0, 25, 0, 0, - 26, 254, 0, 0, 0, 27, 61, 62, 182, 28, - 0, 0, 192, 0, 192, 64, 0, 192, 30, 0, - 0, 0, 192, 0, 0, 32, 192, 0, 0, 0, - 33, 0, 71, 72, 34, 192, 0, 0, 0, 0, - 0, 0, 192, 0, 0, 0, 36, 192, 37, 74, - 0, 192, 38, 0, 0, 76, 0, 78, 0, 80, - 39, 40, 255, 192, 41, 192, 0, 0, 0, 192, - 0, 86, 0, 0, 87, 88, 0, 192, 192, 0, - 0, 192, 0, 0, 192, 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, 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, 778, 0, 0, 0, 105, 106, 107, - 108, 56, 24, 0, 25, 0, 0, 26, 254, 0, - 0, 0, 27, 61, 62, 192, 28, 0, 0, 0, - 0, 0, 64, 0, 0, 30, 0, 0, 0, 0, - 0, 0, 32, 0, 0, 0, 0, 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, 40, 255, - 0, 41, 0, 0, 0, 0, 0, 0, 86, 0, - 0, 87, 88, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 89, 90, 91, 92, - 302, 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, - 1093, 0, 0, 0, 105, 303, 107, 108, 56, 24, - 0, 25, 0, 0, 26, 254, 0, 0, 0, 27, - 61, 62, 0, 28, 0, 0, 0, 0, 0, 64, + 0, 0, 90, 91, 92, 93, 305, 0, 0, 0, + 540, 0, 0, 0, 96, 0, 0, 0, 0, 0, + 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, + 1049, 0, 0, 0, 0, 104, 105, 0, 0, 0, + 0, 0, 0, 57, 24, 0, 25, 0, 0, 26, + 256, 0, 0, 0, 27, 62, 63, 0, 28, 0, + 106, 306, 108, 109, 65, 0, 0, 30, 0, 0, + 0, 0, 0, 0, 32, 0, 0, 0, 182, 33, + 0, 72, 73, 34, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 36, 0, 37, 75, 0, + 0, 38, 0, 0, 77, 0, 79, 0, 81, 39, + 40, 257, 0, 41, 0, 0, 0, 0, 0, 0, + 87, 0, 0, 88, 89, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, + 92, 93, 783, 0, 0, 0, 784, 1069, 0, 0, + 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, + 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, + 0, 104, 105, 0, 0, 0, 0, 0, 0, 57, + 24, 0, 25, 0, 0, 26, 256, 0, 0, 0, + 27, 62, 63, 0, 28, 0, 106, 785, 108, 109, + 65, 0, 0, 30, 0, 0, 0, 786, 0, 0, + 32, 0, 0, 0, 0, 33, 0, 72, 73, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 36, 0, 37, 75, 0, 0, 38, 0, 0, + 77, 0, 79, 0, 81, 39, 40, 257, 0, 41, + 0, 0, 0, 0, 0, 0, 87, 0, 0, 88, + 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 90, 91, 92, 93, 783, 0, + 0, 0, 784, 0, 0, 0, 96, 0, 0, 0, + 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, + 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 800, 0, 106, 785, 108, 109, 0, 0, 57, 24, + 0, 25, 0, 786, 26, 256, 0, 0, 0, 27, + 62, 63, 0, 28, 0, 0, 0, 0, 0, 65, 0, 0, 30, 0, 0, 0, 0, 0, 0, 32, - 0, 0, 0, 0, 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, 40, 255, 0, 41, 0, - 0, 0, 0, 0, 0, 86, 0, 0, 87, 88, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 1238, 0, 0, - 0, 105, 1094, 107, 108, 56, 24, 0, 25, 0, - 0, 26, 254, 0, 0, 0, 27, 61, 62, 0, - 28, 0, 0, 0, 0, 0, 64, 0, 0, 30, - 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, - 0, 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, 40, 255, 0, 41, 0, 0, 0, 0, - 0, 0, 86, 0, 0, 87, 88, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 89, 90, 91, 92, 302, 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, 83, 0, 0, 0, 105, 303, - 107, 108, 83, 83, 0, 83, 0, 0, 83, 83, - 0, 0, 0, 83, 83, 83, 0, 83, 0, 0, - 0, 0, 0, 83, 0, 0, 83, 0, 0, 0, - 0, 0, 0, 83, 0, 0, 0, 0, 83, 0, - 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 83, 0, 83, 83, 0, 0, - 83, 0, 0, 83, 0, 83, 0, 83, 83, 83, - 83, 0, 83, 0, 0, 0, 0, 0, 0, 83, - 0, 0, 83, 83, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 83, 83, 83, - 83, 83, 0, 0, 0, 0, 0, 0, 0, 83, - 0, 0, 0, 0, 0, 83, 83, 83, 83, 0, - 0, 0, 83, 0, 83, 0, 0, 0, 0, 0, - 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 340, 0, 0, 0, 83, 83, 83, 83, 56, - 24, 0, 25, 0, 0, 26, 254, 0, 0, 0, - 27, 61, 62, 0, 28, 0, 0, 0, 0, 0, - 64, 0, 0, 30, 0, 0, 0, 0, 0, 0, - 32, 0, 0, 0, 0, 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, 40, 255, 0, 41, - 0, 0, 0, 0, 0, 0, 0, 0, 341, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 89, 90, 91, 256, 342, 0, - 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 97, 98, 99, 100, 934, 0, 0, 101, - 0, 102, 340, 0, 0, 0, 0, 103, 104, 0, - 56, 24, 0, 25, 0, 0, 26, 254, 0, 0, - 0, 27, 61, 62, 0, 28, 0, 0, 0, 0, - 0, 64, 105, 257, 30, 108, 0, 0, 0, 0, - 0, 32, 0, 0, 0, 0, 33, 0, 71, 72, + 0, 0, 0, 0, 33, 0, 72, 73, 34, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 37, 75, 0, 0, 38, 0, 0, 77, + 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, + 0, 0, 0, 0, 0, 87, 0, 0, 88, 89, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 90, 91, 92, 93, 305, 0, 0, + 0, 540, 0, 0, 0, 96, 0, 0, 0, 0, + 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, + 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 343, + 0, 106, 306, 108, 109, 344, 0, 57, 24, 0, + 25, 0, 0, 26, 256, 0, 0, 0, 27, 62, + 63, 0, 28, 0, 0, 0, 0, 0, 65, 0, + 0, 30, 0, 0, 0, 0, 0, 0, 32, 0, + 0, 345, 0, 33, 0, 72, 73, 34, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, + 0, 37, 75, 0, 0, 38, 0, 0, 77, 0, + 79, 0, 81, 39, 40, 257, 0, 41, 0, 0, + 0, 0, 0, 0, 0, 0, 346, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 90, 91, 92, 258, 347, 0, 0, 0, + 0, 0, 0, 0, 96, 0, 348, 0, 0, 0, + 98, 99, 100, 101, 950, 0, 0, 102, 0, 103, + 792, 0, 0, 0, 0, 104, 105, 0, 57, 24, + 0, 25, 0, 0, 26, 256, 0, 0, 0, 27, + 62, 63, 0, 28, 0, 0, 0, 0, 0, 65, + 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, + 0, 0, 0, 0, 33, 0, 72, 73, 34, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 37, 75, 0, 0, 38, 0, 0, 77, + 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, + 0, 0, 0, 0, 0, 87, 0, 0, 88, 89, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 90, 91, 92, 93, 305, 0, 0, + 0, 0, 951, 0, 0, 96, 0, 0, 0, 0, + 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, + 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 998, 0, 0, + 0, 106, 306, 108, 109, 57, 24, 0, 25, 0, + 0, 26, 256, 0, 0, 0, 27, 62, 63, 0, + 28, 0, 0, 24, 0, 25, 65, 0, 26, 30, + 0, 0, 0, 27, 0, 0, 32, 28, 0, 0, + 0, 33, 0, 72, 73, 34, 30, 0, 0, 0, + 0, 0, 0, 32, 0, 0, 0, 36, 33, 37, + 75, 0, 34, 38, 0, 0, 77, 0, 79, 0, + 81, 39, 40, 257, 36, 41, 37, 0, 0, 0, + 38, 0, 87, 0, 0, 88, 89, 0, 39, 40, + 0, 0, 41, 0, 0, 327, 0, 0, 0, 0, + 90, 91, 92, 93, 305, 0, 0, 0, 0, 999, + 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, + 100, 101, 0, 0, 0, 102, 0, 103, 0, 0, + 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 304, 0, 0, 0, 106, 306, + 108, 109, 57, 24, 0, 25, 0, 0, 26, 256, + 0, 0, 0, 27, 62, 63, 374, 28, 0, 0, + 24, 0, 25, 65, 0, 26, 30, 0, 0, 0, + 27, 0, 0, 32, 28, 0, 0, 0, 33, 0, + 72, 73, 34, 30, 0, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 36, 33, 37, 75, 0, 34, + 38, 0, 0, 77, 0, 79, 0, 81, 39, 40, + 257, 36, 41, 37, 0, 0, 0, 38, 0, 87, + 0, 0, 88, 89, 0, 39, 40, 0, 0, 41, + 0, 0, 542, 0, 0, 0, 0, 90, 91, 92, + 93, 305, 0, 0, 0, 0, 0, 0, 0, 96, + 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, + 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, + 104, 105, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 313, 0, 0, 0, 106, 306, 108, 109, 57, + 24, 0, 25, 0, 0, 26, 256, 0, 0, 0, + 27, 62, 63, 374, 28, 0, 0, 0, 0, 0, + 65, 0, 0, 30, 0, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 0, 33, 0, 72, 73, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 36, 0, 37, 75, 0, 0, 38, 0, 0, + 77, 0, 79, 0, 81, 39, 40, 257, 0, 41, + 0, 0, 0, 0, 0, 0, 87, 0, 0, 88, + 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 90, 91, 92, 93, 305, 0, + 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, + 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, + 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 343, 0, 106, 306, 108, 109, 344, 0, 57, 24, + 0, 25, 0, 0, 26, 256, 0, 0, 0, 27, + 62, 63, 0, 28, 0, 0, 0, 0, 0, 65, + 0, 0, 30, 0, 0, 0, 0, 0, 0, 32, + 0, 0, 345, 0, 33, 0, 72, 73, 34, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 37, 75, 0, 0, 38, 0, 0, 77, + 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, + 0, 0, 0, 0, 0, 0, 0, 346, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 90, 91, 92, 258, 347, 0, 0, + 0, 0, 0, 0, 0, 96, 0, 348, 0, 0, + 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, + 103, 623, 0, 0, 0, 0, 104, 105, 0, 57, + 24, 0, 25, 0, 0, 26, 256, 0, 0, 0, + 27, 62, 63, 0, 28, 0, 0, 0, 0, 0, + 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 0, 33, 0, 72, 73, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 36, 0, 37, 75, 0, 0, 38, 0, 0, + 77, 0, 79, 0, 81, 39, 40, 257, 0, 41, + 0, 0, 0, 0, 0, 0, 87, 0, 0, 88, + 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 90, 91, 92, 93, 94, 0, + 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, + 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, + 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 792, 0, + 0, 0, 106, 107, 108, 109, 57, 24, 0, 25, + 0, 0, 26, 256, 0, 0, 0, 27, 62, 63, + 0, 28, 0, 0, 24, 0, 25, 65, 0, 26, + 30, 0, 0, 0, 27, 0, 0, 32, 28, 0, + 0, 0, 33, 0, 72, 73, 34, 30, 0, 0, + 0, 0, 0, 0, 32, 0, 0, 0, 36, 33, + 37, 75, 0, 34, 38, 0, 0, 77, 0, 79, + 0, 81, 39, 40, 257, 36, 41, 37, 0, 0, + 0, 38, 0, 87, 0, 0, 88, 89, 0, 39, + 40, 0, 0, 41, 0, 0, 601, 0, 0, 0, + 0, 90, 91, 92, 93, 305, 0, 0, 0, 0, + 0, 0, 0, 96, 0, 0, 0, 0, 0, 98, + 99, 100, 101, 0, 0, 0, 102, 0, 103, 0, + 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1112, 0, 0, 0, 106, + 306, 108, 109, 57, 24, 0, 25, 0, 0, 26, + 256, 0, 0, 0, 27, 62, 63, 374, 28, 0, + 0, 24, 0, 25, 65, 0, 26, 30, 0, 0, + 0, 27, 0, 0, 32, 28, 0, 0, 0, 33, + 0, 72, 73, 34, 30, 0, 0, 0, 0, 0, + 0, 32, 0, 0, 0, 36, 33, 37, 75, 0, + 34, 38, 0, 0, 77, 0, 79, 0, 81, 39, + 40, 257, 36, 41, 37, 0, 0, 0, 38, 0, + 87, 0, 0, 88, 89, 0, 39, 40, 0, 0, + 41, 0, 0, 817, 0, 0, 0, 0, 90, 91, + 92, 93, 94, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, + 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, + 0, 104, 105, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1264, 0, 0, 0, 106, 1113, 108, 109, + 57, 24, 0, 25, 0, 0, 26, 256, 0, 0, + 0, 27, 62, 63, 374, 28, 0, 0, 503, 0, + 503, 65, 0, 503, 30, 0, 0, 0, 503, 0, + 0, 32, 503, 0, 0, 0, 33, 0, 72, 73, + 34, 503, 0, 0, 0, 0, 0, 0, 503, 0, + 0, 0, 36, 503, 37, 75, 0, 503, 38, 0, + 0, 77, 0, 79, 0, 81, 39, 40, 257, 503, + 41, 503, 0, 0, 0, 503, 0, 87, 0, 0, + 88, 89, 0, 503, 503, 0, 0, 503, 0, 0, + 503, 0, 0, 0, 0, 90, 91, 92, 93, 305, + 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, + 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, + 102, 0, 103, 0, 0, 0, 0, 0, 104, 105, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, + 0, 0, 0, 106, 306, 108, 109, 83, 83, 0, + 83, 0, 0, 83, 83, 0, 0, 0, 83, 83, + 83, 503, 83, 0, 0, 0, 0, 0, 83, 0, + 0, 83, 0, 0, 0, 0, 0, 0, 83, 0, + 0, 0, 0, 83, 0, 83, 83, 83, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, + 0, 83, 83, 0, 0, 83, 0, 0, 83, 0, + 83, 0, 83, 83, 83, 83, 0, 83, 0, 0, + 0, 0, 0, 0, 83, 0, 0, 83, 83, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 83, 83, 83, 83, 83, 0, 0, 0, + 0, 0, 0, 0, 83, 0, 0, 0, 0, 0, + 83, 83, 83, 83, 0, 0, 0, 83, 0, 83, + 0, 0, 0, 0, 0, 83, 83, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 343, 0, + 83, 83, 83, 83, 344, 0, 57, 24, 0, 25, + 0, 0, 26, 256, 0, 0, 0, 27, 62, 63, + 0, 28, 0, 0, 0, 0, 0, 65, 0, 0, + 30, 0, 0, 0, 0, 0, 0, 32, 0, 0, + 345, 0, 33, 0, 72, 73, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, + 37, 75, 0, 0, 38, 0, 0, 77, 0, 79, + 0, 81, 39, 40, 257, 0, 41, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 90, 91, 92, 258, 347, 0, 0, 0, 0, + 0, 0, 0, 96, 0, 348, 0, 0, 0, 98, + 99, 100, 101, 0, 0, 0, 102, 0, 103, 343, + 0, 0, 0, 0, 104, 105, 0, 57, 24, 0, + 25, 0, 0, 26, 256, 0, 0, 0, 27, 62, + 63, 0, 28, 0, 0, 0, 0, 0, 65, 106, + 260, 30, 109, 0, 0, 0, 0, 0, 32, 0, + 0, 0, 0, 33, 0, 72, 73, 34, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, + 0, 37, 75, 0, 0, 38, 0, 0, 77, 0, + 79, 0, 81, 39, 40, 257, 0, 41, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 90, 91, 92, 258, 347, 0, 0, 0, + 0, 0, 0, 0, 96, 0, 348, 0, 0, 0, + 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, + 352, 0, 0, 0, 0, 104, 105, 0, 57, 24, + 0, 25, 0, 0, 26, 256, 0, 0, 0, 27, + 62, 63, 0, 28, 0, 0, 0, 0, 0, 65, + 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, + 0, 0, 0, 0, 33, 0, 72, 73, 34, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 37, 75, 0, 0, 38, 0, 0, 77, + 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 90, 91, 92, 258, 347, 0, 0, + 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, + 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, + 103, 354, 0, 0, 0, 0, 104, 105, 0, 57, + 24, 0, 25, 0, 0, 26, 256, 0, 0, 0, + 27, 62, 63, 0, 28, 0, 0, 0, 0, 0, + 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 0, 33, 0, 72, 73, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 36, 0, 37, 75, 0, 0, 38, 0, 0, + 77, 0, 79, 0, 81, 39, 40, 257, 0, 41, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 90, 91, 92, 258, 347, 0, + 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, + 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, + 0, 103, 356, 0, 0, 0, 0, 104, 105, 0, + 57, 24, 0, 25, 0, 0, 26, 256, 0, 0, + 0, 27, 62, 63, 0, 28, 0, 0, 0, 0, + 0, 65, 106, 260, 30, 109, 0, 0, 0, 0, + 0, 32, 0, 0, 0, 0, 33, 0, 72, 73, 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, 40, 255, 0, - 41, 0, 0, 0, 0, 0, 0, 0, 0, 341, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 89, 90, 91, 256, 342, - 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, - 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, - 101, 0, 102, 346, 0, 0, 0, 0, 103, 104, - 0, 56, 24, 0, 25, 0, 0, 26, 254, 0, - 0, 0, 27, 61, 62, 0, 28, 0, 0, 0, - 0, 0, 64, 105, 257, 30, 108, 0, 0, 0, - 0, 0, 32, 0, 0, 0, 0, 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, 40, 255, + 0, 0, 36, 0, 37, 75, 0, 0, 38, 0, + 0, 77, 0, 79, 0, 81, 39, 40, 257, 0, + 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 90, 91, 92, 258, 347, + 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, + 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, + 102, 0, 103, 358, 0, 0, 0, 0, 104, 105, + 0, 57, 24, 0, 25, 0, 0, 26, 256, 0, + 0, 0, 27, 62, 63, 0, 28, 0, 0, 0, + 0, 0, 65, 106, 260, 30, 109, 0, 0, 0, + 0, 0, 32, 0, 0, 0, 0, 33, 0, 72, + 73, 34, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 36, 0, 37, 75, 0, 0, 38, + 0, 0, 77, 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 89, 90, 91, 256, - 342, 0, 0, 0, 0, 0, 0, 0, 95, 0, - 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, - 0, 101, 0, 102, 348, 0, 0, 0, 0, 103, - 104, 0, 56, 24, 0, 25, 0, 0, 26, 254, - 0, 0, 0, 27, 61, 62, 0, 28, 0, 0, - 0, 0, 0, 64, 105, 257, 30, 108, 0, 0, + 0, 0, 0, 0, 0, 0, 90, 91, 92, 258, + 347, 0, 0, 0, 0, 0, 0, 0, 96, 0, + 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, + 0, 102, 0, 103, 360, 0, 0, 0, 0, 104, + 105, 0, 57, 24, 0, 25, 0, 0, 26, 256, + 0, 0, 0, 27, 62, 63, 0, 28, 0, 0, + 0, 0, 0, 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 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, 40, - 255, 0, 41, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 89, 90, 91, - 256, 342, 0, 0, 0, 0, 0, 0, 0, 95, - 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, - 0, 0, 101, 0, 102, 350, 0, 0, 0, 0, - 103, 104, 0, 56, 24, 0, 25, 0, 0, 26, - 254, 0, 0, 0, 27, 61, 62, 0, 28, 0, - 0, 0, 0, 0, 64, 105, 257, 30, 108, 0, + 72, 73, 34, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 36, 0, 37, 75, 0, 0, + 38, 0, 0, 77, 0, 79, 0, 81, 39, 40, + 257, 0, 41, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, + 258, 347, 0, 0, 0, 0, 0, 0, 0, 96, + 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, + 0, 0, 102, 0, 103, 362, 0, 0, 0, 0, + 104, 105, 0, 57, 24, 0, 25, 0, 0, 26, + 256, 0, 0, 0, 27, 62, 63, 0, 28, 0, + 0, 0, 0, 0, 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 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, - 40, 255, 0, 41, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 89, 90, - 91, 256, 342, 0, 0, 0, 0, 0, 0, 0, - 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, - 0, 0, 0, 101, 0, 102, 352, 0, 0, 0, - 0, 103, 104, 0, 56, 24, 0, 25, 0, 0, - 26, 254, 0, 0, 0, 27, 61, 62, 0, 28, - 0, 0, 0, 0, 0, 64, 105, 257, 30, 108, + 0, 72, 73, 34, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 36, 0, 37, 75, 0, + 0, 38, 0, 0, 77, 0, 79, 0, 81, 39, + 40, 257, 0, 41, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, + 92, 258, 347, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, + 0, 0, 0, 102, 0, 103, 364, 0, 0, 0, + 0, 104, 105, 0, 57, 24, 0, 25, 0, 0, + 26, 256, 0, 0, 0, 27, 62, 63, 0, 28, + 0, 0, 0, 0, 0, 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, - 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, 40, 255, 0, 41, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, - 90, 91, 256, 342, 0, 0, 0, 0, 0, 0, - 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, - 100, 0, 0, 0, 101, 0, 102, 354, 0, 0, - 0, 0, 103, 104, 0, 56, 24, 0, 25, 0, - 0, 26, 254, 0, 0, 0, 27, 61, 62, 0, - 28, 0, 0, 0, 0, 0, 64, 105, 257, 30, - 108, 0, 0, 0, 0, 0, 32, 0, 0, 0, - 0, 33, 0, 71, 72, 34, 0, 0, 0, 0, + 33, 0, 72, 73, 34, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 36, 0, 37, 75, + 0, 0, 38, 0, 0, 77, 0, 79, 0, 81, + 39, 40, 257, 0, 41, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, + 91, 92, 258, 347, 0, 0, 0, 0, 0, 0, + 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, + 101, 0, 0, 0, 102, 0, 103, 366, 0, 0, + 0, 0, 104, 105, 0, 57, 24, 0, 25, 0, + 0, 26, 256, 0, 0, 0, 27, 62, 63, 0, + 28, 0, 0, 0, 0, 0, 65, 106, 260, 30, + 109, 0, 0, 0, 0, 0, 32, 0, 0, 0, + 0, 33, 0, 72, 73, 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, 40, 255, 0, 41, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 89, 90, 91, 256, 342, 0, 0, 0, 0, 0, - 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, - 99, 100, 0, 0, 0, 101, 0, 102, 356, 0, - 0, 0, 0, 103, 104, 0, 56, 24, 0, 25, - 0, 0, 26, 254, 0, 0, 0, 27, 61, 62, - 0, 28, 0, 0, 0, 0, 0, 64, 105, 257, - 30, 108, 0, 0, 0, 0, 0, 32, 0, 0, - 0, 0, 33, 0, 71, 72, 34, 0, 0, 0, + 75, 0, 0, 38, 0, 0, 77, 0, 79, 0, + 81, 39, 40, 257, 0, 41, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 90, 91, 92, 258, 347, 0, 0, 0, 0, 0, + 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, + 100, 101, 0, 0, 0, 102, 0, 103, 648, 0, + 0, 0, 0, 104, 105, 0, 57, 24, 0, 25, + 0, 0, 26, 256, 0, 0, 0, 27, 62, 63, + 0, 28, 0, 0, 0, 0, 0, 65, 106, 260, + 30, 109, 0, 0, 0, 0, 0, 32, 0, 0, + 0, 0, 33, 0, 72, 73, 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, 40, 255, 0, 41, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 89, 90, 91, 256, 342, 0, 0, 0, 0, - 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, - 98, 99, 100, 0, 0, 0, 101, 0, 102, 358, - 0, 0, 0, 0, 103, 104, 0, 56, 24, 0, - 25, 0, 0, 26, 254, 0, 0, 0, 27, 61, - 62, 0, 28, 0, 0, 0, 0, 0, 64, 105, - 257, 30, 108, 0, 0, 0, 0, 0, 32, 0, - 0, 0, 0, 33, 0, 71, 72, 34, 0, 0, + 37, 75, 0, 0, 38, 0, 0, 77, 0, 79, + 0, 81, 39, 40, 257, 0, 41, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 90, 91, 92, 258, 347, 0, 0, 0, 0, + 0, 0, 0, 96, 0, 0, 0, 0, 0, 98, + 99, 100, 101, 0, 0, 0, 102, 0, 103, 650, + 0, 0, 0, 0, 104, 105, 0, 57, 24, 0, + 25, 0, 0, 26, 256, 0, 0, 0, 27, 62, + 63, 0, 28, 0, 0, 0, 0, 0, 65, 106, + 260, 30, 109, 0, 0, 0, 0, 0, 32, 0, + 0, 0, 0, 33, 0, 72, 73, 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, 40, 255, 0, 41, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 89, 90, 91, 256, 342, 0, 0, 0, - 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, - 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, - 360, 0, 0, 0, 0, 103, 104, 0, 56, 24, - 0, 25, 0, 0, 26, 254, 0, 0, 0, 27, - 61, 62, 0, 28, 0, 0, 0, 0, 0, 64, - 105, 257, 30, 108, 0, 0, 0, 0, 0, 32, - 0, 0, 0, 0, 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, 40, 255, 0, 41, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 89, 90, 91, 256, 342, 0, 0, - 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, - 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, - 102, 340, 0, 0, 0, 0, 103, 104, 0, 56, - 24, 0, 25, 0, 0, 26, 254, 0, 0, 0, - 27, 61, 62, 0, 28, 0, 0, 0, 0, 0, - 64, 105, 257, 30, 108, 0, 0, 0, 0, 0, - 32, 0, 0, 0, 0, 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, 40, 255, 0, 41, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 89, 90, 91, 256, 342, 0, - 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 97, 98, 99, 100, 0, 0, 0, 101, - 0, 102, 636, 0, 0, 0, 0, 103, 104, 0, - 56, 24, 0, 25, 0, 0, 26, 254, 0, 0, - 0, 27, 61, 62, 0, 28, 0, 0, 0, 0, - 0, 64, 105, 257, 30, 108, 0, 0, 0, 0, - 0, 32, 0, 0, 0, 0, 33, 0, 71, 72, + 0, 37, 75, 0, 0, 38, 0, 0, 77, 0, + 79, 0, 81, 39, 40, 257, 0, 41, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 90, 91, 92, 258, 347, 0, 0, 0, + 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, + 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, + 652, 0, 0, 0, 0, 104, 105, 0, 57, 24, + 0, 25, 0, 0, 26, 256, 0, 0, 0, 27, + 62, 63, 0, 28, 0, 0, 0, 0, 0, 65, + 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, + 0, 0, 0, 0, 33, 0, 72, 73, 34, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 37, 75, 0, 0, 38, 0, 0, 77, + 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 90, 91, 92, 258, 347, 0, 0, + 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, + 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, + 103, 658, 0, 0, 0, 0, 104, 105, 0, 57, + 24, 0, 25, 0, 0, 26, 256, 0, 0, 0, + 27, 62, 63, 0, 28, 0, 0, 0, 0, 0, + 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 0, 33, 0, 72, 73, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 36, 0, 37, 75, 0, 0, 38, 0, 0, + 77, 0, 79, 0, 81, 39, 40, 257, 0, 41, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 90, 91, 92, 258, 347, 0, + 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, + 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, + 0, 103, 660, 0, 0, 0, 0, 104, 105, 0, + 57, 24, 0, 25, 0, 0, 26, 256, 0, 0, + 0, 27, 62, 63, 0, 28, 0, 0, 0, 0, + 0, 65, 106, 260, 30, 109, 0, 0, 0, 0, + 0, 32, 0, 0, 0, 0, 33, 0, 72, 73, 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, 40, 255, 0, + 0, 0, 36, 0, 37, 75, 0, 0, 38, 0, + 0, 77, 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 89, 90, 91, 256, 342, - 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, - 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, - 101, 0, 102, 638, 0, 0, 0, 0, 103, 104, - 0, 56, 24, 0, 25, 0, 0, 26, 254, 0, - 0, 0, 27, 61, 62, 0, 28, 0, 0, 0, - 0, 0, 64, 105, 257, 30, 108, 0, 0, 0, - 0, 0, 32, 0, 0, 0, 0, 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, 40, 255, + 0, 0, 0, 0, 0, 90, 91, 92, 258, 347, + 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, + 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, + 102, 0, 103, 662, 0, 0, 0, 0, 104, 105, + 0, 57, 24, 0, 25, 0, 0, 26, 256, 0, + 0, 0, 27, 62, 63, 0, 28, 0, 0, 0, + 0, 0, 65, 106, 260, 30, 109, 0, 0, 0, + 0, 0, 32, 0, 0, 0, 0, 33, 0, 72, + 73, 34, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 36, 0, 37, 75, 0, 0, 38, + 0, 0, 77, 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 89, 90, 91, 256, - 342, 0, 0, 0, 0, 0, 0, 0, 95, 0, - 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, - 0, 101, 0, 102, 640, 0, 0, 0, 0, 103, - 104, 0, 56, 24, 0, 25, 0, 0, 26, 254, - 0, 0, 0, 27, 61, 62, 0, 28, 0, 0, - 0, 0, 0, 64, 105, 257, 30, 108, 0, 0, + 0, 0, 0, 0, 0, 0, 90, 91, 92, 258, + 663, 0, 0, 0, 0, 0, 0, 0, 96, 0, + 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, + 0, 102, 0, 103, 665, 0, 0, 0, 0, 104, + 105, 0, 57, 24, 0, 25, 0, 0, 26, 256, + 0, 0, 0, 27, 62, 63, 0, 28, 0, 0, + 0, 0, 0, 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 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, 40, - 255, 0, 41, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 89, 90, 91, - 256, 342, 0, 0, 0, 0, 0, 0, 0, 95, - 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, - 0, 0, 101, 0, 102, 646, 0, 0, 0, 0, - 103, 104, 0, 56, 24, 0, 25, 0, 0, 26, - 254, 0, 0, 0, 27, 61, 62, 0, 28, 0, - 0, 0, 0, 0, 64, 105, 257, 30, 108, 0, + 72, 73, 34, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 36, 0, 37, 75, 0, 0, + 38, 0, 0, 77, 0, 79, 0, 81, 39, 40, + 257, 0, 41, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, + 258, 663, 0, 0, 0, 0, 0, 0, 0, 96, + 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, + 0, 0, 102, 0, 103, 667, 0, 0, 0, 0, + 104, 105, 0, 57, 24, 0, 25, 0, 0, 26, + 256, 0, 0, 0, 27, 62, 63, 0, 28, 0, + 0, 0, 0, 0, 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 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, - 40, 255, 0, 41, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 89, 90, - 91, 256, 342, 0, 0, 0, 0, 0, 0, 0, - 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, - 0, 0, 0, 101, 0, 102, 648, 0, 0, 0, - 0, 103, 104, 0, 56, 24, 0, 25, 0, 0, - 26, 254, 0, 0, 0, 27, 61, 62, 0, 28, - 0, 0, 0, 0, 0, 64, 105, 257, 30, 108, + 0, 72, 73, 34, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 36, 0, 37, 75, 0, + 0, 38, 0, 0, 77, 0, 79, 0, 81, 39, + 40, 257, 0, 41, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, + 92, 258, 663, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, + 0, 0, 0, 102, 0, 103, 669, 0, 0, 0, + 0, 104, 105, 0, 57, 24, 0, 25, 0, 0, + 26, 256, 0, 0, 0, 27, 62, 63, 0, 28, + 0, 0, 0, 0, 0, 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, - 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, 40, 255, 0, 41, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, - 90, 91, 256, 342, 0, 0, 0, 0, 0, 0, - 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, - 100, 0, 0, 0, 101, 0, 102, 650, 0, 0, - 0, 0, 103, 104, 0, 56, 24, 0, 25, 0, - 0, 26, 254, 0, 0, 0, 27, 61, 62, 0, - 28, 0, 0, 0, 0, 0, 64, 105, 257, 30, - 108, 0, 0, 0, 0, 0, 32, 0, 0, 0, - 0, 33, 0, 71, 72, 34, 0, 0, 0, 0, + 33, 0, 72, 73, 34, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 36, 0, 37, 75, + 0, 0, 38, 0, 0, 77, 0, 79, 0, 81, + 39, 40, 257, 0, 41, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, + 91, 92, 258, 663, 0, 0, 0, 0, 0, 0, + 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, + 101, 0, 0, 0, 102, 0, 103, 671, 0, 0, + 0, 0, 104, 105, 0, 57, 24, 0, 25, 0, + 0, 26, 256, 0, 0, 0, 27, 62, 63, 0, + 28, 0, 0, 0, 0, 0, 65, 106, 260, 30, + 109, 0, 0, 0, 0, 0, 32, 0, 0, 0, + 0, 33, 0, 72, 73, 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, 40, 255, 0, 41, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 89, 90, 91, 256, 342, 0, 0, 0, 0, 0, - 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, - 99, 100, 0, 0, 0, 101, 0, 102, 652, 0, - 0, 0, 0, 103, 104, 0, 56, 24, 0, 25, - 0, 0, 26, 254, 0, 0, 0, 27, 61, 62, - 0, 28, 0, 0, 0, 0, 0, 64, 105, 257, - 30, 108, 0, 0, 0, 0, 0, 32, 0, 0, - 0, 0, 33, 0, 71, 72, 34, 0, 0, 0, + 75, 0, 0, 38, 0, 0, 77, 0, 79, 0, + 81, 39, 40, 257, 0, 41, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 90, 91, 92, 258, 663, 0, 0, 0, 0, 0, + 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, + 100, 101, 0, 0, 0, 102, 0, 103, 673, 0, + 0, 0, 0, 104, 105, 0, 57, 24, 0, 25, + 0, 0, 26, 256, 0, 0, 0, 27, 62, 63, + 0, 28, 0, 0, 0, 0, 0, 65, 106, 260, + 30, 109, 0, 0, 0, 0, 0, 32, 0, 0, + 0, 0, 33, 0, 72, 73, 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, 40, 255, 0, 41, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 89, 90, 91, 256, 342, 0, 0, 0, 0, - 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, - 98, 99, 100, 0, 0, 0, 101, 0, 102, 654, - 0, 0, 0, 0, 103, 104, 0, 56, 24, 0, - 25, 0, 0, 26, 254, 0, 0, 0, 27, 61, - 62, 0, 28, 0, 0, 0, 0, 0, 64, 105, - 257, 30, 108, 0, 0, 0, 0, 0, 32, 0, - 0, 0, 0, 33, 0, 71, 72, 34, 0, 0, + 37, 75, 0, 0, 38, 0, 0, 77, 0, 79, + 0, 81, 39, 40, 257, 0, 41, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 90, 91, 92, 258, 663, 0, 0, 0, 0, + 0, 0, 0, 96, 0, 0, 0, 0, 0, 98, + 99, 100, 101, 0, 0, 0, 102, 0, 103, 675, + 0, 0, 0, 0, 104, 105, 0, 57, 24, 0, + 25, 0, 0, 26, 256, 0, 0, 0, 27, 62, + 63, 0, 28, 0, 0, 0, 0, 0, 65, 106, + 260, 30, 109, 0, 0, 0, 0, 0, 32, 0, + 0, 0, 0, 33, 0, 72, 73, 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, 40, 255, 0, 41, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 89, 90, 91, 256, 342, 0, 0, 0, - 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, - 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, - 656, 0, 0, 0, 0, 103, 104, 0, 56, 24, - 0, 25, 0, 0, 26, 254, 0, 0, 0, 27, - 61, 62, 0, 28, 0, 0, 0, 0, 0, 64, - 105, 257, 30, 108, 0, 0, 0, 0, 0, 32, - 0, 0, 0, 0, 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, 40, 255, 0, 41, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 89, 90, 91, 256, 342, 0, 0, - 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, - 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, - 102, 658, 0, 0, 0, 0, 103, 104, 0, 56, - 24, 0, 25, 0, 0, 26, 254, 0, 0, 0, - 27, 61, 62, 0, 28, 0, 0, 0, 0, 0, - 64, 105, 257, 30, 108, 0, 0, 0, 0, 0, - 32, 0, 0, 0, 0, 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, 40, 255, 0, 41, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 89, 90, 91, 256, 342, 0, - 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 97, 98, 99, 100, 0, 0, 0, 101, - 0, 102, 660, 0, 0, 0, 0, 103, 104, 0, - 56, 24, 0, 25, 0, 0, 26, 254, 0, 0, - 0, 27, 61, 62, 0, 28, 0, 0, 0, 0, - 0, 64, 105, 257, 30, 108, 0, 0, 0, 0, - 0, 32, 0, 0, 0, 0, 33, 0, 71, 72, + 0, 37, 75, 0, 0, 38, 0, 0, 77, 0, + 79, 0, 81, 39, 40, 257, 0, 41, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 90, 91, 92, 258, 663, 0, 0, 0, + 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, + 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, + 677, 0, 0, 0, 0, 104, 105, 0, 57, 24, + 0, 25, 0, 0, 26, 256, 0, 0, 0, 27, + 62, 63, 0, 28, 0, 0, 0, 0, 0, 65, + 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, + 0, 0, 0, 0, 33, 0, 72, 73, 34, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 37, 75, 0, 0, 38, 0, 0, 77, + 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 90, 91, 92, 258, 663, 0, 0, + 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, + 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, + 103, 679, 0, 0, 0, 0, 104, 105, 0, 57, + 24, 0, 25, 0, 0, 26, 256, 0, 0, 0, + 27, 62, 63, 0, 28, 0, 0, 0, 0, 0, + 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 0, 33, 0, 72, 73, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 36, 0, 37, 75, 0, 0, 38, 0, 0, + 77, 0, 79, 0, 81, 39, 40, 257, 0, 41, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 90, 91, 92, 258, 663, 0, + 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, + 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, + 0, 103, 681, 0, 0, 0, 0, 104, 105, 0, + 57, 24, 0, 25, 0, 0, 26, 256, 0, 0, + 0, 27, 62, 63, 0, 28, 0, 0, 0, 0, + 0, 65, 106, 260, 30, 109, 0, 0, 0, 0, + 0, 32, 0, 0, 0, 0, 33, 0, 72, 73, 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, 40, 255, 0, + 0, 0, 36, 0, 37, 75, 0, 0, 38, 0, + 0, 77, 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 89, 90, 91, 256, 342, - 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, - 0, 0, 0, 97, 98, 99, 100, 0, 0, 0, - 101, 0, 102, 662, 0, 0, 0, 0, 103, 104, - 0, 56, 24, 0, 25, 0, 0, 26, 254, 0, - 0, 0, 27, 61, 62, 0, 28, 0, 0, 0, - 0, 0, 64, 105, 257, 30, 108, 0, 0, 0, - 0, 0, 32, 0, 0, 0, 0, 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, 40, 255, + 0, 0, 0, 0, 0, 90, 91, 92, 258, 663, + 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, + 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, + 102, 0, 103, 683, 0, 0, 0, 0, 104, 105, + 0, 57, 24, 0, 25, 0, 0, 26, 256, 0, + 0, 0, 27, 62, 63, 0, 28, 0, 0, 0, + 0, 0, 65, 106, 260, 30, 109, 0, 0, 0, + 0, 0, 32, 0, 0, 0, 0, 33, 0, 72, + 73, 34, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 36, 0, 37, 75, 0, 0, 38, + 0, 0, 77, 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 89, 90, 91, 256, - 342, 0, 0, 0, 0, 0, 0, 0, 95, 0, - 0, 0, 0, 0, 97, 98, 99, 100, 0, 0, - 0, 101, 0, 102, 664, 0, 0, 0, 0, 103, - 104, 0, 56, 24, 0, 25, 0, 0, 26, 254, - 0, 0, 0, 27, 61, 62, 0, 28, 0, 0, - 0, 0, 0, 64, 105, 257, 30, 108, 0, 0, + 0, 0, 0, 0, 0, 0, 90, 91, 92, 258, + 663, 0, 0, 0, 0, 0, 0, 0, 96, 0, + 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, + 0, 102, 0, 103, 685, 0, 0, 0, 0, 104, + 105, 0, 57, 24, 0, 25, 0, 0, 26, 256, + 0, 0, 0, 27, 62, 63, 0, 28, 0, 0, + 0, 0, 0, 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 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, 40, - 255, 0, 41, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 89, 90, 91, - 256, 342, 0, 0, 0, 0, 0, 0, 0, 95, - 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, - 0, 0, 101, 0, 102, 666, 0, 0, 0, 0, - 103, 104, 0, 56, 24, 0, 25, 0, 0, 26, - 254, 0, 0, 0, 27, 61, 62, 0, 28, 0, - 0, 0, 0, 0, 64, 105, 257, 30, 108, 0, + 72, 73, 34, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 36, 0, 37, 75, 0, 0, + 38, 0, 0, 77, 0, 79, 0, 81, 39, 40, + 257, 0, 41, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, + 258, 663, 0, 0, 0, 0, 0, 0, 0, 96, + 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, + 0, 0, 102, 0, 103, 687, 0, 0, 0, 0, + 104, 105, 0, 57, 24, 0, 25, 0, 0, 26, + 256, 0, 0, 0, 27, 62, 63, 0, 28, 0, + 0, 0, 0, 0, 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 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, - 40, 255, 0, 41, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 89, 90, - 91, 256, 342, 0, 0, 0, 0, 0, 0, 0, - 95, 0, 0, 0, 0, 0, 97, 98, 99, 100, - 0, 0, 0, 101, 0, 102, 668, 0, 0, 0, - 0, 103, 104, 0, 56, 24, 0, 25, 0, 0, - 26, 254, 0, 0, 0, 27, 61, 62, 0, 28, - 0, 0, 0, 0, 0, 64, 105, 257, 30, 108, + 0, 72, 73, 34, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 36, 0, 37, 75, 0, + 0, 38, 0, 0, 77, 0, 79, 0, 81, 39, + 40, 257, 0, 41, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, + 92, 258, 663, 0, 0, 0, 0, 0, 0, 0, + 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, + 0, 0, 0, 102, 0, 103, 858, 0, 0, 0, + 0, 104, 105, 0, 57, 24, 0, 25, 0, 0, + 26, 256, 0, 0, 0, 27, 62, 63, 0, 28, + 0, 0, 0, 0, 0, 65, 106, 260, 30, 109, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, - 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, 40, 255, 0, 41, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, - 90, 91, 256, 342, 0, 0, 0, 0, 0, 0, - 0, 95, 0, 0, 0, 0, 0, 97, 98, 99, - 100, 0, 0, 0, 101, 0, 102, 670, 0, 0, - 0, 0, 103, 104, 0, 56, 24, 0, 25, 0, - 0, 26, 254, 0, 0, 0, 27, 61, 62, 0, - 28, 0, 0, 0, 0, 0, 64, 105, 257, 30, - 108, 0, 0, 0, 0, 0, 32, 0, 0, 0, - 0, 33, 0, 71, 72, 34, 0, 0, 0, 0, + 33, 0, 72, 73, 34, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 36, 0, 37, 75, + 0, 0, 38, 0, 0, 77, 0, 79, 0, 81, + 39, 40, 257, 0, 41, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, + 91, 92, 258, 347, 0, 0, 0, 0, 0, 0, + 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, + 101, 0, 0, 0, 102, 0, 103, 519, 0, 0, + 0, 0, 104, 105, 347, 57, 24, 0, 25, 0, + 0, 26, 256, 0, 0, 0, 27, 62, 63, 0, + 28, 0, 0, 0, 0, 0, 65, 106, 260, 30, + 109, 0, 0, 0, 0, 0, 32, 0, 0, 0, + 347, 33, 0, 72, 73, 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, 40, 255, 0, 41, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 89, 90, 91, 256, 342, 0, 0, 0, 0, 0, - 0, 0, 95, 0, 0, 0, 0, 0, 97, 98, - 99, 100, 0, 0, 0, 101, 0, 102, 672, 0, - 0, 0, 0, 103, 104, 0, 56, 24, 0, 25, - 0, 0, 26, 254, 0, 0, 0, 27, 61, 62, - 0, 28, 0, 0, 0, 0, 0, 64, 105, 257, - 30, 108, 0, 0, 0, 0, 0, 32, 0, 0, - 0, 0, 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, 40, 255, 0, 41, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 89, 90, 91, 256, 342, 0, 0, 0, 0, - 0, 0, 0, 95, 0, 0, 0, 0, 0, 97, - 98, 99, 100, 0, 0, 0, 101, 0, 102, 674, - 0, 0, 0, 0, 103, 104, 0, 56, 24, 0, - 25, 0, 0, 26, 254, 0, 0, 0, 27, 61, - 62, 0, 28, 0, 0, 0, 0, 0, 64, 105, - 257, 30, 108, 0, 0, 0, 0, 0, 32, 0, - 0, 0, 0, 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, 40, 255, 0, 41, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 89, 90, 91, 256, 342, 0, 0, 0, - 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, - 97, 98, 99, 100, 0, 0, 0, 101, 0, 102, - 842, 0, 0, 0, 0, 103, 104, 0, 56, 24, - 0, 25, 0, 0, 26, 254, 0, 0, 0, 27, - 61, 62, 0, 28, 0, 0, 0, 0, 0, 64, - 105, 257, 30, 108, 0, 0, 0, 0, 0, 32, - 0, 0, 0, 0, 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, 40, 255, 0, 41, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 75, 0, 0, 38, 0, 0, 77, 0, 79, 0, + 81, 39, 40, 257, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 89, 90, 91, 256, 342, 0, 0, - 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, - 0, 97, 98, 99, 100, 0, 0, 0, 101, 0, - 102, 513, 0, 0, 0, 0, 103, 104, 347, 56, - 24, 0, 25, 0, 0, 26, 254, 0, 0, 0, - 27, 61, 62, 0, 28, 0, 0, 0, 0, 0, - 64, 105, 257, 30, 108, 0, 0, 0, 0, 0, - 32, 0, 0, 0, 347, 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, 40, 255, 0, 41, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 89, 90, 91, 256, 291, 0, - 0, 0, 0, 0, 0, 0, 95, 347, 347, 347, - 347, 796, 0, 0, 347, 347, 0, 0, 347, 347, - 347, 347, 347, 347, 347, 347, 347, 0, 347, 347, - 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + 90, 91, 92, 258, 520, 0, 0, 0, 0, 0, + 0, 0, 96, 347, 347, 347, 347, 811, 0, 0, + 347, 347, 0, 0, 347, 347, 347, 347, 347, 347, + 347, 347, 347, 0, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, - 0, 0, 105, 514, 0, 0, 347, 0, 52, 347, - 52, 0, 52, 0, 52, 0, 0, 52, 0, 52, - 52, 0, 52, 0, 52, 0, 52, 0, 52, 52, - 52, 52, 0, 0, 52, 52, 0, 0, 0, 0, - 52, 52, 52, 52, 52, 0, 0, 52, 0, 52, - 0, 52, 0, 52, 52, 0, 52, 52, 52, 52, - 0, 0, 52, 52, 52, 52, 0, 0, 52, 52, - 52, 0, 0, 0, 0, 0, 0, 52, 52, 0, - 52, 52, 0, 52, 52, 52, 0, 0, 0, 52, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, - 0, 52, 52, 51, 0, 0, 0, 51, 0, 51, - 0, 0, 51, 0, 51, 51, 0, 51, 0, 51, + 347, 347, 347, 347, 347, 347, 0, 0, 106, 521, + 0, 0, 347, 0, 52, 347, 52, 0, 52, 0, + 52, 0, 0, 52, 0, 52, 52, 0, 52, 0, + 52, 0, 52, 0, 52, 52, 52, 52, 0, 0, + 52, 52, 0, 0, 0, 0, 52, 52, 52, 52, + 52, 0, 0, 52, 0, 52, 0, 52, 0, 52, + 52, 0, 52, 52, 52, 52, 0, 0, 52, 52, + 52, 52, 0, 0, 52, 52, 52, 0, 0, 0, + 0, 0, 0, 52, 52, 0, 52, 52, 0, 52, + 52, 52, 0, 0, 0, 52, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 52, 0, 52, 52, 51, + 0, 0, 0, 51, 0, 51, 0, 0, 51, 0, + 51, 51, 0, 51, 0, 51, 0, 51, 0, 51, + 51, 51, 51, 0, 0, 51, 51, 0, 0, 0, + 0, 51, 0, 51, 51, 51, 0, 0, 51, 0, + 51, 0, 51, 0, 0, 51, 0, 51, 51, 51, + 51, 52, 0, 0, 51, 51, 51, 0, 0, 51, + 51, 51, 0, 0, 0, 0, 0, 0, 51, 51, + 0, 51, 51, 0, 51, 51, 51, 0, 0, 0, + 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, + 51, 0, 51, 0, 51, 0, 86, 51, 0, 51, + 51, 0, 51, 0, 51, 51, 51, 0, 51, 51, + 51, 51, 0, 0, 51, 51, 0, 0, 0, 0, + 51, 0, 51, 51, 51, 0, 0, 51, 0, 51, + 0, 51, 0, 0, 51, 0, 51, 51, 51, 51, + 0, 0, 0, 51, 51, 51, 51, 0, 51, 51, + 51, 0, 0, 0, 0, 0, 0, 51, 51, 0, + 51, 51, 0, 51, 51, 51, 0, 0, 0, 51, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 52, 0, 51, + 0, 52, 0, 52, 0, 87, 52, 0, 52, 52, + 0, 52, 0, 52, 51, 52, 0, 52, 52, 52, + 52, 0, 0, 52, 52, 0, 0, 0, 0, 52, + 0, 52, 52, 52, 0, 0, 52, 0, 52, 0, + 52, 0, 0, 52, 0, 52, 52, 52, 52, 0, + 0, 0, 52, 52, 52, 51, 0, 52, 52, 52, + 0, 0, 0, 0, 0, 0, 52, 52, 0, 52, + 52, 0, 52, 52, 52, 0, 0, 0, 52, 0, + 0, 0, 0, 51, 0, 0, 0, 51, 0, 51, + 0, 0, 51, 0, 51, 51, 0, 51, 52, 51, 0, 51, 0, 51, 51, 51, 51, 0, 0, 51, - 51, 0, 0, 0, 0, 51, 0, 51, 51, 51, + 51, 0, 0, 52, 0, 51, 0, 51, 51, 51, 0, 0, 51, 0, 51, 0, 51, 0, 0, 51, - 0, 51, 51, 51, 51, 52, 0, 0, 51, 51, + 0, 51, 51, 51, 51, 0, 0, 0, 51, 51, 51, 0, 0, 51, 51, 51, 0, 0, 0, 0, - 0, 0, 51, 51, 0, 51, 51, 0, 51, 51, + 0, 0, 51, 51, 52, 51, 51, 0, 51, 51, 51, 0, 0, 0, 51, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 51, 0, 51, 0, 51, 0, 51, 0, - 86, 51, 0, 51, 51, 0, 51, 0, 51, 51, - 51, 0, 51, 51, 51, 51, 0, 0, 51, 51, - 0, 0, 0, 0, 51, 0, 51, 51, 51, 0, - 0, 51, 0, 51, 0, 51, 0, 0, 51, 0, - 51, 51, 51, 51, 0, 0, 0, 51, 51, 51, - 51, 0, 51, 51, 51, 0, 0, 0, 0, 0, - 0, 51, 51, 0, 51, 51, 0, 51, 51, 51, - 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 52, 0, 51, 0, 52, 0, 52, 0, 87, - 52, 0, 52, 52, 0, 52, 0, 52, 51, 52, - 0, 52, 52, 52, 52, 0, 0, 52, 52, 0, - 0, 0, 0, 52, 0, 52, 52, 52, 0, 0, - 52, 0, 52, 0, 52, 0, 0, 52, 0, 52, - 52, 52, 52, 0, 0, 0, 52, 52, 52, 51, - 0, 52, 52, 52, 0, 0, 0, 0, 0, 0, - 52, 52, 0, 52, 52, 0, 52, 52, 52, 0, - 0, 0, 52, 0, 0, 0, 0, 51, 0, 0, - 0, 51, 0, 51, 0, 0, 51, 0, 51, 51, - 0, 51, 52, 51, 0, 51, 0, 51, 51, 51, - 51, 0, 0, 51, 51, 0, 0, 52, 0, 51, - 0, 51, 51, 51, 0, 0, 51, 0, 51, 0, + 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, + 0, 51, 0, 51, 51, 0, 51, 0, 51, 51, + 222, 51, 0, 51, 0, 51, 0, 51, 51, 51, + 51, 0, 0, 51, 51, 0, 0, 0, 0, 51, + 0, 51, 51, 51, 0, 0, 51, 0, 51, 347, 51, 0, 0, 51, 0, 51, 51, 51, 51, 0, 0, 0, 51, 51, 51, 0, 0, 51, 51, 51, - 0, 0, 0, 0, 0, 0, 51, 51, 52, 51, - 51, 0, 51, 51, 51, 0, 0, 0, 51, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 51, 0, 0, 0, 51, 0, 51, 51, 0, - 51, 0, 51, 51, 222, 51, 0, 51, 0, 51, - 0, 51, 51, 51, 51, 0, 0, 51, 51, 0, - 0, 0, 0, 51, 0, 51, 51, 51, 0, 0, - 51, 0, 51, 347, 51, 0, 0, 51, 0, 51, - 51, 51, 51, 0, 0, 0, 51, 51, 51, 0, - 0, 51, 51, 51, 51, 0, 347, 0, 0, 0, - 51, 51, 0, 51, 51, 0, 51, 51, 51, 347, - 0, 0, 51, 0, 347, 0, 0, 347, 0, 347, - 0, 347, 347, 347, 347, 0, 0, 0, 0, 347, - 0, 0, 51, 347, 0, 0, 0, 347, 223, 0, - 0, 0, 0, 368, 0, 347, 0, 0, 347, 0, - 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 368, 0, 0, 347, - 0, 0, 0, 0, 347, 0, 0, 0, 0, 368, - 347, 347, 0, 273, 368, 347, 0, 239, 51, 368, - 0, 368, 368, 368, 368, 0, 0, 0, 347, 368, - 0, 0, 0, 368, 0, 465, 0, 368, 0, 0, - 0, 0, 0, 0, 0, 368, 0, 0, 368, 0, - 368, 0, 0, 0, 0, 0, 0, 0, 466, 0, - 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 467, 0, 465, 368, 0, 469, 0, 0, 0, - 368, 470, 0, 471, 472, 473, 474, 0, 0, 0, - 0, 475, 0, 0, 0, 476, 466, 0, 0, 1381, - 0, 0, 0, 465, 0, 0, 0, 477, 0, 467, - 478, 0, 479, 0, 469, 0, 0, 0, 0, 470, - 0, 471, 472, 473, 474, 0, 466, 0, 0, 475, - 368, 0, 0, 476, 0, 0, 480, 1381, 0, 467, - 0, 0, 1382, 0, 469, 477, 0, 0, 478, 470, - 479, 471, 472, 473, 474, 0, 0, 0, 0, 475, - 0, 0, 0, 476, 0, 0, 0, 0, 0, 0, - 56, 24, 0, 25, 480, 477, 26, 254, 478, 0, - 479, 27, 61, 62, 0, 28, 0, 0, 0, 0, - 0, 64, 1383, 0, 30, 0, 0, 0, 0, 0, - 0, 32, 0, 0, 480, 0, 33, 0, 71, 72, - 34, 0, 614, 0, 0, 0, 0, 0, 0, 615, - 0, 0, 36, 0, 37, 74, 0, 0, 38, 0, - 1383, 76, 0, 78, 0, 80, 39, 40, 255, 0, - 41, 0, 0, 0, 0, 0, 0, 616, 0, 0, - 87, 88, 0, 0, 0, 0, 0, 0, 0, 0, - 1400, 0, 0, 0, 0, 89, 90, 91, 92, 93, - 0, 0, 0, 0, 0, 0, 0, 95, 975, 0, - 617, 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, 56, 24, 0, 25, - 0, 0, 26, 254, 0, 0, 0, 27, 61, 62, - 0, 28, 0, 105, 106, 107, 108, 64, 0, 0, - 30, 0, 0, 0, 0, 0, 0, 32, 0, 0, - 0, 0, 33, 0, 71, 72, 34, 0, 614, 0, - 0, 0, 0, 0, 0, 615, 0, 0, 36, 0, - 37, 74, 0, 0, 38, 0, 0, 76, 0, 78, - 0, 80, 39, 40, 255, 0, 41, 0, 0, 0, - 0, 0, 0, 616, 0, 0, 87, 88, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 89, 90, 91, 92, 93, 0, 0, 0, 0, - 0, 0, 0, 95, 0, 0, 617, 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, 56, 24, 0, 25, 0, 0, 26, 254, - 0, 0, 0, 27, 61, 62, 0, 28, 0, 105, - 106, 107, 108, 64, 0, 0, 30, 0, 0, 0, - 0, 0, 0, 32, 0, 0, 0, 0, 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, 40, - 255, 0, 41, 0, 0, 84, 0, 0, 0, 86, - 0, 0, 87, 88, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 89, 90, 91, - 92, 302, 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, 56, 24, - 0, 25, 0, 0, 26, 254, 0, 0, 0, 27, - 61, 62, 0, 28, 0, 105, 303, 107, 108, 64, - 0, 0, 30, 0, 0, 0, 0, 0, 0, 32, - 0, 0, 0, 0, 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, 40, 255, 0, 41, 0, - 0, 0, 0, 0, 0, 86, 0, 0, 87, 88, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 89, 90, 91, 92, 302, 0, 0, - 0, 531, 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, 56, 24, 0, 25, 0, 0, - 26, 254, 0, 0, 0, 27, 61, 62, 0, 28, - 0, 105, 303, 107, 108, 64, 0, 0, 30, 0, + 51, 0, 347, 0, 0, 0, 51, 51, 0, 51, + 51, 0, 51, 51, 51, 347, 0, 0, 51, 0, + 347, 0, 0, 347, 0, 347, 0, 347, 347, 347, + 347, 0, 0, 0, 0, 347, 0, 0, 51, 347, + 0, 0, 0, 347, 223, 0, 0, 0, 0, 369, + 0, 347, 0, 0, 347, 0, 347, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 369, 0, 0, 347, 0, 0, 0, 0, + 347, 0, 0, 0, 0, 369, 347, 347, 0, 273, + 369, 347, 0, 240, 51, 369, 0, 369, 369, 369, + 369, 0, 0, 0, 347, 369, 0, 0, 0, 369, + 0, 368, 0, 369, 0, 0, 0, 0, 0, 0, + 0, 369, 0, 0, 369, 0, 369, 0, 0, 0, + 0, 0, 0, 0, 368, 0, 347, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 368, 0, 471, + 369, 0, 368, 0, 0, 239, 369, 368, 0, 368, + 368, 368, 368, 0, 0, 0, 0, 368, 0, 0, + 0, 368, 472, 0, 0, 368, 0, 0, 0, 0, + 0, 0, 0, 368, 0, 473, 368, 471, 368, 0, + 475, 0, 0, 0, 0, 476, 0, 477, 478, 479, + 480, 0, 0, 0, 0, 481, 369, 0, 0, 482, + 472, 0, 368, 1412, 0, 0, 0, 0, 368, 0, + 0, 483, 0, 473, 484, 471, 485, 0, 475, 0, + 0, 0, 0, 476, 0, 477, 478, 479, 480, 0, + 0, 0, 0, 481, 0, 0, 0, 482, 472, 0, + 486, 1412, 0, 0, 0, 0, 1413, 0, 0, 483, + 0, 473, 484, 0, 485, 0, 475, 0, 368, 0, + 0, 476, 0, 477, 478, 479, 480, 0, 0, 0, + 0, 481, 0, 0, 0, 482, 0, 0, 486, 0, + 0, 0, 0, 0, 0, 0, 0, 483, 57, 24, + 484, 25, 485, 0, 26, 256, 1414, 0, 0, 27, + 62, 63, 0, 28, 0, 0, 0, 0, 0, 65, + 0, 0, 30, 0, 0, 0, 486, 0, 0, 32, + 0, 0, 0, 0, 33, 0, 72, 73, 34, 0, + 626, 0, 0, 0, 1414, 0, 0, 627, 0, 0, + 36, 0, 37, 75, 0, 0, 38, 0, 0, 77, + 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, + 0, 0, 0, 0, 0, 628, 0, 0, 88, 89, + 0, 0, 1430, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, + 0, 0, 0, 0, 0, 96, 993, 0, 629, 0, + 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, + 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, + 0, 0, 0, 0, 57, 24, 0, 25, 0, 0, + 26, 256, 0, 0, 0, 27, 62, 63, 0, 28, + 0, 106, 107, 108, 109, 65, 0, 0, 30, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, - 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, 40, 255, 0, 41, 0, 0, 0, 0, 0, - 0, 86, 0, 0, 87, 88, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, - 90, 91, 92, 302, 0, 0, 0, 525, 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, - 56, 24, 0, 25, 0, 0, 26, 254, 0, 0, - 0, 27, 61, 62, 0, 28, 0, 105, 303, 107, - 108, 64, 0, 0, 30, 0, 0, 0, 0, 0, - 0, 32, 0, 0, 0, 0, 33, 0, 71, 72, + 33, 0, 72, 73, 34, 0, 626, 0, 0, 0, + 0, 0, 0, 627, 0, 0, 36, 0, 37, 75, + 0, 0, 38, 0, 0, 77, 0, 79, 0, 81, + 39, 40, 257, 0, 41, 0, 0, 0, 0, 0, + 0, 628, 0, 0, 88, 89, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, + 91, 92, 93, 94, 0, 0, 0, 0, 0, 0, + 0, 96, 0, 0, 629, 0, 0, 98, 99, 100, + 101, 0, 0, 0, 102, 0, 103, 0, 0, 0, + 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, + 57, 24, 0, 25, 0, 0, 26, 256, 0, 0, + 0, 27, 62, 63, 0, 28, 0, 106, 107, 108, + 109, 65, 0, 0, 30, 0, 0, 0, 0, 0, + 0, 32, 0, 0, 0, 0, 33, 0, 72, 73, 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, 40, 255, 0, - 41, 0, 0, 0, 0, 0, 0, 86, 0, 0, - 87, 88, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 89, 90, 91, 92, 302, - 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, 56, 24, 0, 25, - 0, 0, 26, 254, 0, 0, 0, 27, 61, 62, - 0, 28, 0, 105, 303, 107, 108, 64, 0, 0, + 0, 0, 36, 0, 37, 75, 0, 0, 38, 0, + 0, 77, 0, 79, 0, 81, 39, 40, 257, 0, + 41, 0, 0, 85, 0, 0, 0, 87, 0, 0, + 88, 89, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 90, 91, 92, 93, 305, + 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, + 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, + 102, 0, 103, 0, 0, 0, 0, 0, 104, 105, + 0, 0, 0, 0, 0, 0, 57, 24, 0, 25, + 0, 0, 26, 256, 0, 0, 0, 27, 62, 63, + 0, 28, 0, 106, 306, 108, 109, 65, 0, 0, 30, 0, 0, 0, 0, 0, 0, 32, 0, 0, - 0, 0, 33, 0, 71, 72, 34, 0, 0, 0, + 0, 0, 33, 0, 72, 73, 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, 40, 255, 0, 41, 0, 0, 0, - 0, 0, 0, 86, 0, 0, 87, 88, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 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, 0, - 0, 0, 0, 0, 103, 104, 0, 0, 0, 0, - 0, 0, 655, 655, 0, 655, 0, 0, 655, 655, - 0, 0, 0, 655, 655, 655, 0, 655, 0, 105, - 106, 107, 108, 655, 0, 0, 655, 0, 0, 0, - 0, 0, 0, 655, 0, 0, 0, 0, 655, 0, - 655, 655, 655, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 655, 0, 655, 655, 0, 0, - 655, 0, 0, 655, 0, 655, 0, 655, 655, 655, - 655, 0, 655, 0, 0, 0, 0, 0, 0, 655, - 0, 0, 655, 655, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 655, 655, 655, - 655, 655, 0, 0, 0, 0, 0, 0, 0, 655, - 0, 0, 0, 0, 0, 655, 655, 655, 655, 0, - 0, 0, 655, 0, 655, 0, 0, 0, 0, 0, - 655, 655, 0, 0, 0, 0, 0, 0, 143, 143, - 0, 143, 0, 0, 143, 143, 0, 0, 0, 143, - 143, 143, 0, 143, 0, 655, 655, 655, 655, 143, - 0, 0, 143, 0, 0, 0, 0, 0, 0, 143, - 0, 0, 0, 0, 143, 0, 143, 143, 143, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 143, 0, 143, 143, 0, 0, 143, 0, 0, 143, - 0, 143, 0, 143, 143, 143, 143, 0, 143, 0, - 0, 0, 0, 0, 0, 143, 0, 0, 143, 143, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 143, 143, 143, 143, 143, 0, 0, - 0, 0, 0, 0, 0, 143, 0, 0, 0, 0, - 0, 143, 143, 143, 143, 0, 0, 0, 143, 0, - 143, 0, 0, 0, 0, 0, 143, 143, 0, 0, - 0, 0, 0, 0, 56, 24, 0, 25, 0, 0, - 26, 254, 0, 0, 0, 27, 61, 62, 0, 28, - 0, 143, 143, 143, 143, 64, 0, 0, 30, 0, - 0, 0, 0, 0, 0, 32, 0, 31, 0, 0, - 33, 0, 71, 72, 34, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 36, 0, 37, 74, - 31, 0, 38, 0, 0, 76, 0, 78, 0, 80, - 39, 40, 255, 31, 41, 0, 0, 0, 31, 0, - 0, 0, 0, 31, 0, 31, 31, 31, 31, 0, - 0, 31, 0, 31, 0, 0, 0, 31, 0, 89, - 90, 91, 256, 342, 0, 0, 0, 0, 0, 31, - 0, 95, 31, 0, 31, 0, 0, 97, 98, 99, - 100, 0, 0, 0, 101, 0, 102, 0, 0, 0, - 0, 0, 103, 104, 0, 0, 0, 0, 31, 0, - 0, 0, 0, 0, 31, 31, 0, 0, 0, 0, - 0, 0, 692, 0, 692, 0, 692, 105, 257, 692, - 108, 692, 692, 0, 692, 0, 692, 0, 692, 0, - 692, 692, 692, 0, 0, 0, 692, 692, 0, 0, - 0, 0, 692, 0, 692, 692, 0, 0, 0, 692, - 0, 0, 0, 692, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 692, 692, 0, 692, 0, 0, - 0, 692, 692, 0, 0, 0, 0, 0, 0, 692, - 692, 56, 24, 692, 25, 0, 692, 26, 254, 0, - 0, 692, 27, 61, 62, 0, 28, 0, 0, 0, - 0, 0, 64, 0, 0, 30, 0, 0, 0, 0, - 0, 0, 32, 692, 692, 0, 0, 33, 0, 71, - 72, 34, 0, 0, 0, 0, 692, 0, 0, 0, - 0, 0, 0, 36, 0, 37, 74, 0, 0, 38, - 0, 0, 76, 0, 78, 0, 80, 39, 40, 255, - 0, 41, 0, 0, 84, 0, 0, 0, 0, 0, - 0, 24, 0, 25, 0, 0, 26, 692, 1286, 0, - 0, 27, 0, 0, 0, 28, 89, 90, 91, 256, - 0, 0, 0, 0, 30, 691, 0, 691, 95, 0, - 691, 32, 691, 691, 0, 691, 33, 691, 1287, 691, - 34, 691, 691, 691, 0, 0, 0, 691, 691, 0, - 0, 0, 36, 691, 37, 691, 691, 0, 38, 1288, - 691, 0, 0, 0, 691, 0, 39, 40, 0, 0, - 41, 0, 0, 324, 105, 257, 691, 0, 691, 0, - 0, 0, 691, 691, 0, 0, 0, 0, 0, 0, - 691, 691, 0, 691, 691, 691, 0, 691, 691, 0, - 691, 691, 691, 691, 0, 691, 0, 691, 0, 691, - 691, 691, 0, 0, 0, 691, 691, 0, 0, 0, - 0, 691, 0, 691, 691, 0, 0, 0, 691, 0, - 0, 0, 691, 0, 0, 0, 0, 691, 0, 0, - 0, 0, 0, 0, 691, 0, 691, 0, 0, 0, - 691, 691, 0, 0, 368, 0, 0, 0, 691, 691, - 0, 0, 691, 0, 0, 691, 0, 24, 0, 25, - 691, 0, 26, 0, 0, 1349, 0, 27, 691, 726, - 0, 28, 0, 727, 1350, 1351, 0, 0, 0, 1352, - 30, 0, 0, 0, 0, 1353, 0, 32, 0, 24, - 0, 25, 33, 0, 26, 0, 34, 1349, 0, 27, - 0, 726, 0, 28, 0, 727, 1350, 1351, 36, 0, - 37, 1352, 30, 0, 38, 0, 0, 1353, 0, 32, - 0, 0, 39, 40, 33, 0, 41, 0, 34, 1354, - 0, 0, 0, 51, 1355, 51, 691, 0, 51, 0, - 36, 0, 37, 51, 0, 0, 38, 51, 0, 0, - 0, 0, 0, 0, 39, 40, 51, 0, 41, 0, - 0, 1354, 0, 51, 0, 51, 1355, 51, 51, 1356, - 51, 0, 51, 0, 51, 51, 51, 0, 0, 51, - 0, 51, 0, 0, 51, 0, 51, 0, 51, 0, - 51, 0, 0, 51, 0, 51, 0, 0, 51, 51, - 51, 0, 51, 0, 51, 51, 51, 0, 51, 24, - 1357, 25, 0, 51, 26, 0, 51, 0, 51, 27, - 0, 0, 51, 28, 0, 51, 0, 0, 0, 0, - 51, 51, 30, 0, 51, 0, 0, 51, 0, 32, - 162, 0, 1357, 0, 33, 0, 0, 0, 34, 0, - 586, 0, 0, 0, 0, 0, 0, 587, 0, 0, - 36, 0, 37, 0, 0, 0, 38, 0, 0, 588, - 162, 0, 0, 0, 39, 40, 0, 0, 41, 0, - 52, 589, 52, 0, 0, 52, 51, 0, 0, 0, - 52, 0, 0, 0, 52, 0, 0, 0, 0, 0, - 0, 0, 0, 52, 0, 0, 0, 590, 0, 0, - 52, 0, 51, 0, 51, 52, 0, 51, 51, 52, - 0, 52, 51, 52, 0, 0, 51, 0, 52, 0, - 0, 52, 0, 52, 0, 51, 0, 52, 0, 0, - 52, 0, 51, 0, 0, 52, 52, 51, 0, 52, - 0, 51, 52, 51, 0, 51, 0, 0, 0, 0, - 51, 0, 591, 51, 0, 51, 0, 0, 0, 51, - 0, 0, 51, 0, 0, 0, 0, 51, 51, 0, - 0, 51, 0, 24, 51, 25, 0, 0, 26, 0, - 0, 0, 0, 27, 0, 0, 0, 28, 0, 0, - 0, 29, 24, 0, 25, 0, 30, 26, 0, 0, - 0, 31, 27, 32, 0, 0, 28, 0, 33, 0, - 0, 0, 34, 35, 0, 30, 0, 0, 0, 0, - 0, 0, 32, 52, 36, 0, 37, 33, 0, 0, - 38, 34, 0, 0, 0, 0, 37, 0, 39, 40, - 0, 0, 41, 36, 0, 37, 0, 37, 0, 38, - 0, 0, 37, 0, 0, 51, 37, 39, 40, 37, - 0, 41, 0, 0, 324, 0, 0, 0, 0, 0, - 0, 37, 37, 0, 0, 0, 37, 37, 0, 0, + 37, 75, 0, 0, 38, 0, 0, 77, 0, 79, + 0, 81, 39, 40, 257, 0, 41, 0, 0, 0, + 0, 0, 0, 87, 0, 0, 88, 89, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 90, 91, 92, 93, 305, 0, 0, 0, 540, + 0, 0, 0, 96, 0, 0, 0, 0, 0, 98, + 99, 100, 101, 0, 0, 0, 102, 0, 103, 0, + 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, + 0, 0, 57, 24, 0, 25, 0, 0, 26, 256, + 0, 0, 0, 27, 62, 63, 0, 28, 0, 106, + 306, 108, 109, 65, 0, 0, 30, 0, 0, 0, + 0, 0, 0, 32, 0, 0, 0, 0, 33, 0, + 72, 73, 34, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 36, 0, 37, 75, 0, 0, + 38, 0, 0, 77, 0, 79, 0, 81, 39, 40, + 257, 0, 41, 0, 0, 0, 0, 0, 0, 87, + 0, 0, 88, 89, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, + 93, 305, 0, 0, 0, 534, 0, 0, 0, 96, + 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, + 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, + 104, 105, 0, 0, 0, 0, 0, 0, 57, 24, + 0, 25, 0, 0, 26, 256, 0, 0, 0, 27, + 62, 63, 0, 28, 0, 106, 306, 108, 109, 65, + 0, 0, 30, 0, 0, 0, 0, 0, 0, 32, + 0, 0, 0, 0, 33, 0, 72, 73, 34, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 37, 75, 0, 0, 38, 0, 0, 77, + 0, 79, 0, 81, 39, 40, 257, 0, 41, 0, + 0, 0, 0, 0, 0, 87, 0, 0, 88, 89, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 90, 91, 92, 93, 305, 0, 0, + 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, + 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, + 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, + 0, 0, 0, 0, 57, 24, 0, 25, 0, 0, + 26, 256, 0, 0, 0, 27, 62, 63, 0, 28, + 0, 106, 306, 108, 109, 65, 0, 0, 30, 0, + 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, + 33, 0, 72, 73, 34, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 36, 0, 37, 75, + 0, 0, 38, 0, 0, 77, 0, 79, 0, 81, + 39, 40, 257, 0, 41, 0, 0, 0, 0, 0, + 0, 87, 0, 0, 88, 89, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, + 91, 92, 93, 94, 0, 0, 0, 0, 0, 0, + 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, + 101, 0, 0, 0, 102, 0, 103, 0, 0, 0, + 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, + 661, 661, 0, 661, 0, 0, 661, 661, 0, 0, + 0, 661, 661, 661, 0, 661, 0, 106, 107, 108, + 109, 661, 0, 0, 661, 0, 0, 0, 0, 0, + 0, 661, 0, 0, 0, 0, 661, 0, 661, 661, + 661, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 661, 0, 661, 661, 0, 0, 661, 0, + 0, 661, 0, 661, 0, 661, 661, 661, 661, 0, + 661, 0, 0, 0, 0, 0, 0, 661, 0, 0, + 661, 661, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 661, 661, 661, 661, 661, + 0, 0, 0, 0, 0, 0, 0, 661, 0, 0, + 0, 0, 0, 661, 661, 661, 661, 0, 0, 0, + 661, 0, 661, 0, 0, 0, 0, 0, 661, 661, + 0, 0, 0, 0, 0, 0, 143, 143, 0, 143, + 0, 0, 143, 143, 0, 0, 0, 143, 143, 143, + 0, 143, 0, 661, 661, 661, 661, 143, 0, 0, + 143, 0, 0, 0, 0, 0, 0, 143, 0, 0, + 0, 0, 143, 0, 143, 143, 143, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 143, 0, + 143, 143, 0, 0, 143, 0, 0, 143, 0, 143, + 0, 143, 143, 143, 143, 0, 143, 0, 0, 0, + 0, 0, 0, 143, 0, 0, 143, 143, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 143, 143, 143, 143, 143, 0, 0, 0, 0, + 0, 0, 0, 143, 0, 0, 0, 0, 0, 143, + 143, 143, 143, 0, 0, 0, 143, 0, 143, 0, + 0, 0, 0, 0, 143, 143, 0, 0, 0, 0, + 0, 0, 57, 24, 0, 25, 0, 0, 26, 256, + 0, 0, 0, 27, 62, 63, 0, 28, 0, 143, + 143, 143, 143, 65, 0, 0, 30, 0, 0, 0, + 0, 0, 0, 32, 0, 31, 0, 0, 33, 0, + 72, 73, 34, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 36, 0, 37, 75, 31, 0, + 38, 0, 0, 77, 0, 79, 0, 81, 39, 40, + 257, 31, 41, 0, 0, 0, 31, 0, 0, 0, + 0, 31, 0, 31, 31, 31, 31, 0, 0, 31, + 0, 31, 0, 0, 0, 31, 0, 90, 91, 92, + 258, 663, 0, 0, 0, 0, 0, 31, 0, 96, + 31, 0, 31, 0, 0, 98, 99, 100, 101, 0, + 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, + 104, 105, 0, 0, 0, 0, 31, 0, 0, 0, + 0, 0, 31, 31, 0, 0, 0, 0, 0, 0, + 706, 0, 706, 0, 706, 106, 260, 706, 109, 706, + 706, 0, 706, 0, 706, 0, 706, 0, 706, 706, + 706, 0, 0, 0, 706, 706, 0, 0, 0, 0, + 706, 0, 706, 706, 0, 0, 0, 706, 0, 0, + 0, 706, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 706, 706, 0, 706, 0, 0, 0, 706, + 706, 0, 0, 0, 0, 0, 0, 706, 706, 57, + 24, 706, 25, 0, 706, 26, 256, 0, 0, 706, + 27, 62, 63, 0, 28, 0, 0, 0, 0, 0, + 65, 0, 0, 30, 0, 0, 0, 0, 0, 0, + 32, 706, 706, 0, 0, 33, 0, 72, 73, 34, + 0, 0, 0, 0, 706, 0, 0, 0, 0, 0, + 0, 36, 0, 37, 75, 0, 0, 38, 0, 0, + 77, 0, 79, 0, 81, 39, 40, 257, 0, 41, + 0, 0, 85, 0, 0, 0, 0, 0, 0, 24, + 0, 25, 0, 0, 26, 706, 1318, 0, 0, 27, + 0, 0, 0, 28, 90, 91, 92, 258, 259, 0, + 0, 0, 30, 705, 0, 705, 96, 0, 705, 32, + 705, 705, 0, 705, 33, 705, 1319, 705, 34, 705, + 705, 705, 0, 0, 0, 705, 705, 0, 0, 0, + 36, 705, 37, 705, 705, 0, 38, 1320, 705, 0, + 0, 0, 705, 0, 39, 40, 0, 0, 41, 0, + 0, 327, 106, 260, 705, 0, 705, 0, 0, 0, + 705, 705, 0, 0, 0, 0, 0, 0, 705, 705, + 0, 705, 705, 705, 0, 705, 705, 0, 705, 705, + 705, 705, 0, 705, 0, 705, 0, 705, 705, 705, + 0, 0, 0, 705, 705, 0, 0, 0, 0, 705, + 0, 705, 705, 0, 0, 0, 705, 0, 0, 0, + 705, 0, 0, 0, 0, 705, 0, 0, 0, 0, + 0, 0, 705, 0, 705, 0, 0, 0, 705, 705, + 0, 0, 374, 0, 0, 0, 705, 705, 0, 0, + 705, 0, 0, 705, 0, 24, 0, 25, 705, 0, + 26, 0, 0, 1381, 0, 27, 705, 739, 0, 28, + 0, 740, 1382, 1383, 0, 0, 0, 1384, 30, 0, + 0, 0, 0, 1385, 0, 32, 0, 24, 0, 25, + 33, 0, 26, 0, 34, 1381, 0, 27, 0, 739, + 0, 28, 0, 740, 1382, 1383, 36, 0, 37, 1384, + 30, 0, 38, 0, 0, 1385, 0, 32, 0, 0, + 39, 40, 33, 0, 41, 0, 34, 1386, 0, 0, + 0, 51, 1387, 51, 705, 0, 51, 0, 36, 0, + 37, 51, 0, 0, 38, 51, 0, 0, 0, 0, + 0, 0, 39, 40, 51, 0, 41, 0, 0, 1386, + 0, 51, 0, 51, 1387, 51, 51, 1388, 51, 0, + 51, 0, 51, 51, 51, 0, 0, 51, 0, 51, + 0, 0, 51, 0, 51, 0, 51, 0, 51, 0, + 0, 51, 0, 51, 0, 0, 51, 51, 51, 0, + 51, 0, 51, 51, 51, 0, 51, 24, 1389, 25, + 0, 51, 26, 0, 51, 0, 51, 27, 0, 0, + 51, 28, 0, 51, 0, 0, 0, 0, 51, 51, + 30, 0, 51, 0, 0, 51, 0, 32, 162, 0, + 1389, 0, 33, 0, 0, 0, 34, 0, 598, 0, + 0, 0, 0, 0, 0, 599, 0, 0, 36, 0, + 37, 0, 0, 0, 38, 0, 0, 600, 162, 0, + 0, 0, 39, 40, 0, 0, 41, 0, 52, 601, + 52, 0, 0, 52, 51, 0, 0, 0, 52, 0, + 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, + 0, 52, 0, 0, 0, 602, 0, 0, 52, 0, + 51, 0, 51, 52, 0, 51, 51, 52, 0, 52, + 51, 52, 0, 0, 51, 0, 52, 0, 0, 52, + 0, 52, 0, 51, 0, 52, 0, 0, 52, 0, + 51, 0, 0, 52, 52, 51, 0, 52, 0, 51, + 52, 51, 0, 51, 0, 0, 0, 0, 51, 0, + 603, 51, 0, 51, 0, 0, 0, 51, 0, 0, + 51, 0, 0, 0, 0, 51, 51, 0, 0, 51, + 0, 24, 51, 25, 0, 0, 26, 0, 0, 0, + 0, 27, 0, 0, 0, 28, 0, 0, 0, 29, + 0, 0, 0, 0, 30, 183, 0, 183, 0, 31, + 183, 32, 0, 0, 0, 183, 33, 0, 0, 183, + 34, 35, 0, 0, 0, 0, 0, 0, 183, 0, + 0, 52, 36, 0, 37, 183, 0, 0, 38, 0, + 183, 0, 0, 0, 183, 0, 39, 40, 0, 0, + 41, 0, 0, 42, 0, 182, 183, 182, 183, 0, + 182, 0, 183, 51, 0, 182, 0, 0, 0, 182, + 183, 183, 0, 0, 183, 0, 0, 183, 182, 192, + 0, 192, 0, 0, 192, 182, 0, 0, 0, 192, + 182, 0, 0, 192, 182, 0, 0, 0, 0, 0, + 0, 0, 192, 0, 0, 0, 182, 0, 182, 192, + 0, 0, 182, 0, 192, 0, 0, 0, 192, 0, + 182, 182, 0, 0, 182, 0, 37, 182, 0, 0, + 192, 0, 192, 0, 43, 0, 192, 37, 0, 0, + 0, 0, 37, 0, 192, 192, 37, 0, 192, 37, + 0, 192, 0, 0, 0, 0, 0, 0, 183, 0, + 0, 37, 37, 0, 0, 0, 37, 37, 0, 35, 0, 0, 37, 0, 37, 37, 37, 37, 0, 0, - 291, 0, 37, 0, 0, 0, 37, 0, 37, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, - 37, 37, 35, 37, 0, 0, 0, 37, 0, 0, - 0, 0, 0, 35, 0, 0, 42, 0, 35, 0, - 0, 0, 35, 0, 0, 35, 0, 37, 0, 0, - 0, 0, 0, 37, 37, 325, 0, 35, 35, 0, - 0, 0, 35, 35, 31, 0, 31, 0, 35, 0, - 35, 35, 35, 35, 0, 0, 0, 0, 35, 0, - 0, 0, 35, 0, 35, 0, 0, 31, 0, 0, - 0, 0, 0, 0, 35, 0, 0, 35, 0, 35, - 31, 0, 0, 35, 0, 31, 0, 0, 0, 0, - 31, 0, 31, 31, 31, 31, 0, 0, 0, 0, - 31, 0, 0, 35, 31, 0, 0, 51, 0, 35, - 35, 0, 0, 0, 0, 0, 31, 0, 51, 31, - 0, 31, 0, 51, 0, 0, 0, 51, 0, 0, - 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 51, 51, 0, 31, 0, 51, 51, 0, - 51, 31, 31, 51, 0, 51, 51, 51, 51, 0, - 0, 51, 0, 51, 0, 0, 51, 51, 0, 51, - 51, 0, 0, 51, 0, 0, 0, 0, 0, 51, - 0, 0, 51, 0, 51, 51, 51, 0, 51, 0, - 51, 51, 51, 0, 0, 0, 51, 0, 51, 51, - 51, 51, 0, 0, 0, 0, 51, 0, 51, 0, - 51, 0, 51, 0, 39, 51, 0, 0, 0, 0, - 0, 0, 51, 0, 0, 51, 0, 51, 51, 0, - 51, 51, 0, 51, 0, 0, 0, 0, 51, 0, - 51, 51, 51, 51, 0, 0, 0, 0, 51, 0, - 0, 51, 51, 51, 0, 0, 0, 40, 0, 0, - 0, 0, 0, 0, 51, 0, 51, 51, 51, 51, + 35, 0, 37, 0, 0, 35, 37, 0, 37, 35, + 0, 0, 35, 0, 0, 0, 0, 0, 37, 0, + 37, 37, 0, 37, 35, 35, 0, 37, 182, 35, + 35, 0, 31, 0, 31, 35, 0, 35, 35, 35, + 35, 0, 0, 0, 0, 35, 0, 37, 0, 35, + 0, 35, 192, 37, 37, 31, 0, 0, 0, 0, + 0, 35, 0, 0, 35, 0, 35, 0, 31, 0, + 35, 0, 0, 31, 0, 51, 0, 0, 31, 0, + 31, 31, 31, 31, 0, 0, 51, 0, 31, 0, + 35, 51, 31, 0, 0, 51, 35, 35, 51, 0, + 0, 0, 0, 0, 31, 0, 0, 31, 0, 31, + 51, 51, 0, 0, 0, 51, 51, 0, 51, 0, + 0, 51, 0, 51, 51, 51, 51, 0, 0, 51, + 0, 51, 0, 31, 51, 51, 0, 51, 51, 31, + 31, 51, 0, 0, 0, 0, 0, 51, 0, 0, + 51, 0, 51, 51, 51, 0, 51, 0, 51, 51, + 51, 0, 0, 0, 51, 0, 51, 51, 51, 51, + 0, 0, 0, 0, 51, 0, 51, 0, 51, 0, + 51, 0, 39, 51, 0, 0, 0, 0, 0, 0, + 51, 0, 0, 51, 0, 51, 51, 0, 51, 51, 0, 51, 0, 0, 0, 0, 51, 0, 51, 51, - 51, 51, 0, 0, 0, 0, 51, 0, 0, 0, - 51, 51, 0, 51, 0, 51, 51, 0, 0, 204, - 0, 0, 51, 0, 51, 51, 51, 51, 51, 51, + 51, 51, 0, 0, 0, 0, 51, 0, 0, 51, + 51, 51, 0, 0, 0, 40, 0, 0, 0, 0, + 0, 0, 51, 0, 51, 51, 51, 51, 0, 51, 0, 0, 0, 0, 51, 0, 51, 51, 51, 51, - 0, 0, 51, 0, 51, 0, 0, 0, 51, 51, - 0, 51, 0, 51, 51, 0, 0, 206, 0, 0, - 51, 0, 51, 51, 51, 51, 0, 51, 0, 0, + 0, 0, 0, 0, 51, 0, 0, 0, 51, 51, + 0, 51, 0, 51, 51, 0, 0, 204, 0, 0, + 51, 0, 51, 51, 51, 51, 51, 51, 0, 0, 0, 0, 51, 0, 51, 51, 51, 51, 0, 0, - 0, 0, 51, 0, 0, 0, 51, 51, 0, 51, - 0, 0, 0, 0, 51, 308, 51, 0, 51, 0, - 51, 51, 0, 51, 0, 51, 0, 0, 0, 0, - 51, 0, 51, 51, 51, 51, 0, 51, 0, 0, - 51, 0, 0, 0, 51, 0, 0, 51, 0, 0, - 51, 0, 0, 309, 465, 51, 51, 0, 0, 51, - 51, 51, 51, 51, 51, 51, 0, 0, 51, 0, - 51, 0, 0, 0, 51, 0, 0, 466, 0, 0, - 0, 0, 0, 0, 0, 51, 51, 51, 51, 51, - 467, 51, 0, 0, 0, 469, 0, 0, 0, 0, - 470, 0, 471, 472, 473, 474, 0, 0, 0, 0, - 475, 0, 0, 0, 476, 51, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 477, 0, 0, 478, - 0, 479, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 480, + 51, 0, 51, 0, 0, 0, 51, 51, 0, 51, + 0, 51, 51, 0, 0, 206, 0, 0, 51, 0, + 51, 51, 51, 51, 51, 51, 0, 0, 0, 0, + 51, 0, 51, 51, 51, 51, 0, 0, 0, 0, + 51, 0, 0, 0, 51, 51, 0, 51, 0, 0, + 0, 0, 471, 308, 0, 0, 51, 0, 51, 51, + 0, 51, 0, 51, 0, 0, 0, 0, 51, 0, + 51, 51, 51, 51, 0, 472, 51, 0, 51, 0, + 0, 0, 51, 0, 471, 51, 0, 0, 473, 0, + 0, 309, 474, 475, 51, 0, 0, 51, 476, 51, + 477, 478, 479, 480, 0, 0, 0, 472, 481, 0, + 0, 0, 482, 0, 0, 0, 0, 0, 0, 0, + 473, 0, 0, 51, 483, 475, 0, 484, 0, 485, + 476, 0, 477, 478, 479, 480, 0, 0, 0, 0, + 481, 0, 0, 0, 482, 0, 0, 0, 0, 0, + 0, 0, 0, 486, 0, 0, 483, 0, 0, 484, + 0, 485, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 486, }; protected static readonly short [] yyCheck = { 17, - 17, 299, 18, 17, 4, 529, 17, 87, 88, 51, - 189, 300, 51, 234, 531, 188, 247, 232, 6, 289, - 482, 68, 84, 323, 344, 59, 298, 20, 108, 298, - 157, 504, 334, 383, 59, 582, 575, 983, 296, 47, - 87, 88, 1163, 0, 593, 92, 77, 58, 761, 791, - 763, 113, 367, 115, 256, 73, 1199, 1200, 256, 77, - 256, 330, 1293, 602, 367, 112, 0, 113, 79, 115, - 81, 256, 256, 17, 17, 256, 256, 95, 256, 256, - 1311, 256, 268, 268, 17, 268, 294, 256, 325, 376, - 276, 256, 256, 1196, 256, 1508, 1509, 256, 306, 812, - 256, 256, 815, 988, 371, 1248, 374, 372, 256, 272, - 256, 256, 368, 341, 391, 257, 357, 680, 256, 199, - 200, 1243, 685, 686, 256, 172, 401, 17, 369, 268, - 256, 372, 373, 296, 191, 394, 395, 414, 413, 157, - 157, 369, 429, 157, 256, 386, 157, 189, 416, 1252, - 189, 382, 1565, 420, 423, 256, 705, 256, 17, 340, - 323, 339, 418, 17, 429, 367, 344, 369, 346, 371, - 282, 349, 350, 371, 352, 353, 372, 363, 374, 17, - 421, 418, 262, 367, 339, 368, 363, 371, 363, 344, - 232, 346, 256, 232, 349, 350, 374, 352, 353, 246, - 247, 370, 314, 367, 17, 374, 0, 371, 288, 371, - 418, 17, 259, 157, 157, 223, 17, 343, 420, 374, - 17, 423, 420, 525, 157, 381, 447, 256, 308, 247, - 528, 446, 418, 429, 1119, 253, 420, 422, 418, 422, - 228, 418, 374, 418, 547, 1367, 59, 764, 1479, 296, - 63, 429, 286, 418, 569, 575, 420, 358, 420, 418, - 322, 286, 296, 17, 326, 391, 569, 157, 325, 331, - 418, 289, 418, 418, 429, 1506, 294, 295, 825, 256, - 418, 328, 602, 422, 364, 331, 333, 1518, 414, 1520, - 593, 309, 391, 277, 319, 1270, 256, 256, 157, 317, - 257, 319, 428, 157, 1158, 323, 418, 318, 256, 256, - 256, 368, 376, 368, 358, 414, 373, 335, 336, 157, - 400, 401, 256, 424, 425, 426, 427, 344, 375, 256, - 344, 378, 1045, 256, 363, 382, 383, 256, 256, 256, - 371, 370, 256, 372, 157, 374, 256, 910, 428, 429, - 1092, 157, 1473, 371, 256, 256, 157, 256, 256, 263, - 157, 256, 21, 418, 382, 383, 915, 335, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 363, - 256, 428, 429, 946, 256, 432, 256, 305, 1363, 418, - 367, 706, 256, 52, 1369, 452, 1539, 335, 256, 376, - 418, 256, 705, 157, 446, 339, 1352, 446, 367, 368, - 369, 315, 371, 372, 456, 374, 376, 376, 257, 256, - 256, 1396, 20, 726, 372, 371, 1569, 990, 375, 992, - 487, 948, 995, 367, 418, 419, 418, 371, 256, 373, - 374, 375, 376, 325, 256, 453, 454, 381, 375, 749, - 367, 459, 375, 256, 927, 448, 503, 496, 505, 418, - 1173, 420, 381, 257, 423, 375, 368, 381, 1181, 462, - 266, 372, 374, 286, 958, 374, 374, 372, 272, 504, - 256, 702, 529, 277, 305, 363, 497, 281, 262, 87, - 88, 429, 1205, 343, 368, 305, 372, 369, 266, 369, - 547, 368, 296, 734, 551, 369, 319, 857, 766, 527, - 108, 529, 363, 531, 372, 351, 294, 372, 314, 1082, - 741, 1084, 1039, 1086, 298, 840, 1073, 256, 306, 323, - 256, 344, 543, 544, 591, 372, 418, 840, 341, 557, - 418, 391, 256, 363, 562, 592, 314, 1260, 342, 606, - 264, 369, 609, 610, 547, 429, 1410, 369, 575, 376, - 571, 575, 429, 339, 414, 277, 369, 418, 344, 281, - 346, 582, 372, 349, 350, 368, 352, 353, 428, 375, - 367, 1065, 368, 1067, 371, 602, 1440, 1441, 602, 1443, - 376, 373, 369, 368, 376, 1142, 614, 615, 418, 914, - 1454, 199, 200, 1457, 378, 379, 372, 375, 428, 372, - 339, 325, 915, 343, 912, 344, 363, 346, 1472, 368, - 349, 350, 1185, 352, 353, 368, 376, 256, 363, 429, - 342, 372, 863, 420, 294, 682, 429, 684, 1177, 696, - 942, 367, 1496, 429, 343, 371, 693, 373, 374, 776, - 376, 381, 1215, 429, 429, 381, 363, 256, 371, 716, - 1276, 391, 680, 429, 262, 294, 429, 685, 686, 263, - 688, 418, 363, 363, 256, 947, 945, 418, 369, 369, - 429, 428, 381, 418, 414, 367, 429, 734, 1276, 415, - 288, 504, 391, 357, 983, 374, 272, 357, 428, 1262, - 429, 369, 300, 363, 751, 373, 1322, 1276, 1276, 369, - 308, 418, 372, 373, 272, 414, 734, 797, 1281, 766, - 296, 315, 386, 305, 1275, 1276, 386, 418, 418, 428, - 368, 749, 766, 1206, 1322, 1276, 374, 416, 296, 727, - 820, 803, 1042, 381, 256, 1296, 764, 323, 1276, 1276, - 1276, 369, 770, 1322, 1322, 423, 836, 1055, 418, 806, - 391, 421, 575, 381, 1372, 323, 364, 269, 367, 367, - 339, 1322, 371, 1324, 373, 374, 1007, 376, 1386, 256, - 339, 1322, 381, 414, 286, 339, 398, 399, 799, 602, - 357, 256, 839, 1040, 1322, 1322, 1322, 428, 367, 817, - 1408, 819, 400, 401, 269, 386, 373, 371, 367, 373, - 857, 829, 823, 367, 825, 1135, 863, 376, 368, 386, - 371, 286, 1069, 1358, 374, 381, 999, 339, 392, 393, - 428, 429, 344, 1368, 346, 391, 916, 349, 350, 857, - 352, 353, 1358, 384, 306, 863, 888, 865, 412, 867, - 448, 313, 1368, 368, 368, 369, 420, 1177, 414, 423, - 1130, 376, 339, 325, 462, 1163, 389, 344, 256, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 919, 367, 306, 372, 308, 374, 357, 376, 385, 313, - 376, 368, 910, 370, 912, 372, 1166, 374, 375, 376, - 957, 325, 373, 272, 897, 952, 373, 954, 277, 376, - 6, 929, 281, 960, 902, 386, 934, 429, 357, 937, - 367, 17, 400, 1243, 1386, 1156, 256, 296, 946, 376, - 948, 367, 1012, 1203, 373, 371, 306, 373, 374, 986, - 376, 368, 369, 313, 1461, 381, 367, 386, 761, 547, - 763, 339, 429, 390, 323, 376, 344, 367, 346, 367, - 1007, 349, 350, 59, 352, 353, 376, 63, 376, 382, - 383, 569, 990, 342, 992, 373, 1023, 995, 376, 415, - 369, 1332, 1029, 396, 397, 368, 256, 367, 368, 1007, - 1341, 87, 88, 376, 369, 593, 376, 372, 256, 812, - 368, 1222, 815, 1218, 372, 371, 1523, 1064, 376, 339, - 415, 1004, 108, 1283, 344, 1194, 346, 414, 415, 349, - 350, 1039, 352, 353, 1042, 418, 1014, 368, 1016, 1332, - 1018, 367, 368, 374, 418, 376, 357, 374, 1341, 376, - 376, 429, 363, 1560, 381, 256, 370, 1367, 369, 368, - 374, 372, 373, 374, 277, 374, 370, 371, 1582, 1583, - 374, 157, 1073, 1352, 1082, 386, 1084, 376, 1086, 339, - 371, 1089, 373, 370, 344, 372, 346, 374, 376, 349, - 350, 339, 352, 353, 367, 370, 344, 372, 346, 374, - 256, 349, 350, 373, 352, 353, 371, 418, 373, 429, - 1100, 370, 368, 199, 200, 374, 372, 705, 374, 1156, - 376, 370, 1130, 370, 376, 374, 368, 374, 1135, 1158, - 372, 1135, 374, 367, 376, 369, 1144, 1145, 726, 370, - 371, 1142, 373, 374, 375, 372, 370, 256, 1156, 376, - 374, 1157, 372, 372, 376, 1163, 376, 376, 1166, 370, - 354, 355, 1194, 374, 1196, 1194, 294, 1196, 372, 429, - 1177, 294, 376, 1177, 354, 355, 262, 1185, 406, 407, - 408, 409, 372, 1191, 374, 1473, 1218, 364, 365, 1218, - 386, 387, 388, 343, 372, 1203, 374, 370, 372, 372, - 286, 376, 288, 374, 1274, 376, 414, 1215, 1216, 797, - 370, 418, 372, 368, 300, 372, 371, 374, 373, 374, - 1252, 356, 308, 1252, 375, 370, 381, 372, 370, 372, - 372, 374, 820, 319, 372, 373, 1243, 392, 393, 1243, - 364, 365, 1045, 1275, 1276, 370, 1275, 372, 836, 370, - 418, 372, 840, 418, 1262, 1161, 1162, 412, 344, 369, - 374, 1331, 376, 376, 1296, 420, 372, 1296, 423, 374, - 374, 376, 376, 1281, 374, 1283, 376, 372, 364, 1349, - 1350, 367, 402, 403, 381, 404, 405, 368, 1325, 374, - 1322, 294, 1324, 410, 411, 1324, 372, 294, 372, 374, - 372, 374, 372, 256, 1374, 376, 428, 1377, 371, 897, - 1357, 256, 428, 368, 400, 401, 371, 294, 373, 374, - 294, 381, 372, 374, 373, 418, 374, 915, 916, 375, - 373, 372, 1135, 429, 1335, 374, 1383, 392, 393, 381, - 93, 374, 428, 429, 97, 98, 99, 100, 101, 102, - 103, 104, 374, 1400, 374, 423, 372, 412, 367, 374, - 1367, 374, 421, 1367, 372, 420, 373, 372, 423, 294, - 1173, 1418, 343, 1420, 1177, 374, 294, 370, 1181, 374, - 418, 1410, 371, 418, 367, 375, 256, 256, 374, 256, - 1391, 256, 280, 381, 256, 983, 256, 367, 371, 368, - 372, 343, 1205, 265, 370, 267, 374, 372, 270, 376, - 374, 1440, 1441, 275, 1443, 376, 1004, 279, 504, 1451, - 370, 372, 423, 372, 1012, 1454, 288, 381, 1457, 367, - 347, 256, 256, 295, 381, 381, 1468, 372, 300, 372, - 1243, 368, 304, 1472, 376, 256, 347, 370, 374, 1481, - 1482, 375, 372, 1461, 316, 370, 318, 1260, 1459, 367, - 322, 547, 339, 370, 348, 1473, 368, 1496, 330, 331, - 381, 374, 334, 372, 418, 337, 1508, 1509, 418, 256, - 348, 368, 1490, 569, 367, 367, 367, 381, 368, 575, - 376, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 363, 356, 376, 368, 61, 372, 593, 256, 65, - 66, 67, 371, 69, 70, 1523, 602, 374, 74, 75, - 368, 368, 337, 305, 369, 81, 418, 83, 371, 85, - 368, 367, 371, 1565, 90, 91, 376, 371, 371, 418, - 418, 373, 418, 371, 381, 1582, 1583, 367, 371, 302, - 381, 369, 1560, 372, 371, 256, 418, 373, 114, 372, - 374, 373, 418, 372, 1367, 1566, 1567, 374, 374, 374, - 372, 370, 1573, 1574, 1582, 1583, 376, 418, 376, 376, - 372, 334, 376, 418, 372, 381, 372, 368, 418, 342, - 0, 339, 381, 372, 370, 368, 344, 367, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 1197, - 315, 263, 371, 371, 368, 372, 372, 0, 0, 705, - 368, 367, 370, 368, 372, 376, 374, 375, 376, 376, - 372, 0, 368, 372, 372, 418, 370, 368, 368, 372, - 726, 367, 390, 372, 397, 398, 399, 370, 376, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 368, 1254, 376, 418, 418, - 372, 256, 376, 368, 368, 761, 376, 763, 367, 367, - 265, 429, 267, 0, 368, 270, 1274, 372, 368, 372, - 275, 367, 315, 263, 279, 376, 373, 376, 376, 255, - 50, 376, 258, 288, 376, 376, 376, 376, 376, 12, - 295, 797, 5, 897, 1004, 300, 1156, 1156, 1324, 304, - 1296, 1513, 1476, 1529, 1493, 1459, 812, 919, 1464, 815, - 919, 316, 919, 318, 820, 914, 740, 322, 1372, 1574, - 1322, 1392, 298, 1331, 1332, 330, 331, 1568, 1486, 334, - 836, 261, 337, 1341, 840, 1482, 1252, 1481, 314, 1420, - 547, 1349, 1350, 1567, 1352, 1254, 942, 937, 770, 863, - 1358, 615, 525, 888, 284, 382, 734, 1055, 337, 71, - 1368, 766, 412, 414, 1372, 413, 1374, 297, 415, 1377, - 416, 301, 302, 417, 569, 840, 1232, 307, 1386, 309, - 310, 311, 312, 1331, 157, 1135, 1041, 317, 1121, 1145, - 1025, 321, 1069, 0, 1133, 1206, 962, 1135, 545, 437, - 1408, 437, 1216, 333, 1327, 894, 336, 893, 338, 915, - 916, -1, -1, 418, -1, -1, 691, -1, -1, -1, - -1, -1, -1, -1, -1, 598, 256, 257, -1, -1, - -1, -1, 362, -1, 264, 265, 266, 267, 268, -1, - 270, 271, -1, 273, 274, 275, 276, 277, 278, 279, - 280, -1, -1, -1, -1, 285, -1, 287, 288, 289, - 290, 291, 292, -1, -1, 295, -1, -1, -1, 299, - 300, -1, 302, 303, 304, -1, -1, 983, -1, -1, - -1, -1, -1, -1, 314, -1, 316, -1, 318, 319, - -1, -1, 322, -1, 324, 325, 326, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 1012, 337, -1, -1, - 340, 341, -1, -1, 344, 345, -1, -1, -1, 256, - -1, -1, -1, 499, -1, 262, -1, -1, -1, 359, - 360, 361, 362, 363, -1, -1, -1, 367, 368, 1045, - -1, 371, -1, -1, -1, -1, 376, 377, 378, 379, - 380, -1, -1, 0, 384, -1, 386, -1, -1, -1, - -1, 298, 392, 393, -1, -1, -1, 543, -1, -1, + 4, 302, 18, 303, 234, 17, 17, 540, 190, 236, + 52, 292, 488, 189, 538, 17, 510, 52, 326, 6, + 350, 69, 85, 20, 60, 301, 301, 587, 1001, 158, + 337, 594, 249, 389, 605, 78, 1183, 805, 1222, 299, + 88, 89, 0, 256, 114, 93, 116, 256, 59, 256, + 1325, 114, 256, 116, 614, 268, 74, 774, 333, 776, + 78, 60, 1216, 45, 17, 113, 48, 373, 1343, 80, + 256, 82, 17, 88, 89, 256, 256, 1261, 96, 256, + 1300, 256, 373, 256, 256, 256, 1006, 256, 368, 17, + 256, 0, 1276, 256, 109, 335, 376, 17, 62, 17, + 268, 256, 66, 67, 68, 256, 70, 71, 256, 294, + 827, 75, 76, 830, 256, 268, 263, 269, 82, 374, + 84, 306, 86, 256, 256, 173, 1280, 91, 92, 256, + 1058, 372, 368, 357, 286, 256, 343, 256, 374, 305, + 158, 17, 713, 264, 367, 256, 158, 158, 190, 429, + 282, 115, 368, 376, 429, 190, 158, 256, 358, 339, + 1088, 416, 386, 372, 344, 374, 346, 192, 315, 349, + 350, 388, 352, 353, 256, 1395, 17, 363, 256, 0, + 1400, 17, 314, 17, 391, 200, 201, 391, 429, 429, + 371, 363, 234, 429, 374, 256, 371, 256, 17, 234, + 248, 249, 418, 277, 325, 158, 256, 414, 381, 422, + 414, 693, 381, 158, 262, 368, 698, 699, 1138, 374, + 429, 428, 452, 17, 60, 367, 453, 534, 64, 371, + 158, 249, 418, 418, 1509, 1455, 537, 255, 158, 420, + 158, 418, 224, 230, 777, 420, 418, 418, 367, 429, + 265, 299, 371, 289, 422, 418, 367, 587, 369, 358, + 371, 1536, 325, 299, 334, 556, 329, 418, 17, 422, + 418, 334, 578, 1548, 292, 1550, 291, 840, 420, 297, + 298, 256, 158, 331, 614, 418, 418, 578, 336, 363, + 289, 418, 374, 257, 312, 256, 311, 261, 376, 257, + 348, 420, 320, 328, 322, 268, 367, 256, 326, 420, + 321, 257, 423, 276, 605, 376, 375, 158, 256, 1178, + 338, 339, 158, 322, 158, 424, 425, 426, 427, 344, + 345, 381, 256, 381, 377, 20, 384, 301, 350, 158, + 388, 389, 325, 1111, 418, 419, 1063, 256, 350, 374, + 256, 368, 256, 317, 379, 370, 1503, 262, 1217, 377, + 931, 292, 21, 256, 158, 256, 256, 256, 335, 277, + 388, 389, 256, 281, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 1569, 434, 435, 363, 256, + 438, 406, 407, 298, 53, 370, 256, 372, 369, 374, + 363, 418, 373, 88, 89, 257, 424, 256, 714, 158, + 452, 1384, 256, 256, 375, 1599, 256, 452, 256, 434, + 435, 463, 713, 256, 109, 256, 256, 376, 463, 256, + 339, 964, 256, 458, 342, 418, 257, 375, 256, 256, + 371, 263, 256, 418, 926, 418, 370, 340, 739, 943, + 374, 272, 423, 289, 762, 418, 277, 454, 367, 976, + 281, 509, 371, 511, 373, 374, 375, 376, 493, 375, + 374, 468, 381, 378, 379, 296, 1193, 459, 460, 368, + 962, 372, 372, 465, 1201, 374, 322, 292, 372, 420, + 538, 351, 503, 315, 721, 266, 339, 341, 1180, 325, + 368, 344, 323, 346, 305, 372, 349, 350, 556, 352, + 353, 510, 560, 1230, 350, 200, 201, 873, 536, 779, + 538, 342, 540, 372, 1057, 369, 1008, 754, 1010, 1092, + 747, 1013, 372, 368, 372, 363, 367, 1219, 371, 369, + 367, 505, 553, 314, 371, 369, 373, 374, 566, 376, + 856, 369, 369, 571, 381, 369, 604, 266, 583, 556, + 372, 429, 367, 368, 401, 856, 391, 1084, 343, 1086, + 339, 582, 368, 1290, 363, 587, 413, 368, 603, 363, + 265, 1440, 256, 594, 343, 587, 429, 370, 552, 414, + 418, 374, 418, 618, 429, 368, 621, 622, 367, 1162, + 428, 305, 614, 368, 375, 314, 291, 1307, 626, 627, + 1469, 1470, 614, 1472, 372, 256, 391, 429, 303, 1101, + 294, 1103, 381, 1105, 930, 1484, 311, 928, 1487, 418, + 1306, 1307, 391, 429, 418, 368, 363, 1197, 429, 414, + 931, 374, 256, 1502, 428, 1538, 1539, 695, 381, 697, + 256, 958, 1328, 428, 1354, 414, 429, 372, 706, 344, + 345, 790, 879, 363, 429, 363, 375, 1526, 371, 428, + 294, 429, 371, 363, 510, 693, 375, 357, 1354, 369, + 698, 699, 306, 701, 709, 370, 961, 963, 373, 369, + 371, 418, 372, 373, 376, 272, 429, 256, 339, 747, + 1376, 1001, 1595, 344, 729, 346, 386, 363, 349, 350, + 343, 352, 353, 369, 429, 256, 764, 420, 418, 296, + 418, 406, 407, 1205, 1307, 339, 341, 1307, 418, 747, + 344, 779, 346, 374, 369, 349, 350, 1231, 352, 353, + 372, 421, 1403, 779, 762, 1307, 323, 429, 381, 434, + 435, 587, 1060, 740, 369, 818, 1417, 1239, 391, 777, + 256, 367, 418, 374, 305, 371, 784, 373, 374, 454, + 376, 1354, 1073, 821, 1354, 381, 1307, 1438, 614, 1303, + 339, 414, 272, 468, 339, 344, 418, 346, 429, 272, + 349, 350, 1354, 352, 353, 428, 811, 1307, 256, 391, + 1307, 812, 1307, 814, 256, 416, 296, 855, 1025, 415, + 1292, 339, 367, 296, 832, 429, 834, 269, 376, 367, + 835, 376, 414, 1354, 1154, 873, 844, 838, 376, 840, + 1312, 879, 339, 323, 286, 306, 428, 852, 1366, 367, + 323, 1017, 313, 339, 1354, 1373, 810, 1354, 344, 1354, + 346, 339, 381, 349, 350, 873, 352, 353, 394, 395, + 367, 879, 391, 881, 371, 883, 908, 1197, 1149, 339, + 429, 556, 370, 908, 367, 272, 374, 369, 367, 367, + 277, 339, 1183, 376, 281, 414, 344, 375, 346, 381, + 256, 349, 350, 578, 352, 353, 306, 367, 308, 296, + 367, 368, 367, 313, 376, 1186, 368, 357, 926, 376, + 928, 376, 374, 357, 6, 325, 913, 932, 371, 381, + 605, 969, 368, 373, 972, 17, 323, 945, 374, 373, + 978, 918, 950, 429, 367, 953, 386, 357, 774, 386, + 776, 1417, 386, 376, 962, 342, 964, 1228, 306, 967, + 975, 367, 368, 373, 1390, 313, 1004, 371, 1491, 1176, + 376, 1291, 368, 1399, 389, 1390, 386, 325, 60, 368, + 376, 429, 64, 339, 1399, 374, 369, 1025, 344, 372, + 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, + 1008, 827, 1010, 1041, 830, 1013, 88, 89, 373, 1047, + 384, 376, 368, 256, 370, 368, 372, 1025, 374, 375, + 376, 374, 1242, 376, 370, 1030, 368, 109, 374, 1246, + 1553, 382, 383, 368, 376, 1022, 368, 372, 713, 374, + 372, 376, 1214, 1314, 376, 396, 397, 373, 385, 1057, + 376, 265, 1060, 267, 256, 1032, 270, 1034, 371, 1036, + 373, 275, 370, 371, 739, 279, 374, 1590, 1083, 373, + 400, 368, 376, 429, 288, 372, 158, 374, 390, 376, + 374, 295, 376, 256, 370, 1366, 300, 381, 374, 369, + 304, 1092, 1373, 1101, 1384, 1103, 339, 1105, 1612, 1613, + 1108, 344, 316, 346, 318, 415, 349, 350, 322, 352, + 353, 372, 371, 374, 373, 376, 330, 331, 200, 201, + 334, 398, 399, 337, 371, 1119, 373, 418, 370, 371, + 370, 373, 374, 375, 374, 372, 811, 339, 1176, 376, + 418, 1149, 344, 277, 346, 392, 393, 349, 350, 363, + 352, 353, 1154, 373, 372, 372, 1164, 1165, 376, 376, + 835, 1162, 1154, 370, 367, 412, 369, 374, 1176, 367, + 370, 1177, 372, 420, 374, 1183, 423, 852, 1186, 368, + 369, 856, 1214, 265, 1216, 372, 429, 374, 370, 1214, + 372, 1216, 374, 376, 372, 1197, 376, 1205, 376, 256, + 386, 387, 388, 1211, 418, 1197, 372, 289, 374, 291, + 1242, 256, 1503, 412, 413, 414, 415, 1242, 357, 373, + 1228, 303, 256, 370, 363, 372, 374, 376, 376, 311, + 369, 1239, 1240, 372, 373, 374, 376, 1063, 913, 370, + 322, 372, 370, 294, 372, 367, 294, 386, 1280, 371, + 343, 373, 374, 372, 376, 1280, 931, 932, 294, 381, + 367, 368, 344, 345, 370, 1303, 372, 372, 350, 374, + 372, 0, 374, 376, 1306, 1307, 370, 414, 372, 418, + 418, 1306, 1307, 370, 1292, 372, 354, 355, 370, 1291, + 374, 373, 376, 415, 418, 1303, 1328, 356, 256, 1291, + 1305, 354, 355, 1328, 1312, 374, 1314, 376, 368, 369, + 367, 368, 369, 369, 371, 372, 374, 374, 376, 376, + 1358, 357, 1354, 418, 406, 407, 1001, 363, 1154, 1354, + 374, 372, 376, 369, 414, 415, 372, 373, 364, 365, + 372, 373, 367, 368, 1376, 364, 365, 1022, 410, 411, + 386, 1376, 434, 435, 375, 1030, 408, 409, 372, 376, + 1365, 418, 368, 420, 374, 381, 423, 1193, 1369, 416, + 417, 1197, 372, 294, 1389, 1201, 1381, 1382, 294, 429, + 374, 339, 418, 372, 372, 421, 344, 374, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 1414, + 1405, 372, 256, 1408, 1230, 428, 376, 371, 428, 256, + 368, 294, 370, 294, 372, 1430, 374, 375, 376, 381, + 372, 1422, 375, 374, 382, 383, 384, 385, 510, 373, + 373, 389, 390, 1448, 374, 1450, 394, 395, 396, 397, + 398, 399, 400, 401, 418, 381, 372, 374, 429, 1481, + 374, 374, 374, 372, 423, 413, 1481, 374, 367, 374, + 421, 372, 374, 373, 1290, 1291, 1498, 372, 343, 294, + 294, 429, 374, 1498, 556, 370, 418, 371, 367, 1511, + 1512, 418, 375, 1491, 256, 256, 1511, 1512, 1489, 374, + 256, 256, 280, 94, 381, 1503, 578, 98, 99, 100, + 101, 102, 103, 104, 105, 587, 1538, 1539, 261, 256, + 367, 372, 1520, 1538, 1539, 368, 343, 376, 370, 374, + 371, 370, 423, 605, 374, 381, 372, 256, 376, 372, + 372, 284, 614, 262, 372, 347, 367, 381, 256, 256, + 381, 376, 372, 1218, 297, 1553, 372, 368, 256, 302, + 347, 374, 370, 375, 307, 371, 309, 310, 311, 312, + 370, 292, 370, 1595, 317, 372, 339, 348, 321, 298, + 1595, 374, 368, 418, 1612, 1613, 256, 372, 371, 418, + 333, 372, 1590, 336, 348, 338, 368, 367, 367, 381, + 0, 376, 367, 356, 368, 1596, 1597, 374, 376, 368, + 368, 371, 1603, 1604, 1612, 1613, 305, 337, 1283, 362, + 339, 364, 365, 372, 372, 344, 368, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 418, 371, + 1305, 713, 369, 367, 363, 418, 371, 376, 367, 368, + 381, 370, 371, 372, 371, 374, 375, 376, 371, 378, + 379, 418, 373, 382, 383, 384, 385, 739, 418, 371, + 389, 390, 367, 372, 371, 394, 395, 396, 397, 398, + 399, 400, 401, 369, 371, 381, 374, 372, 256, 373, + 373, 372, 374, 285, 413, 374, 374, 416, 372, 418, + 1365, 1366, 774, 418, 776, 376, 370, 376, 1373, 418, + 429, 376, 418, 372, 305, 418, 1381, 1382, 376, 1384, + 372, 381, 372, 368, 381, 1390, 370, 368, 367, 372, + 315, 263, 368, 371, 1399, 327, 371, 0, 1403, 811, + 1405, 372, 372, 1408, 0, 367, 337, 376, 368, 376, + 0, 256, 1417, 372, 368, 827, 347, 372, 830, 367, + 372, 370, 418, 835, 368, 372, 368, 372, 367, 370, + 418, 0, 418, 1438, 368, 372, 376, 372, 376, 368, + 852, 315, 368, 376, 856, 377, 378, 379, 380, 376, + 382, 383, 384, 385, 386, 387, 388, 389, 367, 372, + 392, 393, 394, 395, 396, 397, 398, 399, 368, 372, + 376, 368, 403, 404, 405, 367, 263, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, + 421, 422, 423, 373, 339, 376, 51, 376, 376, 344, + 376, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 376, 376, 376, 376, 256, 12, 5, 931, + 932, 261, 262, 368, 1022, 370, 1176, 372, 913, 374, + 375, 376, 1176, 1376, 1328, 1224, 368, 1543, 1506, 371, + 385, 373, 374, 1559, 284, 390, 1494, 1489, 1523, 381, + 753, 935, 1403, 1604, 1354, 400, 401, 297, 298, 935, + 392, 393, 302, 935, 1423, 305, 1342, 307, 413, 309, + 310, 311, 312, 930, 1512, 1516, 1598, 317, 1511, 1280, + 412, 321, 1597, 1450, 429, 325, 908, 1283, 420, 1001, + 556, 423, 953, 333, 784, 958, 336, 429, 338, 339, + 879, 1073, 388, 534, 344, 0, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 747, 1030, 627, + 72, 779, 362, 363, 340, 418, 420, 367, 368, 419, + 370, 371, 372, 373, 374, 375, 376, 421, 378, 379, + 422, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 1063, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 423, 1182, 416, 578, 418, 610, + 420, 1365, 1258, 423, 158, 1291, 856, 256, 257, 429, + 1059, 1154, 1140, 1088, 1165, 264, 265, 266, 267, 268, + 1043, 270, 271, 1154, 273, 274, 275, 276, 277, 278, + 279, 280, 1152, 1231, 554, 1200, 285, 980, 287, 288, + 289, 290, 291, 292, 443, 443, 295, 704, 1360, 1240, + 299, 300, 663, 302, 303, 304, -1, 903, -1, -1, + -1, 0, 1154, 910, -1, 314, -1, 316, -1, 318, + 319, -1, -1, 322, -1, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, -1, 337, -1, + -1, 340, 341, -1, -1, 344, 345, -1, -1, -1, + -1, 1193, -1, -1, -1, 1197, -1, -1, -1, 1201, + 359, 360, 361, 362, 363, -1, -1, -1, 367, 368, + -1, -1, 371, -1, 381, -1, 1218, 376, 377, 378, + 379, 380, -1, -1, -1, 384, -1, 386, 1230, -1, + -1, -1, -1, 392, 393, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, -1, -1, -1, -1, 368, + -1, -1, 371, -1, 373, 374, -1, -1, 417, 418, + 419, 420, 783, 422, -1, -1, -1, -1, -1, -1, + 429, -1, 257, 392, 393, -1, 261, 0, -1, -1, + -1, 1283, -1, -1, -1, -1, -1, 272, 1290, 1291, + -1, -1, 277, 412, -1, -1, 281, -1, -1, 284, + -1, 420, -1, 1305, 423, -1, -1, -1, -1, -1, + 429, 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, + 335, 336, -1, 338, -1, -1, -1, 342, -1, -1, + -1, -1, -1, 1365, 1366, -1, -1, -1, -1, -1, + -1, 1373, -1, -1, -1, -1, -1, 362, -1, 1381, + 1382, -1, 1384, 368, 369, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 417, 418, 419, - 420, -1, 422, -1, -1, -1, 769, -1, -1, 429, - -1, -1, 339, -1, -1, -1, -1, 344, -1, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, -1, -1, -1, -1, -1, 363, -1, -1, 1135, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - -1, 378, 379, -1, -1, 382, 383, 384, 385, 386, - 257, -1, 389, 390, 261, -1, -1, 394, 395, 396, - 397, 398, 399, 400, 401, 272, -1, 1173, -1, -1, - 277, 1177, -1, -1, 281, 1181, 413, 284, -1, 416, - -1, 418, -1, 420, 256, -1, 423, -1, -1, 296, - 297, 1197, 429, -1, 301, 302, -1, -1, -1, 1205, - 307, -1, 309, 310, 311, 312, -1, -1, -1, -1, - 317, -1, -1, -1, 321, -1, 323, -1, -1, -1, - -1, 0, -1, -1, -1, -1, 333, -1, 335, 336, - -1, 338, -1, -1, -1, 342, -1, 1243, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 1254, -1, - -1, -1, -1, -1, 1260, 362, -1, -1, -1, -1, - -1, 368, 369, -1, -1, -1, -1, 339, 1274, 942, - -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, -1, - 372, -1, 374, 375, 376, -1, -1, -1, -1, 256, - -1, -1, 384, 385, 261, 262, -1, 389, 390, -1, - -1, -1, -1, -1, -1, 1331, 1332, -1, 400, 401, - -1, -1, -1, -1, -1, 1341, -1, 284, -1, -1, - -1, 413, -1, 1349, 1350, -1, 1352, 0, -1, -1, - 297, 298, -1, -1, -1, 302, -1, 429, 305, -1, - 307, 1367, 309, 310, 311, 312, -1, -1, 1374, -1, - 317, 1377, -1, -1, 321, -1, -1, -1, 325, -1, - -1, -1, -1, -1, -1, -1, 333, -1, -1, 336, - -1, 338, 339, -1, -1, -1, -1, 344, -1, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - -1, -1, -1, -1, -1, 362, 363, -1, -1, -1, - 367, 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, -1, 416, - -1, 418, -1, 420, -1, -1, 423, 256, 257, -1, - -1, -1, 429, -1, -1, 264, 265, 266, 267, 268, + -1, -1, -1, 1405, -1, -1, 1408, 256, 257, -1, + -1, -1, -1, -1, -1, 264, 265, 266, 267, 268, -1, 270, 271, 0, 273, 274, 275, 276, 277, 278, - 279, -1, -1, -1, -1, -1, 285, -1, 287, 288, + 279, -1, -1, -1, -1, -1, 285, 958, 287, 288, 289, 290, 291, 292, -1, -1, 295, -1, -1, -1, 299, 300, -1, 302, 303, 304, -1, -1, -1, -1, -1, -1, -1, -1, -1, 314, -1, 316, -1, 318, @@ -12870,14 +13076,14 @@ void case_1035() -1, -1, 429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, -1, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, -1, -1, -1, -1, -1, -1, - 363, -1, -1, -1, 367, 368, -1, 370, 371, 372, - -1, 374, 375, 376, -1, 378, 379, -1, -1, 382, - 383, 384, 385, -1, 0, -1, 389, 390, -1, -1, + 353, 354, 355, 356, 357, -1, -1, -1, -1, -1, + 363, -1, -1, -1, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, -1, 378, 379, -1, -1, 382, + 383, 384, 385, 386, 0, -1, 389, 390, -1, -1, -1, 394, 395, 396, 397, 398, 399, 400, 401, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 413, -1, -1, 416, -1, 418, -1, -1, -1, -1, - -1, -1, 256, 257, -1, -1, 429, 261, -1, -1, + 413, -1, -1, 416, -1, 418, -1, 420, -1, -1, + 423, -1, 256, 257, -1, -1, 429, 261, -1, -1, -1, 265, -1, 267, -1, -1, 270, -1, 272, 273, -1, 275, -1, 277, -1, 279, -1, 281, 282, 283, 284, -1, -1, 287, 288, -1, -1, -1, 0, 293, @@ -12982,20 +13188,20 @@ void case_1035() 401, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 412, 413, -1, -1, -1, -1, -1, -1, 420, -1, -1, 423, -1, -1, -1, -1, -1, 429, -1, - 285, 339, -1, -1, -1, -1, 344, -1, 346, 347, + -1, 339, -1, -1, -1, -1, 344, -1, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, -1, -1, -1, -1, 363, -1, -1, -1, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 256, - 378, 379, 327, 381, 382, 383, 384, 385, 386, 387, + 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, -1, -1, 418, -1, 420, 262, -1, 423, -1, -1, -1, -1, - -1, 429, 377, 378, 379, 380, -1, 382, 383, 384, - 385, 386, 387, 388, 389, -1, -1, 392, 393, 394, - 395, 396, 397, 398, 399, -1, -1, -1, -1, 298, + -1, 429, -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, 298, -1, -1, 339, -1, -1, -1, -1, 344, -1, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, + 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, -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, 344, -1, 346, 347, 348, @@ -13016,7 +13222,7 @@ void case_1035() -1, 330, 331, 262, -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, 367, 368, 298, + -1, -1, -1, -1, 363, -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, -1, 392, 393, 394, 395, 396, 397, 398, 399, @@ -13087,27 +13293,27 @@ void case_1035() 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, -1, -1, -1, 418, -1, 420, -1, -1, 423, -1, 418, -1, -1, -1, 429, -1, -1, 339, -1, - -1, -1, -1, 344, -1, 346, 347, 348, 349, 350, + -1, -1, 256, 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, -1, 372, -1, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 261, -1, -1, 394, 395, 396, 397, 398, 399, 400, + -1, -1, -1, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 256, 413, 284, -1, -1, -1, 262, -1, -1, - -1, -1, -1, -1, -1, -1, 297, -1, 429, -1, - -1, 302, -1, -1, 305, -1, 307, -1, 309, 310, - 311, 312, -1, -1, -1, -1, 317, -1, -1, -1, - 321, -1, -1, 298, 325, -1, -1, -1, -1, -1, - -1, -1, 333, -1, -1, 336, -1, 338, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, + 411, 256, 413, -1, -1, -1, -1, 262, -1, -1, + -1, -1, -1, -1, -1, 339, -1, -1, 429, -1, + 344, -1, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 298, 368, -1, 370, -1, 372, -1, + 374, 375, 376, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 390, -1, -1, 256, -1, -1, -1, -1, -1, 262, -1, -1, -1, -1, - -1, 362, -1, -1, 339, -1, -1, 368, -1, 344, + -1, -1, -1, -1, 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, + 355, 356, -1, -1, -1, 429, -1, -1, -1, -1, -1, 298, -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, -1, 378, 379, -1, -1, 382, 383, 384, - 385, 386, 387, 388, 389, 390, -1, 418, -1, 394, + 385, 386, 387, 388, 389, 390, -1, -1, -1, 394, 395, 396, 397, 398, 399, 400, 401, -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, 413, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, @@ -13124,174 +13330,224 @@ void case_1035() 353, 354, 355, 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, 298, -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, -1, 378, 379, -1, -1, 382, - 383, 384, 385, -1, -1, -1, 389, 390, -1, 256, + 383, 384, 385, -1, -1, -1, 389, 390, -1, -1, -1, 394, 395, 396, 397, 398, 399, 400, 401, -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, 413, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, -1, 378, 379, -1, -1, 382, 383, 384, - 385, -1, -1, -1, 389, 390, -1, 256, -1, 394, - 395, 396, 397, 398, 399, 400, 401, -1, -1, -1, - -1, -1, 339, -1, -1, -1, -1, 344, 413, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, - -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, - -1, -1, -1, -1, -1, 382, 383, 384, 385, -1, - -1, -1, 389, 390, -1, 256, -1, 394, 395, 396, - 397, 398, 399, 400, 401, -1, -1, -1, -1, -1, - 339, -1, -1, -1, -1, 344, 413, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, - -1, -1, 429, -1, -1, -1, -1, -1, -1, 368, - -1, 370, -1, 372, -1, 374, 375, 376, -1, -1, - -1, -1, -1, 382, 383, 384, 385, -1, -1, -1, - 389, 390, -1, 256, -1, 394, 395, 396, 397, 398, - 399, 400, 401, -1, -1, -1, -1, -1, 339, -1, - -1, -1, -1, 344, 413, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, - 429, -1, -1, -1, -1, -1, -1, 368, -1, 370, - -1, 372, -1, 374, 375, 376, -1, -1, -1, -1, - -1, 382, 383, 384, 385, -1, -1, -1, 389, 390, - -1, 256, -1, 394, 395, 396, 397, 398, 399, 400, - 401, -1, -1, -1, -1, -1, 339, -1, -1, -1, - -1, 344, 413, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, -1, -1, -1, -1, 429, -1, - -1, -1, -1, -1, -1, 368, -1, 370, -1, 372, - -1, 374, 375, 376, -1, -1, -1, -1, -1, 382, - 383, 384, 385, -1, -1, -1, 389, 390, -1, 256, - -1, -1, -1, 396, 397, 398, 399, 400, 401, -1, - -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, - 413, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, -1, -1, -1, -1, 429, -1, -1, -1, - -1, -1, -1, 368, -1, 370, -1, 372, -1, 374, - 375, 376, -1, -1, -1, -1, -1, 382, 383, 384, - 385, -1, -1, -1, 389, 390, -1, 256, -1, -1, - -1, 396, 397, 398, 399, 400, 401, -1, -1, -1, - -1, -1, 339, -1, -1, -1, -1, 344, 413, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, - -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, - -1, -1, -1, -1, -1, 382, 383, 384, 385, -1, - -1, -1, 389, 390, -1, 256, -1, -1, -1, 396, - 397, 398, 399, 400, 401, -1, -1, -1, -1, -1, - 339, -1, -1, -1, -1, 344, 413, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, - -1, -1, 429, -1, -1, -1, -1, -1, -1, 368, - -1, 370, -1, 372, -1, 374, 375, 376, -1, -1, - -1, -1, -1, 382, 383, 384, 385, -1, -1, -1, - 389, 390, -1, 256, -1, -1, -1, 396, 397, 398, - 399, 400, 401, -1, -1, -1, -1, -1, 339, -1, - -1, -1, -1, 344, 413, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, - 429, -1, -1, -1, -1, -1, -1, 368, -1, 370, - -1, 372, -1, 374, 375, 376, -1, -1, -1, -1, - -1, 382, 383, 384, 385, -1, -1, -1, 389, 390, - -1, 256, -1, -1, -1, 396, 397, 398, 399, 400, - 401, -1, -1, -1, -1, -1, 339, -1, -1, -1, - -1, 344, 413, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, -1, -1, -1, -1, 429, -1, - -1, -1, -1, -1, -1, 368, -1, 370, -1, 372, - -1, 374, 375, 376, -1, -1, -1, -1, -1, -1, - -1, 384, 385, -1, -1, -1, 389, 390, -1, 256, - -1, -1, -1, -1, -1, 398, 399, 400, 401, -1, - -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, - 413, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, -1, -1, -1, -1, 429, -1, -1, -1, - -1, -1, -1, 368, -1, 370, -1, 372, -1, 374, - 375, 376, -1, -1, -1, -1, -1, -1, -1, 384, - 385, -1, -1, -1, 389, 390, -1, 256, -1, -1, - -1, -1, -1, 398, 399, 400, 401, -1, -1, -1, - -1, -1, 339, -1, -1, -1, -1, 344, 413, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, - -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, - -1, -1, -1, -1, -1, -1, -1, 384, 385, -1, - -1, -1, 389, 390, -1, 256, -1, -1, -1, -1, - -1, 398, 399, 400, 401, -1, -1, -1, -1, -1, - 339, -1, -1, -1, -1, 344, 413, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, - -1, -1, 429, -1, -1, -1, -1, -1, -1, 368, - -1, 370, -1, 372, -1, 374, 375, 376, -1, -1, - -1, -1, -1, -1, -1, 384, 385, -1, -1, -1, - 389, 390, -1, 256, -1, -1, -1, -1, -1, -1, - -1, 400, 401, -1, -1, -1, -1, -1, 339, -1, - -1, -1, -1, 344, 413, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, - 429, -1, -1, -1, -1, -1, -1, 368, -1, 370, - -1, 372, -1, 374, 375, 376, -1, -1, -1, -1, - -1, -1, -1, -1, 385, -1, -1, -1, 389, 390, - -1, 256, -1, -1, -1, -1, -1, -1, -1, 400, - 401, -1, -1, -1, -1, -1, 339, -1, -1, -1, - -1, 344, 413, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, -1, -1, -1, -1, 429, -1, - -1, -1, -1, -1, -1, 368, -1, 370, -1, 372, - -1, 374, 375, 376, -1, -1, -1, -1, -1, -1, - -1, -1, 385, -1, -1, -1, 389, 390, -1, 256, - -1, -1, -1, -1, -1, -1, -1, 400, 401, -1, - -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, - 413, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, -1, -1, -1, -1, 429, -1, -1, -1, - -1, -1, -1, 368, -1, 370, -1, 372, -1, 374, - 375, 376, -1, -1, -1, -1, -1, -1, -1, -1, - 385, -1, -1, -1, -1, 390, -1, 256, -1, -1, - -1, -1, -1, -1, -1, 400, 401, -1, -1, -1, - -1, -1, 339, -1, -1, -1, -1, 344, 413, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, - -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, - -1, -1, -1, -1, -1, -1, -1, -1, 385, -1, - -1, -1, -1, 390, -1, 256, -1, -1, -1, -1, - -1, -1, -1, 400, 401, -1, -1, -1, -1, -1, - 339, -1, -1, -1, -1, 344, 413, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, - -1, -1, 429, -1, -1, -1, -1, -1, -1, 368, - -1, 370, -1, 372, -1, 374, 375, 376, -1, -1, + 385, -1, -1, -1, 389, 390, -1, -1, -1, 394, + 395, 396, 397, 398, 399, 400, 401, -1, 256, -1, + 256, -1, -1, -1, -1, -1, 264, 265, 413, 267, + -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, + -1, 279, -1, -1, 429, -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, 339, 256, -1, -1, -1, 344, -1, + 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 359, 360, 361, 362, 363, -1, -1, -1, -1, + -1, -1, 368, 371, 370, -1, 372, -1, 374, 375, + 376, -1, -1, -1, -1, -1, 382, 383, 384, 385, + -1, -1, -1, 389, 390, -1, -1, -1, 394, 395, + 396, 397, 398, 399, 400, 401, -1, -1, -1, -1, + -1, -1, 256, -1, -1, -1, -1, 413, -1, 417, + 418, -1, -1, -1, -1, -1, -1, 339, -1, -1, + 428, 429, 344, 429, 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, -1, + 372, -1, 374, 375, 376, -1, -1, -1, -1, -1, + 382, 383, 384, 385, -1, -1, -1, 389, 390, -1, + 256, -1, 394, 395, 396, 397, 398, 399, 400, 401, + -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, + 344, 413, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, -1, -1, -1, -1, 429, -1, -1, + -1, -1, -1, -1, 368, -1, 370, -1, 372, -1, + 374, 375, 376, -1, -1, -1, -1, -1, 382, 383, + 384, 385, -1, -1, -1, 389, 390, -1, 256, -1, + -1, -1, 396, 397, 398, 399, 400, 401, -1, -1, + -1, -1, -1, 339, -1, -1, -1, -1, 344, 413, + 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, + 356, -1, -1, -1, -1, 429, -1, -1, -1, -1, + -1, -1, 368, -1, 370, -1, 372, -1, 374, 375, + 376, -1, -1, -1, -1, -1, 382, 383, 384, 385, + -1, -1, -1, 389, 390, -1, 256, -1, -1, -1, + 396, 397, 398, 399, 400, 401, -1, -1, -1, -1, + -1, 339, -1, -1, -1, -1, 344, 413, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, + -1, -1, -1, 429, -1, -1, -1, -1, -1, -1, + 368, -1, 370, -1, 372, -1, 374, 375, 376, -1, + -1, -1, -1, -1, 382, 383, 384, 385, -1, -1, + -1, 389, 390, -1, 256, -1, -1, -1, 396, 397, + 398, 399, 400, 401, -1, -1, -1, -1, -1, 339, + -1, -1, -1, -1, 344, 413, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, + -1, 429, -1, -1, -1, -1, -1, -1, 368, -1, + 370, -1, 372, -1, 374, 375, 376, -1, -1, -1, + -1, -1, 382, 383, 384, 385, -1, -1, -1, 389, + 390, -1, 256, -1, -1, -1, 396, 397, 398, 399, + 400, 401, -1, -1, -1, -1, -1, 339, -1, -1, + -1, -1, 344, 413, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, -1, -1, -1, -1, 429, + -1, -1, -1, -1, -1, -1, 368, -1, 370, -1, + 372, -1, 374, 375, 376, -1, -1, -1, -1, -1, + 382, 383, 384, 385, -1, -1, -1, 389, 390, -1, + 256, -1, -1, -1, 396, 397, 398, 399, 400, 401, + -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, + 344, 413, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, -1, -1, -1, -1, 429, -1, -1, + -1, -1, -1, -1, 368, -1, 370, -1, 372, -1, + 374, 375, 376, -1, -1, -1, -1, -1, -1, -1, + 384, 385, -1, -1, -1, 389, 390, -1, 256, -1, + -1, -1, -1, -1, 398, 399, 400, 401, -1, -1, + -1, -1, -1, 339, -1, -1, -1, -1, 344, 413, + 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, + 356, -1, -1, -1, -1, 429, -1, -1, -1, -1, + -1, -1, 368, -1, 370, -1, 372, -1, 374, 375, + 376, -1, -1, -1, -1, -1, -1, -1, 384, 385, + -1, -1, -1, 389, 390, -1, 256, -1, -1, -1, + -1, -1, 398, 399, 400, 401, -1, -1, -1, -1, + -1, 339, -1, -1, -1, -1, 344, 413, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, + -1, -1, -1, 429, -1, -1, -1, -1, -1, -1, + 368, -1, 370, -1, 372, -1, 374, 375, 376, -1, + -1, -1, -1, -1, -1, -1, 384, 385, -1, -1, + -1, 389, 390, -1, 256, -1, -1, -1, -1, -1, + 398, 399, 400, 401, -1, -1, -1, -1, -1, 339, + -1, -1, -1, -1, 344, 413, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, + -1, 429, -1, -1, -1, -1, -1, -1, 368, -1, + 370, -1, 372, -1, 374, 375, 376, -1, -1, -1, + -1, -1, -1, -1, 384, 385, -1, -1, -1, 389, + 390, -1, 256, -1, -1, -1, -1, -1, -1, -1, + 400, 401, -1, -1, -1, -1, -1, 339, -1, -1, + -1, -1, 344, 413, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, -1, -1, -1, -1, 429, + -1, -1, -1, -1, -1, -1, 368, -1, 370, -1, + 372, -1, 374, 375, 376, -1, -1, -1, -1, -1, + -1, -1, 384, 385, -1, -1, -1, 389, 390, -1, + 256, -1, -1, -1, -1, -1, -1, -1, 400, 401, + -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, + 344, 413, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, -1, -1, -1, -1, 429, -1, -1, + -1, -1, -1, -1, 368, -1, 370, -1, 372, -1, + 374, 375, 376, -1, -1, -1, -1, -1, -1, -1, + -1, 385, -1, -1, -1, 389, 390, -1, 256, -1, + -1, -1, -1, -1, -1, -1, 400, 401, -1, -1, + -1, -1, -1, 339, -1, -1, -1, -1, 344, 413, + 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, + 356, -1, -1, -1, -1, 429, -1, -1, -1, -1, + -1, -1, 368, -1, 370, -1, 372, -1, 374, 375, + 376, -1, -1, -1, -1, -1, -1, -1, -1, 385, + -1, -1, -1, 389, 390, -1, 256, -1, -1, -1, + -1, -1, -1, -1, 400, 401, -1, -1, -1, -1, + -1, 339, -1, -1, -1, -1, 344, 413, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, + -1, -1, -1, 429, -1, -1, -1, -1, -1, -1, + 368, -1, 370, -1, 372, -1, 374, 375, 376, -1, + -1, -1, -1, -1, -1, -1, -1, 385, -1, -1, + -1, -1, 390, -1, 256, -1, -1, -1, -1, -1, + -1, -1, 400, 401, -1, -1, -1, -1, -1, 339, + -1, -1, -1, -1, 344, 413, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, + -1, 429, -1, -1, -1, -1, -1, -1, 368, -1, + 370, -1, 372, -1, 374, 375, 376, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 390, -1, 256, -1, -1, -1, -1, -1, -1, - -1, 400, 401, -1, -1, -1, -1, -1, 339, -1, - -1, -1, -1, 344, 413, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, - 429, -1, -1, -1, -1, -1, -1, 368, -1, 370, - -1, 372, -1, 374, 375, 376, -1, -1, -1, 256, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 390, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 400, - 401, -1, -1, -1, -1, -1, 339, -1, -1, -1, - -1, 344, 413, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, -1, -1, -1, -1, 429, -1, - -1, -1, -1, -1, -1, 368, -1, 370, -1, 372, - -1, 374, 375, 376, -1, -1, -1, -1, 262, -1, - -1, -1, 266, -1, -1, -1, -1, 390, -1, -1, - -1, -1, 339, -1, -1, -1, -1, 344, 401, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 413, -1, -1, -1, 298, -1, -1, -1, -1, -1, - -1, 368, -1, 370, -1, 372, 429, 374, 375, 376, - 314, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 390, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 401, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 413, -1, -1, -1, - -1, -1, -1, 357, -1, -1, -1, -1, -1, 363, - -1, -1, 429, -1, 368, 369, -1, 371, -1, 373, - -1, 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, -1, 256, -1, 418, -1, 420, -1, -1, 423, - 264, 265, 266, 267, 268, 429, 270, 271, -1, 273, - 274, 275, 276, 277, 278, 279, -1, -1, -1, -1, - -1, 285, -1, 287, 288, 289, 290, 291, 292, -1, - -1, 295, -1, -1, -1, 299, 300, -1, 302, 303, - 304, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 314, -1, 316, -1, 318, 319, -1, -1, 322, -1, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, -1, 337, -1, -1, 340, 341, -1, -1, - 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, - -1, -1, -1, 367, -1, -1, -1, 371, -1, -1, - -1, -1, 376, 377, 378, 379, 380, -1, -1, -1, - 384, -1, 386, -1, -1, -1, -1, -1, 392, 393, + 390, -1, 256, -1, -1, -1, -1, -1, -1, -1, + 400, 401, -1, -1, -1, -1, -1, 339, -1, -1, + -1, -1, 344, 413, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, -1, -1, -1, -1, 429, + -1, -1, -1, -1, -1, -1, 368, -1, 370, -1, + 372, -1, 374, 375, 376, -1, -1, -1, 256, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 390, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 400, 401, + -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, + 344, 413, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, -1, -1, -1, -1, 429, -1, -1, + -1, -1, -1, -1, 368, -1, 370, -1, 372, -1, + 374, 375, 376, -1, -1, -1, -1, 262, -1, -1, + -1, 266, -1, -1, -1, -1, 390, -1, -1, -1, + -1, 339, -1, -1, -1, -1, 344, 401, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 413, + -1, -1, -1, 298, -1, -1, -1, -1, -1, -1, + 368, -1, 370, -1, 372, 429, 374, 375, 376, 314, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 390, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 401, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 413, -1, -1, -1, -1, + -1, -1, 357, -1, -1, -1, -1, -1, 363, -1, + -1, 429, -1, 368, 369, -1, 371, -1, 373, -1, + 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, + -1, 256, -1, 418, -1, 420, -1, -1, 423, 264, + 265, 266, 267, 268, 429, 270, 271, -1, 273, 274, + 275, 276, 277, 278, 279, -1, -1, -1, -1, -1, + 285, -1, 287, 288, 289, 290, 291, 292, -1, -1, + 295, -1, -1, -1, 299, 300, -1, 302, 303, 304, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 314, + -1, 316, -1, 318, 319, -1, -1, 322, -1, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, -1, 337, -1, -1, 340, 341, -1, -1, 344, + 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, + -1, -1, 367, -1, -1, -1, 371, -1, -1, -1, + -1, 376, 377, 378, 379, 380, -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, -1, -1, + 256, -1, 417, 418, 419, 420, -1, 422, 264, 265, + 266, 267, -1, -1, 270, 271, -1, 273, 274, 275, + 276, 277, 278, 279, -1, -1, -1, -1, -1, 285, + -1, 287, 288, 289, 290, 291, 292, -1, -1, 295, + -1, -1, -1, 299, 300, -1, 302, 303, 304, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 314, -1, + 316, -1, 318, 319, -1, -1, 322, -1, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + -1, 337, -1, -1, 340, 341, -1, -1, 344, 345, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, + -1, 367, -1, -1, -1, 371, -1, -1, -1, -1, + 376, 377, 378, 379, 380, -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, 264, 265, 266, 267, -1, + -1, 270, 271, -1, 273, 274, 275, 276, 277, 278, + 279, -1, -1, -1, -1, -1, 285, -1, 287, 288, + 289, 290, 291, 292, -1, -1, 295, -1, -1, -1, + 299, 300, -1, 302, 303, 304, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 314, -1, 316, -1, 318, + 319, -1, -1, 322, -1, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, -1, 337, -1, + -1, 340, 341, -1, -1, 344, 345, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 359, 360, 361, 362, 363, -1, -1, -1, 367, -1, + -1, -1, 371, -1, -1, -1, -1, 376, 377, 378, + 379, 380, -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, 264, 265, 266, 267, -1, -1, 270, 271, + -1, 273, 274, 275, 276, 277, 278, 279, -1, -1, + -1, -1, -1, 285, -1, 287, 288, 289, 290, 291, + 292, -1, -1, 295, -1, -1, -1, 299, 300, -1, + 302, 303, 304, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 314, -1, 316, -1, 318, 319, -1, -1, + 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 334, 335, -1, 337, -1, -1, 340, 341, + -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, + 362, 363, -1, -1, -1, 367, -1, -1, -1, 371, + -1, -1, -1, -1, 376, 377, 378, 379, 380, -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, 417, 418, 419, 420, -1, 422, 264, + -1, 256, -1, -1, -1, 417, 418, 419, 420, 264, 265, 266, 267, -1, -1, 270, 271, -1, 273, 274, 275, 276, 277, 278, 279, -1, -1, -1, -1, -1, 285, -1, 287, 288, 289, 290, 291, 292, -1, -1, @@ -13307,162 +13563,220 @@ void case_1035() -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, 264, 265, 266, 267, - -1, -1, 270, 271, -1, 273, 274, 275, 276, 277, - 278, 279, -1, -1, -1, -1, -1, 285, -1, 287, - 288, 289, 290, 291, 292, -1, -1, 295, -1, -1, - -1, 299, 300, -1, 302, 303, 304, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 314, -1, 316, -1, - 318, 319, -1, -1, 322, -1, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, -1, 337, - -1, -1, 340, 341, -1, -1, 344, 345, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 359, 360, 361, 362, 363, -1, -1, -1, 367, - -1, -1, -1, 371, -1, -1, -1, -1, 376, 377, + -1, -1, 417, 418, 419, 420, 264, 265, -1, 267, + -1, -1, 270, 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, 306, -1, + -1, -1, -1, -1, 295, 313, -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, 374, -1, -1, 377, 378, 379, 380, -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, 264, 265, 266, 267, -1, -1, 270, - 271, -1, 273, 274, 275, 276, 277, 278, 279, -1, - -1, -1, -1, -1, 285, -1, 287, 288, 289, 290, - 291, 292, -1, -1, 295, -1, -1, -1, 299, 300, - -1, 302, 303, 304, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 314, -1, 316, -1, 318, 319, -1, - -1, 322, -1, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, -1, 337, -1, -1, 340, - 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, - 361, 362, 363, -1, -1, -1, 367, -1, -1, -1, - 371, -1, -1, -1, -1, 376, 377, 378, 379, 380, + 418, 419, 420, 264, 265, -1, 267, -1, -1, 270, + 271, -1, 256, -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, 367, 368, -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, -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, 266, 267, -1, -1, 270, 271, -1, 273, - 274, 275, 276, 277, 278, 279, -1, -1, -1, -1, - -1, 285, -1, 287, 288, 289, 290, 291, 292, -1, - -1, 295, -1, -1, -1, 299, 300, -1, 302, 303, - 304, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 314, -1, 316, -1, 318, 319, -1, -1, 322, -1, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, -1, 337, -1, -1, 340, 341, -1, -1, - 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, - -1, -1, -1, 367, -1, -1, -1, 371, -1, -1, - -1, -1, 376, 377, 378, 379, 380, -1, -1, -1, - 384, -1, 386, -1, -1, -1, -1, -1, 392, 393, + 264, 265, -1, 267, -1, -1, 270, 271, -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, 306, -1, -1, -1, -1, -1, 295, 313, + -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, -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, 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, - 277, -1, 279, -1, -1, 265, -1, 267, 285, -1, + 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, 306, - -1, -1, -1, -1, -1, 295, 313, -1, -1, 316, - 300, 318, 319, -1, 304, 322, -1, -1, 325, -1, + -1, -1, -1, 300, -1, 302, 303, 304, 288, -1, + -1, -1, -1, -1, -1, 295, -1, -1, -1, 316, + 300, 318, 319, 320, 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, 374, -1, -1, + 367, -1, -1, -1, 371, -1, -1, -1, -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, - -1, -1, 372, -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, + -1, -1, -1, -1, 295, -1, -1, -1, 418, 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, -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, -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, -1, 428, -1, -1, + 295, -1, -1, -1, -1, 300, -1, 302, 303, 304, -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, 267, -1, -1, - 270, 271, -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, 367, 368, -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, -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, + -1, -1, -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, -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, 265, - -1, 267, 285, -1, 270, 288, -1, -1, -1, 275, - -1, -1, 295, 279, -1, -1, -1, 300, -1, 302, - 303, 304, 288, 306, -1, -1, -1, -1, -1, 295, - 313, -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, -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, 264, 265, - -1, 267, -1, -1, 270, 271, -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, 320, 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, + 256, -1, 417, 418, 419, 420, -1, -1, 264, 265, + -1, 267, -1, 428, 270, 271, -1, -1, -1, 275, + 276, 277, -1, 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, -1, -1, -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, -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, -1, -1, -1, -1, 295, -1, -1, -1, 418, - 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, -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, -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, -1, 428, -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, -1, -1, -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, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, + -1, 417, 418, 419, 420, 262, -1, 264, 265, -1, + 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, + 277, -1, 279, -1, -1, -1, -1, -1, 285, -1, + -1, 288, -1, -1, -1, -1, -1, -1, 295, -1, + -1, 298, -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, -1, -1, 343, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, + -1, -1, -1, -1, 371, -1, 373, -1, -1, -1, + 377, 378, 379, 380, 381, -1, -1, 384, -1, 386, + 256, -1, -1, -1, -1, 392, 393, -1, 264, 265, + -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, + 276, 277, -1, 279, -1, -1, -1, -1, -1, 285, + 417, 418, 288, 420, -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, -1, + -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, + -1, -1, 368, -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, -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, 267, -1, + -1, 270, 271, -1, -1, -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, -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, 368, + -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, -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, 267, -1, -1, 270, 271, + -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, -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, 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, + -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, -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, -1, -1, + 256, -1, 417, 418, 419, 420, 262, -1, 264, 265, + -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, + 276, 277, -1, 279, -1, -1, -1, -1, -1, 285, + -1, -1, 288, -1, -1, -1, -1, -1, -1, 295, + -1, -1, 298, -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, -1, -1, 343, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, + -1, -1, -1, -1, -1, 371, -1, 373, -1, -1, + -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, + 386, 256, -1, -1, -1, -1, 392, 393, -1, 264, + 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, + 275, 276, 277, -1, 279, -1, -1, -1, -1, -1, + 285, 417, 418, 288, 420, -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, 256, -1, 417, 418, 419, 420, -1, -1, 264, - 265, -1, 267, -1, 428, 270, 271, -1, -1, -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, -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, 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, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, - -1, -1, 367, -1, -1, -1, 371, -1, -1, -1, + -1, -1, -1, -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, -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, 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, - 418, 279, -1, -1, 265, -1, 267, 285, -1, 270, + -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, -1, 295, -1, -1, -1, 316, 300, @@ -13471,7 +13785,7 @@ void case_1035() -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, - 368, -1, -1, 371, -1, -1, -1, -1, -1, 377, + -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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -13486,7 +13800,7 @@ void case_1035() 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, 368, -1, -1, + 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, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, @@ -13509,111 +13823,72 @@ void case_1035() -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, 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, + 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, -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, -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, 264, 265, -1, 267, -1, -1, - 270, 271, -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, -1, 386, -1, -1, -1, - -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, + 417, 418, 419, 420, 262, -1, 264, 265, -1, 267, + -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, + -1, 279, -1, -1, -1, -1, -1, 285, -1, -1, + 288, -1, -1, -1, -1, -1, -1, 295, -1, -1, + 298, -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, -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, -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, -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, 264, 265, + -1, 359, 360, 361, 362, 363, -1, -1, -1, -1, + -1, -1, -1, 371, -1, 373, -1, -1, -1, 377, + 378, 379, 380, -1, -1, -1, 384, -1, 386, 256, + -1, -1, -1, -1, 392, 393, -1, 264, 265, -1, + 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, + 277, -1, 279, -1, -1, -1, -1, -1, 285, 417, + 418, 288, 420, -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, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, + -1, -1, -1, -1, 371, -1, 373, -1, -1, -1, + 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, + 256, -1, -1, -1, -1, 392, 393, -1, 264, 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, -1, 279, -1, -1, -1, -1, -1, 285, - -1, -1, 288, -1, -1, -1, -1, -1, -1, 295, + 417, 418, 288, 420, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -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, -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, 264, 265, -1, 267, -1, - -1, 270, 271, -1, -1, -1, 275, 276, 277, -1, - 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, -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, -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, 264, 265, -1, 267, -1, -1, 270, 271, - -1, -1, -1, 275, 276, 277, -1, 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, -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, -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, 264, + 386, 256, -1, -1, -1, -1, 392, 393, -1, 264, 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, -1, 279, -1, -1, -1, -1, -1, - 285, -1, -1, 288, -1, -1, -1, -1, -1, -1, + 285, 417, 418, 288, 420, -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, -1, -1, 343, -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, 359, 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, 371, -1, -1, -1, - -1, -1, 377, 378, 379, 380, 381, -1, -1, 384, + -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, 256, -1, -1, -1, -1, 392, 393, -1, 264, 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, -1, 279, -1, -1, -1, -1, @@ -13622,7 +13897,7 @@ void case_1035() 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, -1, -1, 343, + 334, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, 371, -1, -1, @@ -13942,179 +14217,159 @@ void case_1035() 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, 256, -1, -1, - -1, -1, 392, 393, -1, 264, 265, -1, 267, -1, + -1, -1, 392, 393, 262, 264, 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, -1, 279, -1, -1, -1, -1, -1, 285, 417, 418, 288, 420, -1, -1, -1, -1, -1, 295, -1, -1, -1, - -1, 300, -1, 302, 303, 304, -1, -1, -1, -1, + 298, 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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -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, 256, -1, - -1, -1, -1, 392, 393, -1, 264, 265, -1, 267, - -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, - -1, 279, -1, -1, -1, -1, -1, 285, 417, 418, - 288, 420, -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, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -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, 256, - -1, -1, -1, -1, 392, 393, -1, 264, 265, -1, - 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, - 277, -1, 279, -1, -1, -1, -1, -1, 285, 417, - 418, 288, 420, -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, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -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, - 256, -1, -1, -1, -1, 392, 393, -1, 264, 265, - -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, - 276, 277, -1, 279, -1, -1, -1, -1, -1, 285, - 417, 418, 288, 420, -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, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -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, 256, -1, -1, -1, -1, 392, 393, 262, 264, - 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, - 275, 276, 277, -1, 279, -1, -1, -1, -1, -1, - 285, 417, 418, 288, 420, -1, -1, -1, -1, -1, - 295, -1, -1, -1, 298, 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, -1, -1, -1, -1, + -1, -1, 371, 371, 372, 373, 374, 375, -1, -1, + 378, 379, -1, -1, 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, -1, 417, 418, + -1, -1, 420, -1, 261, 423, 263, -1, 265, -1, + 267, -1, -1, 270, -1, 272, 273, -1, 275, -1, + 277, -1, 279, -1, 281, 282, 283, 284, -1, -1, + 287, 288, -1, -1, -1, -1, 293, 294, 295, 296, + 297, -1, -1, 300, -1, 302, -1, 304, -1, 306, + 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, + 317, 318, -1, -1, 321, 322, 323, -1, -1, -1, + -1, -1, -1, 330, 331, -1, 333, 334, -1, 336, + 337, 338, -1, -1, -1, 342, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, - -1, -1, -1, -1, -1, -1, 371, 371, 372, 373, - 374, 375, -1, -1, 378, 379, -1, -1, 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, -1, 417, 418, -1, -1, 420, -1, 261, 423, - 263, -1, 265, -1, 267, -1, -1, 270, -1, 272, - 273, -1, 275, -1, 277, -1, 279, -1, 281, 282, + -1, -1, -1, -1, -1, 362, -1, 364, 365, 261, + -1, -1, -1, 265, -1, 267, -1, -1, 270, -1, + 272, 273, -1, 275, -1, 277, -1, 279, -1, 281, + 282, 283, 284, -1, -1, 287, 288, -1, -1, -1, + -1, 293, -1, 295, 296, 297, -1, -1, 300, -1, + 302, -1, 304, -1, -1, 307, -1, 309, 310, 311, + 312, 418, -1, -1, 316, 317, 318, -1, -1, 321, + 322, 323, -1, -1, -1, -1, -1, -1, 330, 331, + -1, 333, 334, -1, 336, 337, 338, -1, -1, -1, + 342, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 261, -1, + 362, -1, 265, -1, 267, -1, 368, 270, -1, 272, + 273, -1, 275, -1, 277, 377, 279, -1, 281, 282, 283, 284, -1, -1, 287, 288, -1, -1, -1, -1, - 293, 294, 295, 296, 297, -1, -1, 300, -1, 302, - -1, 304, -1, 306, 307, -1, 309, 310, 311, 312, - -1, -1, 315, 316, 317, 318, -1, -1, 321, 322, + 293, -1, 295, 296, 297, -1, -1, 300, -1, 302, + -1, 304, -1, -1, 307, -1, 309, 310, 311, 312, + -1, -1, -1, 316, 317, 318, 418, -1, 321, 322, 323, -1, -1, -1, -1, -1, -1, 330, 331, -1, 333, 334, -1, 336, 337, 338, -1, -1, -1, 342, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, - -1, 364, 365, 261, -1, -1, -1, 265, -1, 267, - -1, -1, 270, -1, 272, 273, -1, 275, -1, 277, + -1, -1, -1, -1, -1, -1, -1, 261, -1, 362, + -1, 265, -1, 267, -1, 368, 270, -1, 272, 273, + -1, 275, -1, 277, 377, 279, -1, 281, 282, 283, + 284, -1, -1, 287, 288, -1, -1, -1, -1, 293, + -1, 295, 296, 297, -1, -1, 300, -1, 302, -1, + 304, -1, -1, 307, -1, 309, 310, 311, 312, -1, + -1, -1, 316, 317, 318, 418, -1, 321, 322, 323, + -1, -1, -1, -1, -1, -1, 330, 331, -1, 333, + 334, -1, 336, 337, 338, -1, -1, -1, 342, -1, + -1, -1, -1, 261, -1, -1, -1, 265, -1, 267, + -1, -1, 270, -1, 272, 273, -1, 275, 362, 277, -1, 279, -1, 281, 282, 283, 284, -1, -1, 287, - 288, -1, -1, -1, -1, 293, -1, 295, 296, 297, + 288, -1, -1, 377, -1, 293, -1, 295, 296, 297, -1, -1, 300, -1, 302, -1, 304, -1, -1, 307, - -1, 309, 310, 311, 312, 418, -1, -1, 316, 317, + -1, 309, 310, 311, 312, -1, -1, -1, 316, 317, 318, -1, -1, 321, 322, 323, -1, -1, -1, -1, - -1, -1, 330, 331, -1, 333, 334, -1, 336, 337, + -1, -1, 330, 331, 418, 333, 334, -1, 336, 337, 338, -1, -1, -1, 342, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 261, -1, 362, -1, 265, -1, 267, -1, - 368, 270, -1, 272, 273, -1, 275, -1, 277, 377, - 279, -1, 281, 282, 283, 284, -1, -1, 287, 288, - -1, -1, -1, -1, 293, -1, 295, 296, 297, -1, - -1, 300, -1, 302, -1, 304, -1, -1, 307, -1, - 309, 310, 311, 312, -1, -1, -1, 316, 317, 318, - 418, -1, 321, 322, 323, -1, -1, -1, -1, -1, - -1, 330, 331, -1, 333, 334, -1, 336, 337, 338, - -1, -1, -1, 342, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 261, -1, 362, -1, 265, -1, 267, -1, 368, - 270, -1, 272, 273, -1, 275, -1, 277, 377, 279, - -1, 281, 282, 283, 284, -1, -1, 287, 288, -1, - -1, -1, -1, 293, -1, 295, 296, 297, -1, -1, - 300, -1, 302, -1, 304, -1, -1, 307, -1, 309, - 310, 311, 312, -1, -1, -1, 316, 317, 318, 418, - -1, 321, 322, 323, -1, -1, -1, -1, -1, -1, - 330, 331, -1, 333, 334, -1, 336, 337, 338, -1, - -1, -1, 342, -1, -1, -1, -1, 261, -1, -1, - -1, 265, -1, 267, -1, -1, 270, -1, 272, 273, - -1, 275, 362, 277, -1, 279, -1, 281, 282, 283, - 284, -1, -1, 287, 288, -1, -1, 377, -1, 293, - -1, 295, 296, 297, -1, -1, 300, -1, 302, -1, + -1, -1, -1, -1, -1, -1, -1, 261, -1, -1, + -1, 265, -1, 267, 362, -1, 270, -1, 272, 273, + 368, 275, -1, 277, -1, 279, -1, 281, 282, 283, + 284, -1, -1, 287, 288, -1, -1, -1, -1, 293, + -1, 295, 296, 297, -1, -1, 300, -1, 302, 261, 304, -1, -1, 307, -1, 309, 310, 311, 312, -1, -1, -1, 316, 317, 318, -1, -1, 321, 322, 323, - -1, -1, -1, -1, -1, -1, 330, 331, 418, 333, - 334, -1, 336, 337, 338, -1, -1, -1, 342, -1, + 418, -1, 284, -1, -1, -1, 330, 331, -1, 333, + 334, -1, 336, 337, 338, 297, -1, -1, 342, -1, + 302, -1, -1, 305, -1, 307, -1, 309, 310, 311, + 312, -1, -1, -1, -1, 317, -1, -1, 362, 321, + -1, -1, -1, 325, 368, -1, -1, -1, -1, 261, + -1, 333, -1, -1, 336, -1, 338, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 261, -1, -1, -1, 265, -1, 267, 362, -1, - 270, -1, 272, 273, 368, 275, -1, 277, -1, 279, - -1, 281, 282, 283, 284, -1, -1, 287, 288, -1, - -1, -1, -1, 293, -1, 295, 296, 297, -1, -1, - 300, -1, 302, 261, 304, -1, -1, 307, -1, 309, - 310, 311, 312, -1, -1, -1, 316, 317, 318, -1, - -1, 321, 322, 323, 418, -1, 284, -1, -1, -1, - 330, 331, -1, 333, 334, -1, 336, 337, 338, 297, - -1, -1, 342, -1, 302, -1, -1, 305, -1, 307, - -1, 309, 310, 311, 312, -1, -1, -1, -1, 317, - -1, -1, 362, 321, -1, -1, -1, 325, 368, -1, - -1, -1, -1, 261, -1, 333, -1, -1, 336, -1, - 338, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 284, -1, -1, 357, - -1, -1, -1, -1, 362, -1, -1, -1, -1, 297, - 368, 369, -1, 371, 302, 373, -1, 305, 418, 307, - -1, 309, 310, 311, 312, -1, -1, -1, 386, 317, - -1, -1, -1, 321, -1, 261, -1, 325, -1, -1, - -1, -1, -1, -1, -1, 333, -1, -1, 336, -1, - 338, -1, -1, -1, -1, -1, -1, -1, 284, -1, - 418, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 297, -1, 261, 362, -1, 302, -1, -1, -1, - 368, 307, -1, 309, 310, 311, 312, -1, -1, -1, - -1, 317, -1, -1, -1, 321, 284, -1, -1, 325, - -1, -1, -1, 261, -1, -1, -1, 333, -1, 297, - 336, -1, 338, -1, 302, -1, -1, -1, -1, 307, - -1, 309, 310, 311, 312, -1, 284, -1, -1, 317, - 418, -1, -1, 321, -1, -1, 362, 325, -1, 297, - -1, -1, 368, -1, 302, 333, -1, -1, 336, 307, - 338, 309, 310, 311, 312, -1, -1, -1, -1, 317, - -1, -1, -1, 321, -1, -1, -1, -1, -1, -1, - 264, 265, -1, 267, 362, 333, 270, 271, 336, -1, - 338, 275, 276, 277, -1, 279, -1, -1, -1, -1, - -1, 285, 418, -1, 288, -1, -1, -1, -1, -1, - -1, 295, -1, -1, 362, -1, 300, -1, 302, 303, - 304, -1, 306, -1, -1, -1, -1, -1, -1, 313, + -1, -1, 284, -1, -1, 357, -1, -1, -1, -1, + 362, -1, -1, -1, -1, 297, 368, 369, -1, 371, + 302, 373, -1, 305, 418, 307, -1, 309, 310, 311, + 312, -1, -1, -1, 386, 317, -1, -1, -1, 321, + -1, 261, -1, 325, -1, -1, -1, -1, -1, -1, + -1, 333, -1, -1, 336, -1, 338, -1, -1, -1, + -1, -1, -1, -1, 284, -1, 418, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 297, -1, 261, + 362, -1, 302, -1, -1, 305, 368, 307, -1, 309, + 310, 311, 312, -1, -1, -1, -1, 317, -1, -1, + -1, 321, 284, -1, -1, 325, -1, -1, -1, -1, + -1, -1, -1, 333, -1, 297, 336, 261, 338, -1, + 302, -1, -1, -1, -1, 307, -1, 309, 310, 311, + 312, -1, -1, -1, -1, 317, 418, -1, -1, 321, + 284, -1, 362, 325, -1, -1, -1, -1, 368, -1, + -1, 333, -1, 297, 336, 261, 338, -1, 302, -1, + -1, -1, -1, 307, -1, 309, 310, 311, 312, -1, + -1, -1, -1, 317, -1, -1, -1, 321, 284, -1, + 362, 325, -1, -1, -1, -1, 368, -1, -1, 333, + -1, 297, 336, -1, 338, -1, 302, -1, 418, -1, + -1, 307, -1, 309, 310, 311, 312, -1, -1, -1, + -1, 317, -1, -1, -1, 321, -1, -1, 362, -1, + -1, -1, -1, -1, -1, -1, -1, 333, 264, 265, + 336, 267, 338, -1, 270, 271, 418, -1, -1, 275, + 276, 277, -1, 279, -1, -1, -1, -1, -1, 285, + -1, -1, 288, -1, -1, -1, 362, -1, -1, 295, + -1, -1, -1, -1, 300, -1, 302, 303, 304, -1, + 306, -1, -1, -1, 418, -1, -1, 313, -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, 418, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, + -1, -1, -1, -1, -1, 371, 372, -1, 374, -1, + -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, + 386, -1, -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, -1, -1, -1, -1, 295, -1, -1, -1, -1, + 300, -1, 302, 303, 304, -1, 306, -1, -1, -1, + -1, -1, -1, 313, -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, -1, -1, -1, -1, 359, + 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, + -1, 371, -1, -1, 374, -1, -1, 377, 378, 379, + 380, -1, -1, -1, 384, -1, 386, -1, -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, -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, - 418, 325, -1, 327, -1, 329, 330, 331, 332, -1, - 334, -1, -1, -1, -1, -1, -1, 341, -1, -1, + -1, 325, -1, 327, -1, 329, 330, 331, 332, -1, + 334, -1, -1, 337, -1, -1, -1, 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, - 418, -1, -1, -1, -1, 359, 360, 361, 362, 363, - -1, -1, -1, -1, -1, -1, -1, 371, 372, -1, - 374, -1, -1, 377, 378, 379, 380, -1, -1, -1, + -1, -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, -1, -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, -1, -1, -1, -1, 295, -1, -1, - -1, -1, 300, -1, 302, 303, 304, -1, 306, -1, - -1, -1, -1, -1, -1, 313, -1, -1, 316, -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, -1, -1, -1, - -1, 359, 360, 361, 362, 363, -1, -1, -1, -1, - -1, -1, -1, 371, -1, -1, 374, -1, -1, 377, + -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, -1, -1, -1, 264, 265, -1, 267, -1, -1, 270, 271, @@ -14124,10 +14379,10 @@ void case_1035() 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, 337, -1, -1, -1, 341, + 332, -1, 334, -1, -1, -1, -1, -1, -1, 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, - 362, 363, -1, -1, -1, -1, -1, -1, -1, 371, + 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, -1, -1, -1, 264, 265, @@ -14141,7 +14396,7 @@ void case_1035() -1, -1, -1, -1, -1, 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, - -1, 367, -1, -1, -1, 371, -1, -1, -1, -1, + -1, -1, -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, -1, -1, -1, 264, 265, -1, 267, -1, -1, @@ -14154,7 +14409,7 @@ void case_1035() 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, -1, -1, -1, -1, 359, - 360, 361, 362, 363, -1, -1, -1, 367, -1, -1, + 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, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, @@ -14188,178 +14443,153 @@ void case_1035() -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, -1, - -1, -1, -1, 295, -1, -1, -1, -1, 300, -1, + -1, -1, -1, 295, -1, 261, -1, -1, 300, -1, 302, 303, 304, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 316, -1, 318, 319, -1, -1, + -1, -1, -1, -1, 316, -1, 318, 319, 284, -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, -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, + 332, 297, 334, -1, -1, -1, 302, -1, -1, -1, + -1, 307, -1, 309, 310, 311, 312, -1, -1, 315, + -1, 317, -1, -1, -1, 321, -1, 359, 360, 361, + 362, 363, -1, -1, -1, -1, -1, 333, -1, 371, + 336, -1, 338, -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, -1, -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, -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, -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, -1, -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, -1, -1, -1, -1, 295, -1, 261, -1, -1, - 300, -1, 302, 303, 304, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 316, -1, 318, 319, - 284, -1, 322, -1, -1, 325, -1, 327, -1, 329, - 330, 331, 332, 297, 334, -1, -1, -1, 302, -1, - -1, -1, -1, 307, -1, 309, 310, 311, 312, -1, - -1, 315, -1, 317, -1, -1, -1, 321, -1, 359, - 360, 361, 362, 363, -1, -1, -1, -1, -1, 333, - -1, 371, 336, -1, 338, -1, -1, 377, 378, 379, - 380, -1, -1, -1, 384, -1, 386, -1, -1, -1, - -1, -1, 392, 393, -1, -1, -1, -1, 362, -1, - -1, -1, -1, -1, 368, 369, -1, -1, -1, -1, - -1, -1, 263, -1, 265, -1, 267, 417, 418, 270, - 420, 272, 273, -1, 275, -1, 277, -1, 279, -1, - 281, 282, 283, -1, -1, -1, 287, 288, -1, -1, - -1, -1, 293, -1, 295, 296, -1, -1, -1, 300, - -1, -1, -1, 304, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 315, 316, -1, 318, -1, -1, - -1, 322, 323, -1, -1, -1, -1, -1, -1, 330, - 331, 264, 265, 334, 267, -1, 337, 270, 271, -1, - -1, 342, 275, 276, 277, -1, 279, -1, -1, -1, - -1, -1, 285, -1, -1, 288, -1, -1, -1, -1, - -1, -1, 295, 364, 365, -1, -1, 300, -1, 302, - 303, 304, -1, -1, -1, -1, 377, -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, 337, -1, -1, -1, -1, -1, - -1, 265, -1, 267, -1, -1, 270, 418, 272, -1, - -1, 275, -1, -1, -1, 279, 359, 360, 361, 362, - -1, -1, -1, -1, 288, 265, -1, 267, 371, -1, - 270, 295, 272, 273, -1, 275, 300, 277, 302, 279, - 304, 281, 282, 283, -1, -1, -1, 287, 288, -1, - -1, -1, 316, 293, 318, 295, 296, -1, 322, 323, - 300, -1, -1, -1, 304, -1, 330, 331, -1, -1, - 334, -1, -1, 337, 417, 418, 316, -1, 318, -1, - -1, -1, 322, 323, -1, -1, -1, -1, -1, -1, - 330, 331, -1, 265, 334, 267, -1, 337, 270, -1, - 272, 273, 342, 275, -1, 277, -1, 279, -1, 281, + 392, 393, -1, -1, -1, -1, 362, -1, -1, -1, + -1, -1, 368, 369, -1, -1, -1, -1, -1, -1, + 263, -1, 265, -1, 267, 417, 418, 270, 420, 272, + 273, -1, 275, -1, 277, -1, 279, -1, 281, 282, + 283, -1, -1, -1, 287, 288, -1, -1, -1, -1, + 293, -1, 295, 296, -1, -1, -1, 300, -1, -1, + -1, 304, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 315, 316, -1, 318, -1, -1, -1, 322, + 323, -1, -1, -1, -1, -1, -1, 330, 331, 264, + 265, 334, 267, -1, 337, 270, 271, -1, -1, 342, + 275, 276, 277, -1, 279, -1, -1, -1, -1, -1, + 285, -1, -1, 288, -1, -1, -1, -1, -1, -1, + 295, 364, 365, -1, -1, 300, -1, 302, 303, 304, + -1, -1, -1, -1, 377, -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, 337, -1, -1, -1, -1, -1, -1, 265, + -1, 267, -1, -1, 270, 418, 272, -1, -1, 275, + -1, -1, -1, 279, 359, 360, 361, 362, 363, -1, + -1, -1, 288, 265, -1, 267, 371, -1, 270, 295, + 272, 273, -1, 275, 300, 277, 302, 279, 304, 281, 282, 283, -1, -1, -1, 287, 288, -1, -1, -1, - -1, 293, -1, 295, 296, -1, -1, -1, 300, -1, - -1, -1, 304, -1, -1, -1, -1, 377, -1, -1, - -1, -1, -1, -1, 316, -1, 318, -1, -1, -1, - 322, 323, -1, -1, 418, -1, -1, -1, 330, 331, - -1, -1, 334, -1, -1, 337, -1, 265, -1, 267, - 342, -1, 270, -1, -1, 273, -1, 275, 418, 277, - -1, 279, -1, 281, 282, 283, -1, -1, -1, 287, - 288, -1, -1, -1, -1, 293, -1, 295, -1, 265, - -1, 267, 300, -1, 270, -1, 304, 273, -1, 275, - -1, 277, -1, 279, -1, 281, 282, 283, 316, -1, - 318, 287, 288, -1, 322, -1, -1, 293, -1, 295, - -1, -1, 330, 331, 300, -1, 334, -1, 304, 337, - -1, -1, -1, 265, 342, 267, 418, -1, 270, -1, - 316, -1, 318, 275, -1, -1, 322, 279, -1, -1, - -1, -1, -1, -1, 330, 331, 288, -1, 334, -1, - -1, 337, -1, 295, -1, 265, 342, 267, 300, 377, - 270, -1, 304, -1, 306, 275, 308, -1, -1, 279, - -1, 313, -1, -1, 316, -1, 318, -1, 288, -1, - 322, -1, -1, 325, -1, 295, -1, -1, 330, 331, - 300, -1, 334, -1, 304, 337, 306, -1, 308, 265, - 418, 267, -1, 313, 270, -1, 316, -1, 318, 275, - -1, -1, 322, 279, -1, 325, -1, -1, -1, -1, - 330, 331, 288, -1, 334, -1, -1, 337, -1, 295, - 372, -1, 418, -1, 300, -1, -1, -1, 304, -1, - 306, -1, -1, -1, -1, -1, -1, 313, -1, -1, - 316, -1, 318, -1, -1, -1, 322, -1, -1, 325, - 370, -1, -1, -1, 330, 331, -1, -1, 334, -1, - 265, 337, 267, -1, -1, 270, 418, -1, -1, -1, - 275, -1, -1, -1, 279, -1, -1, -1, -1, -1, - -1, -1, -1, 288, -1, -1, -1, 363, -1, -1, - 295, -1, 265, -1, 267, 300, -1, 270, 418, 304, - -1, 306, 275, 308, -1, -1, 279, -1, 313, -1, - -1, 316, -1, 318, -1, 288, -1, 322, -1, -1, - 325, -1, 295, -1, -1, 330, 331, 300, -1, 334, - -1, 304, 337, 306, -1, 308, -1, -1, -1, -1, - 313, -1, 418, 316, -1, 318, -1, -1, -1, 322, - -1, -1, 325, -1, -1, -1, -1, 330, 331, -1, - -1, 334, -1, 265, 337, 267, -1, -1, 270, -1, - -1, -1, -1, 275, -1, -1, -1, 279, -1, -1, - -1, 283, 265, -1, 267, -1, 288, 270, -1, -1, - -1, 293, 275, 295, -1, -1, 279, -1, 300, -1, - -1, -1, 304, 305, -1, 288, -1, -1, -1, -1, - -1, -1, 295, 418, 316, -1, 318, 300, -1, -1, - 322, 304, -1, -1, -1, -1, 261, -1, 330, 331, - -1, -1, 334, 316, -1, 318, -1, 272, -1, 322, - -1, -1, 277, -1, -1, 418, 281, 330, 331, 284, - -1, 334, -1, -1, 337, -1, -1, -1, -1, -1, - -1, 296, 297, -1, -1, -1, 301, 302, -1, -1, + 316, 293, 318, 295, 296, -1, 322, 323, 300, -1, + -1, -1, 304, -1, 330, 331, -1, -1, 334, -1, + -1, 337, 417, 418, 316, -1, 318, -1, -1, -1, + 322, 323, -1, -1, -1, -1, -1, -1, 330, 331, + -1, 265, 334, 267, -1, 337, 270, -1, 272, 273, + 342, 275, -1, 277, -1, 279, -1, 281, 282, 283, + -1, -1, -1, 287, 288, -1, -1, -1, -1, 293, + -1, 295, 296, -1, -1, -1, 300, -1, -1, -1, + 304, -1, -1, -1, -1, 377, -1, -1, -1, -1, + -1, -1, 316, -1, 318, -1, -1, -1, 322, 323, + -1, -1, 418, -1, -1, -1, 330, 331, -1, -1, + 334, -1, -1, 337, -1, 265, -1, 267, 342, -1, + 270, -1, -1, 273, -1, 275, 418, 277, -1, 279, + -1, 281, 282, 283, -1, -1, -1, 287, 288, -1, + -1, -1, -1, 293, -1, 295, -1, 265, -1, 267, + 300, -1, 270, -1, 304, 273, -1, 275, -1, 277, + -1, 279, -1, 281, 282, 283, 316, -1, 318, 287, + 288, -1, 322, -1, -1, 293, -1, 295, -1, -1, + 330, 331, 300, -1, 334, -1, 304, 337, -1, -1, + -1, 265, 342, 267, 418, -1, 270, -1, 316, -1, + 318, 275, -1, -1, 322, 279, -1, -1, -1, -1, + -1, -1, 330, 331, 288, -1, 334, -1, -1, 337, + -1, 295, -1, 265, 342, 267, 300, 377, 270, -1, + 304, -1, 306, 275, 308, -1, -1, 279, -1, 313, + -1, -1, 316, -1, 318, -1, 288, -1, 322, -1, + -1, 325, -1, 295, -1, -1, 330, 331, 300, -1, + 334, -1, 304, 337, 306, -1, 308, 265, 418, 267, + -1, 313, 270, -1, 316, -1, 318, 275, -1, -1, + 322, 279, -1, 325, -1, -1, -1, -1, 330, 331, + 288, -1, 334, -1, -1, 337, -1, 295, 372, -1, + 418, -1, 300, -1, -1, -1, 304, -1, 306, -1, + -1, -1, -1, -1, -1, 313, -1, -1, 316, -1, + 318, -1, -1, -1, 322, -1, -1, 325, 370, -1, + -1, -1, 330, 331, -1, -1, 334, -1, 265, 337, + 267, -1, -1, 270, 418, -1, -1, -1, 275, -1, + -1, -1, 279, -1, -1, -1, -1, -1, -1, -1, + -1, 288, -1, -1, -1, 363, -1, -1, 295, -1, + 265, -1, 267, 300, -1, 270, 418, 304, -1, 306, + 275, 308, -1, -1, 279, -1, 313, -1, -1, 316, + -1, 318, -1, 288, -1, 322, -1, -1, 325, -1, + 295, -1, -1, 330, 331, 300, -1, 334, -1, 304, + 337, 306, -1, 308, -1, -1, -1, -1, 313, -1, + 418, 316, -1, 318, -1, -1, -1, 322, -1, -1, + 325, -1, -1, -1, -1, 330, 331, -1, -1, 334, + -1, 265, 337, 267, -1, -1, 270, -1, -1, -1, + -1, 275, -1, -1, -1, 279, -1, -1, -1, 283, + -1, -1, -1, -1, 288, 265, -1, 267, -1, 293, + 270, 295, -1, -1, -1, 275, 300, -1, -1, 279, + 304, 305, -1, -1, -1, -1, -1, -1, 288, -1, + -1, 418, 316, -1, 318, 295, -1, -1, 322, -1, + 300, -1, -1, -1, 304, -1, 330, 331, -1, -1, + 334, -1, -1, 337, -1, 265, 316, 267, 318, -1, + 270, -1, 322, 418, -1, 275, -1, -1, -1, 279, + 330, 331, -1, -1, 334, -1, -1, 337, 288, 265, + -1, 267, -1, -1, 270, 295, -1, -1, -1, 275, + 300, -1, -1, 279, 304, -1, -1, -1, -1, -1, + -1, -1, 288, -1, -1, -1, 316, -1, 318, 295, + -1, -1, 322, -1, 300, -1, -1, -1, 304, -1, + 330, 331, -1, -1, 334, -1, 261, 337, -1, -1, + 316, -1, 318, -1, 418, -1, 322, 272, -1, -1, + -1, -1, 277, -1, 330, 331, 281, -1, 334, 284, + -1, 337, -1, -1, -1, -1, -1, -1, 418, -1, + -1, 296, 297, -1, -1, -1, 301, 302, -1, 261, -1, -1, 307, -1, 309, 310, 311, 312, -1, -1, - 363, -1, 317, -1, -1, -1, 321, -1, 323, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 333, -1, - 335, 336, 261, 338, -1, -1, -1, 342, -1, -1, - -1, -1, -1, 272, -1, -1, 418, -1, 277, -1, - -1, -1, 281, -1, -1, 284, -1, 362, -1, -1, - -1, -1, -1, 368, 369, 418, -1, 296, 297, -1, - -1, -1, 301, 302, 261, -1, 263, -1, 307, -1, - 309, 310, 311, 312, -1, -1, -1, -1, 317, -1, - -1, -1, 321, -1, 323, -1, -1, 284, -1, -1, + 272, -1, 317, -1, -1, 277, 321, -1, 323, 281, + -1, -1, 284, -1, -1, -1, -1, -1, 333, -1, + 335, 336, -1, 338, 296, 297, -1, 342, 418, 301, + 302, -1, 261, -1, 263, 307, -1, 309, 310, 311, + 312, -1, -1, -1, -1, 317, -1, 362, -1, 321, + -1, 323, 418, 368, 369, 284, -1, -1, -1, -1, + -1, 333, -1, -1, 336, -1, 338, -1, 297, -1, + 342, -1, -1, 302, -1, 261, -1, -1, 307, -1, + 309, 310, 311, 312, -1, -1, 272, -1, 317, -1, + 362, 277, 321, -1, -1, 281, 368, 369, 284, -1, -1, -1, -1, -1, 333, -1, -1, 336, -1, 338, - 297, -1, -1, 342, -1, 302, -1, -1, -1, -1, - 307, -1, 309, 310, 311, 312, -1, -1, -1, -1, - 317, -1, -1, 362, 321, -1, -1, 261, -1, 368, - 369, -1, -1, -1, -1, -1, 333, -1, 272, 336, - -1, 338, -1, 277, -1, -1, -1, 281, -1, -1, - 284, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 296, 297, -1, 362, -1, 301, 302, -1, - 261, 368, 369, 307, -1, 309, 310, 311, 312, -1, - -1, 272, -1, 317, -1, -1, 277, 321, -1, 323, - 281, -1, -1, 284, -1, -1, -1, -1, -1, 333, - -1, -1, 336, -1, 338, 296, 297, -1, 342, -1, - 301, 302, 261, -1, -1, -1, 307, -1, 309, 310, - 311, 312, -1, -1, -1, -1, 317, -1, 362, -1, - 321, -1, 323, -1, 368, 284, -1, -1, -1, -1, - -1, -1, 333, -1, -1, 336, -1, 338, 297, -1, - 261, 342, -1, 302, -1, -1, -1, -1, 307, -1, - 309, 310, 311, 312, -1, -1, -1, -1, 317, -1, - -1, 362, 321, 284, -1, -1, -1, 368, -1, -1, - -1, -1, -1, -1, 333, -1, 297, 336, 261, 338, + 296, 297, -1, -1, -1, 301, 302, -1, 261, -1, + -1, 307, -1, 309, 310, 311, 312, -1, -1, 272, + -1, 317, -1, 362, 277, 321, -1, 323, 281, 368, + 369, 284, -1, -1, -1, -1, -1, 333, -1, -1, + 336, -1, 338, 296, 297, -1, 342, -1, 301, 302, + 261, -1, -1, -1, 307, -1, 309, 310, 311, 312, + -1, -1, -1, -1, 317, -1, 362, -1, 321, -1, + 323, -1, 368, 284, -1, -1, -1, -1, -1, -1, + 333, -1, -1, 336, -1, 338, 297, -1, 261, 342, -1, 302, -1, -1, -1, -1, 307, -1, 309, 310, - 311, 312, -1, -1, -1, -1, 317, -1, -1, -1, - 321, 284, -1, 362, -1, 364, 365, -1, -1, 368, - -1, -1, 333, -1, 297, 336, 261, 338, 263, 302, + 311, 312, -1, -1, -1, -1, 317, -1, -1, 362, + 321, 284, -1, -1, -1, 368, -1, -1, -1, -1, + -1, -1, 333, -1, 297, 336, 261, 338, -1, 302, -1, -1, -1, -1, 307, -1, 309, 310, 311, 312, - -1, -1, 315, -1, 317, -1, -1, -1, 321, 284, + -1, -1, -1, -1, 317, -1, -1, -1, 321, 284, -1, 362, -1, 364, 365, -1, -1, 368, -1, -1, - 333, -1, 297, 336, 261, 338, -1, 302, -1, -1, + 333, -1, 297, 336, 261, 338, 263, 302, -1, -1, -1, -1, 307, -1, 309, 310, 311, 312, -1, -1, - -1, -1, 317, -1, -1, -1, 321, 284, -1, 362, - -1, -1, -1, -1, 261, 368, 263, -1, 333, -1, - 297, 336, -1, 338, -1, 302, -1, -1, -1, -1, - 307, -1, 309, 310, 311, 312, -1, 284, -1, -1, - 317, -1, -1, -1, 321, -1, -1, 362, -1, -1, - 297, -1, -1, 368, 261, 302, 333, -1, -1, 336, - 307, 338, 309, 310, 311, 312, -1, -1, 315, -1, - 317, -1, -1, -1, 321, -1, -1, 284, -1, -1, - -1, -1, -1, -1, -1, 362, 333, 364, 365, 336, - 297, 338, -1, -1, -1, 302, -1, -1, -1, -1, + 315, -1, 317, -1, -1, -1, 321, 284, -1, 362, + -1, 364, 365, -1, -1, 368, -1, -1, 333, -1, + 297, 336, 261, 338, 263, 302, -1, -1, -1, -1, 307, -1, 309, 310, 311, 312, -1, -1, -1, -1, - 317, -1, -1, -1, 321, 362, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 333, -1, -1, 336, + 317, -1, -1, -1, 321, 284, -1, 362, -1, -1, + -1, -1, 261, 368, -1, -1, 333, -1, 297, 336, + -1, 338, -1, 302, -1, -1, -1, -1, 307, -1, + 309, 310, 311, 312, -1, 284, 315, -1, 317, -1, + -1, -1, 321, -1, 261, 362, -1, -1, 297, -1, + -1, 368, 301, 302, 333, -1, -1, 336, 307, 338, + 309, 310, 311, 312, -1, -1, -1, 284, 317, -1, + -1, -1, 321, -1, -1, -1, -1, -1, -1, -1, + 297, -1, -1, 362, 333, 302, -1, 336, -1, 338, + 307, -1, 309, 310, 311, 312, -1, -1, -1, -1, + 317, -1, -1, -1, 321, -1, -1, -1, -1, -1, + -1, -1, -1, 362, -1, -1, 333, -1, -1, 336, -1, 338, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, }; -#line 7038 "cs-parser.jay" +#line 7153 "cs-parser.jay" // // A class used to hold info about an operator declarator 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 d161bc9a85..f3c9ae0050 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 @@ -35,7 +35,8 @@ namespace Mono.CSharp Arglist = 1 << 5, DefaultValue = 1 << 6, - All = Ref | Out | This | Params | Arglist | DefaultValue + All = Ref | Out | This | Params | Arglist | DefaultValue, + PrimaryConstructor = Ref | Out | Params | DefaultValue } static readonly object ModifierNone = 0; @@ -926,10 +927,12 @@ class_member_declarations : class_member_declaration { lexer.parsing_modifiers = true; + lexer.parsing_block = 0; } | class_member_declarations class_member_declaration { lexer.parsing_modifiers = true; + lexer.parsing_block = 0; } ; @@ -965,16 +968,22 @@ struct_declaration type_declaration_name { lexer.ConstraintsParsing = true; + valid_param_mod = ParameterModifierType.PrimaryConstructor; push_current_container (new Struct (current_container, (MemberName) $6, (Modifiers) $2, (Attributes) $1), $3); lbag.AddMember (current_container, GetModifierLocations (), GetLocation ($4)); } + opt_primary_parameters opt_class_base opt_type_parameter_constraints_clauses { + valid_param_mod = 0; lexer.ConstraintsParsing = false; - if ($9 != null) - current_container.SetConstraints ((List) $9); + if ($8 != null) + current_type.PrimaryConstructorParameters = (ParametersCompiled) $8; + + if ($10 != null) + current_container.SetConstraints ((List) $10); if (doc_support) current_container.PartialContainer.DocComment = Lexer.consume_doc_comment (); @@ -996,9 +1005,9 @@ struct_declaration opt_semicolon { if ($16 == null) { - lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($14)); + lbag.AppendToMember (current_container, GetLocation ($12), GetLocation ($15)); } else { - lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($14), GetLocation ($16)); + lbag.AppendToMember (current_container, GetLocation ($12), GetLocation ($15), GetLocation ($17)); } $$ = pop_current_class (); } @@ -2016,10 +2025,12 @@ interface_member_declarations : interface_member_declaration { lexer.parsing_modifiers = true; + lexer.parsing_block = 0; } | interface_member_declarations interface_member_declaration { lexer.parsing_modifiers = true; + lexer.parsing_block = 0; } ; @@ -3268,6 +3279,12 @@ member_access $$ = new MemberAccess (new BaseThis (GetLocation ($1)), lt.Value, (TypeArguments) $4, lt.Location); lbag.AddLocation ($$, GetLocation ($2)); } + | AWAIT DOT identifier_inside_body opt_type_argument_list + { + var lt = (LocatedToken) $3; + $$ = new MemberAccess (new SimpleName ("await", ((LocatedToken) $1).Location), lt.Value, (TypeArguments) $4, lt.Location); + lbag.AddLocation ($$, GetLocation ($2)); + } | qualified_alias_member identifier_inside_body opt_type_argument_list { var lt1 = (LocatedToken) $1; @@ -3680,6 +3697,10 @@ anonymous_type_expression // TODO: lbag comma location lbag.AddLocation ($$, GetLocation ($2), GetLocation ($4)); } + | NEW OPEN_BRACE GENERATE_COMPLETION + { + $$ = new EmptyCompletion (); + } ; anonymous_type_parameters_opt_comma @@ -3707,6 +3728,14 @@ anonymous_type_parameters $$ = a; } + | COMPLETE_COMPLETION + { + $$ = new EmptyCompletion (); + } + | anonymous_type_parameter COMPLETE_COMPLETION + { + $$ = $1; + } ; anonymous_type_parameter @@ -4245,6 +4274,16 @@ additive_expression $$ = new Is ((Expression) $1, null, GetLocation ($2)); } + | AWAIT IS type + { + var lt = (LocatedToken) $1; + $$ = new Is (new SimpleName (lt.Value, lt.Location), (Expression) $3, GetLocation ($2)); + } + | AWAIT AS type + { + var lt = (LocatedToken) $1; + $$ = new As (new SimpleName (lt.Value, lt.Location), (Expression) $3, GetLocation ($2)); + } ; shift_expression @@ -4733,6 +4772,51 @@ boolean_expression } ; +opt_primary_parameters + : /* empty */ + { + $$ = null; + } + | primary_parameters + ; + +primary_parameters + : OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS + { + $$ = $2; + + // Cannot use opt_formal_parameter_list because it can be shared instance for empty parameters + lbag.AppendToMember (current_container, GetLocation ($1), GetLocation ($3)); + } + ; + +opt_primary_parameters_with_class_base + : /* empty */ + { + $$ = null; + } + | class_base + { + $$ = null; + } + | primary_parameters + { + $$ = $1; + } + | primary_parameters class_base OPEN_PARENS + { + ++lexer.parsing_block; + } + opt_argument_list CLOSE_PARENS + { + lbag.AppendToMember (current_container, GetLocation ($3), GetLocation ($6)); + ((Class)current_type).PrimaryConstructorBaseArguments = (Arguments) $5; + --lexer.parsing_block; + + $$ = $1; + } + ; + // // 10 classes // @@ -4754,12 +4838,17 @@ class_declaration push_current_container (c, $3); lbag.AddMember (current_container, GetModifierLocations (), GetLocation ($4)); + valid_param_mod = ParameterModifierType.PrimaryConstructor; } - opt_class_base + opt_primary_parameters_with_class_base opt_type_parameter_constraints_clauses { + valid_param_mod = 0; lexer.ConstraintsParsing = false; + if ($8 != null) + current_type.PrimaryConstructorParameters = (ParametersCompiled) $8; + if ($9 != null) current_container.SetConstraints ((List) $9); @@ -4912,7 +5001,11 @@ modifier opt_class_base : /* empty */ - | COLON type_list + | class_base + ; + +class_base + : COLON type_list { current_type.SetBaseTypes ((List) $2); lbag.AppendToMember (current_type, GetLocation ($1)); @@ -6108,7 +6201,8 @@ catch_clauses var l = (List) $1; Catch c = (Catch) $2; - if (l [l.Count - 1].IsGeneral) { + var prev_catch = l [l.Count - 1]; + if (prev_catch.IsGeneral && prev_catch.Filter == null) { report.Error (1017, c.loc, "Try statement already has an empty catch block"); } @@ -6123,9 +6217,11 @@ opt_identifier ; catch_clause - : CATCH block + : CATCH opt_catch_filter block { - $$ = new Catch ((ExplicitBlock) $2, GetLocation ($1)); + var c = new Catch ((ExplicitBlock) $3, GetLocation ($1)); + c.Filter = (CatchFilterExpression) $2; + $$ = c; } | CATCH open_parens_any type opt_identifier CLOSE_PARENS { @@ -6142,8 +6238,9 @@ catch_clause lbag.AddLocation (c, GetLocation ($2), GetLocation ($5)); $$ = c; } - block_prepared_strict + opt_catch_filter block_prepared { + ((Catch) $6).Filter = (CatchFilterExpression) $7; $$ = $6; } | CATCH open_parens_any error @@ -6182,6 +6279,18 @@ catch_clause } ; +opt_catch_filter + : /* empty */ + | IF open_parens_any expression CLOSE_PARENS + { + if (lang_version <= LanguageVersion.V_5) + FeatureIsNotAvailable (GetLocation ($1), "exception filter"); + + $$ = new CatchFilterExpression ((Expression) $3, GetLocation ($1)); + lbag.AddLocation ($$, GetLocation ($2), GetLocation ($4)); + } + ; + checked_statement : CHECKED block { @@ -6936,6 +7045,12 @@ doc_cref module.DocumentationBuilder.ParsedParameters = (List)$2; $$ = null; } + | VOID opt_doc_method_sig + { + module.DocumentationBuilder.ParsedBuiltinType = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1)); + module.DocumentationBuilder.ParsedParameters = (List)$2; + $$ = null; + } | builtin_types DOT IDENTIFIER opt_doc_method_sig { module.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)$1; @@ -6974,7 +7089,7 @@ doc_cref } | OPERATOR overloadable_operator opt_doc_method_sig { - var p = (List)$3 ?? new List (1); + var p = (List)$3; module.DocumentationBuilder.ParsedParameters = p; module.DocumentationBuilder.ParsedOperator = (Operator.OpType) $2; $$ = null; 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 b0d4acbb8f..9b692bf46c 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 @@ -947,7 +947,27 @@ namespace Mono.CSharp if (c < 0x80) return false; - return Char.IsLetter (c) || Char.GetUnicodeCategory (c) == UnicodeCategory.ConnectorPunctuation; + return is_identifier_part_character_slow_part (c); + } + + static bool is_identifier_part_character_slow_part (char c) + { + if (Char.IsLetter (c)) + return true; + + switch (Char.GetUnicodeCategory (c)) { + case UnicodeCategory.ConnectorPunctuation: + + // combining-character: A Unicode character of classes Mn or Mc + case UnicodeCategory.NonSpacingMark: + case UnicodeCategory.SpacingCombiningMark: + + // decimal-digit-character: A Unicode character of the class Nd + case UnicodeCategory.DecimalDigitNumber: + return true; + } + + return false; } public static bool IsKeyword (string s) @@ -1250,7 +1270,7 @@ namespace Mono.CSharp // Tonizes `?' using custom disambiguous rules to return one // of following tokens: INTERR_NULLABLE, OP_COALESCING, INTERR // - // Tricky expression look like: + // Tricky expression looks like: // // Foo ? a = x ? b : c; // @@ -1329,18 +1349,27 @@ namespace Mono.CSharp int interrs = 1; int colons = 0; int braces = 0; + int parens = 0; // // All shorcuts failed, do it hard way // while ((ntoken = xtoken ()) != Token.EOF) { - if (ntoken == Token.OPEN_BRACE) { + switch (ntoken) { + case Token.OPEN_BRACE: ++braces; continue; - } - - if (ntoken == Token.CLOSE_BRACE) { + case Token.OPEN_PARENS: + case Token.OPEN_PARENS_CAST: + case Token.OPEN_PARENS_LAMBDA: + ++parens; + continue; + case Token.CLOSE_BRACE: --braces; continue; + case Token.CLOSE_PARENS: + if (parens > 0) + --parens; + continue; } if (braces != 0) @@ -1348,6 +1377,9 @@ namespace Mono.CSharp if (ntoken == Token.SEMICOLON) break; + + if (parens != 0) + continue; if (ntoken == Token.COLON) { if (++colons == interrs) @@ -3130,7 +3162,7 @@ namespace Mono.CSharp continue; } - } else if (Char.IsLetter ((char) c) || Char.GetUnicodeCategory ((char) c) == UnicodeCategory.ConnectorPunctuation) { + } else if (is_identifier_part_character_slow_part ((char) c)) { id_builder [pos++] = (char) c; continue; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/delegate.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/delegate.cs index 213cd62f7f..907e6df0e0 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/delegate.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/delegate.cs @@ -446,7 +446,8 @@ namespace Mono.CSharp { public override bool ContainsEmitWithAwait () { - return false; + var instance = method_group.InstanceExpression; + return instance != null && instance.ContainsEmitWithAwait (); } public static Arguments CreateDelegateMethodArguments (ResolveContext rc, AParametersCollection pd, TypeSpec[] types, Location loc) @@ -581,6 +582,11 @@ namespace Mono.CSharp { ec.Emit (OpCodes.Newobj, constructor_method); } + public override void FlowAnalysis (FlowAnalysisContext fc) { + base.FlowAnalysis (fc); + method_group.FlowAnalysis (fc); + } + void Error_ConversionFailed (ResolveContext ec, MethodSpec method, Expression return_type) { var invoke_method = Delegate.GetInvokeMethod (type); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/doc.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/doc.cs index 34faed5594..35fe585293 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/doc.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/doc.cs @@ -303,7 +303,7 @@ namespace Mono.CSharp TypeExpr texpr = left as TypeExpr; if (texpr != null) { - var found = MemberCache.FindNestedType (texpr.Type, ParsedName.Name, ParsedName.Arity); + var found = MemberCache.FindNestedType (texpr.Type, mn.Name, mn.Arity); if (found != null) return new TypeExpression (found, Location.Null); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/ecore.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/ecore.cs index fc957771e4..593ab6bcbd 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/ecore.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/ecore.cs @@ -540,10 +540,16 @@ namespace Mono.CSharp { return c; } - public virtual void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public virtual void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { - rc.Module.Compiler.Report.Error (182, loc, - "An attribute argument must be a constant expression, typeof expression or array creation expression"); + if (Attribute.IsValidArgumentType (parameterType)) { + rc.Module.Compiler.Report.Error (182, loc, + "An attribute argument must be a constant expression, typeof expression or array creation expression"); + } else { + rc.Module.Compiler.Report.Error (181, loc, + "Attribute constructor parameter has type `{0}', which is not a valid attribute parameter type", + targetType.GetSignatureForError ()); + } } /// @@ -1582,9 +1588,9 @@ namespace Mono.CSharp { Child.Emit (ec); } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { - Child.EncodeAttributeValue (rc, enc, Child.Type); + Child.EncodeAttributeValue (rc, enc, Child.Type, parameterType); } public override void EmitBranchable (EmitContext ec, Label label, bool on_true) @@ -1702,16 +1708,16 @@ namespace Mono.CSharp { return this; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { // Only boxing to object type is supported if (targetType.BuiltinType != BuiltinTypeSpec.Type.Object) { - base.EncodeAttributeValue (rc, enc, targetType); + base.EncodeAttributeValue (rc, enc, targetType, parameterType); return; } enc.Encode (child.Type); - child.EncodeAttributeValue (rc, enc, child.Type); + child.EncodeAttributeValue (rc, enc, child.Type, parameterType); } public override void Emit (EmitContext ec) @@ -2113,15 +2119,15 @@ namespace Mono.CSharp { return c; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { // // LAMESPEC: Reduced conditional expression is allowed as an attribute argument // if (orig_expr is Conditional) - child.EncodeAttributeValue (rc, enc, targetType); + child.EncodeAttributeValue (rc, enc, targetType,parameterType); else - base.EncodeAttributeValue (rc, enc, targetType); + base.EncodeAttributeValue (rc, enc, targetType, parameterType); } } @@ -2780,6 +2786,17 @@ namespace Mono.CSharp { ct = ct.DeclaringType; } while (ct != null); + } else { + var cos = rc.CurrentMemberDefinition.Parent as ClassOrStruct; + if (cos != null && cos.PrimaryConstructorParameters != null) { + foreach (var p in cos.PrimaryConstructorParameters.FixedParameters) { + if (p.Name == Name) { + rc.Report.Error (9007, loc, "Primary constructor parameter `{0}' is not available in this context when using ref or out modifier", + Name); + return null; + } + } + } } if ((restrictions & MemberLookupRestrictions.InvocableOnly) == 0) { @@ -3421,14 +3438,25 @@ namespace Mono.CSharp { if (InstanceExpression == null || InstanceExpression is TypeExpr) { if (InstanceExpression != null || !This.IsThisAvailable (rc, true)) { - if (rc.HasSet (ResolveContext.Options.FieldInitializerScope)) + if (rc.HasSet (ResolveContext.Options.FieldInitializerScope)) { rc.Report.Error (236, loc, "A field initializer cannot reference the nonstatic field, method, or property `{0}'", GetSignatureForError ()); - else - rc.Report.Error (120, loc, - "An object reference is required to access non-static member `{0}'", - GetSignatureForError ()); + } else { + var fe = this as FieldExpr; + if (fe != null && fe.Spec.MemberDefinition is PrimaryConstructorField) { + if (rc.HasSet (ResolveContext.Options.BaseInitializer)) { + rc.Report.Error (9005, loc, "Constructor initializer cannot access primary constructor parameters"); + } else { + rc.Report.Error (9006, loc, "An object reference is required to access primary constructor parameter `{0}'", + fe.Name); + } + } else { + rc.Report.Error (120, loc, + "An object reference is required to access non-static member `{0}'", + GetSignatureForError ()); + } + } InstanceExpression = new CompilerGeneratedThis (rc.CurrentType, loc).Resolve (rc); return false; @@ -4460,7 +4488,7 @@ namespace Mono.CSharp { // // We have not reached end of parameters list due to params or used default parameters // - if (j < candidate_pd.Count && j < best_pd.Count) { + while (j < candidate_pd.Count && j < best_pd.Count) { var cand_param = candidate_pd.FixedParameters [j]; var best_param = best_pd.FixedParameters [j]; @@ -4468,11 +4496,16 @@ namespace Mono.CSharp { // // LAMESPEC: // - // void Foo (params int[]) is better than void Foo (int i = 0) for Foo () - // void Foo (string[] s, string value = null) is better than Foo (string s, params string[]) for Foo (null) + // void Foo (int i = 0) is better than void Foo (params int[]) for Foo () + // void Foo (string[] s, string value = null) is better than Foo (string s, params string[]) for Foo (null) or Foo () // if (cand_param.HasDefaultValue != best_param.HasDefaultValue) - return !candidate_params; + return cand_param.HasDefaultValue; + + if (cand_param.HasDefaultValue) { + ++j; + continue; + } } else { // // Neither is better when not all arguments are provided @@ -4484,6 +4517,8 @@ namespace Mono.CSharp { if (cand_param.HasDefaultValue && best_param.HasDefaultValue) return false; } + + break; } if (candidate_pd.Count != best_pd.Count) @@ -4668,7 +4703,10 @@ namespace Mono.CSharp { ++arg_count; temp = null; } else { - temp = arguments[index]; + if (index == arg_count) + return (i + 1) * 3; + + temp = arguments [index]; // The slot has been taken by positional argument if (temp != null && !(temp is NamedArgument)) @@ -5418,8 +5456,7 @@ namespace Mono.CSharp { // For candidates which match on parameters count report more details about incorrect arguments // if (pm != null) { - int unexpanded_count = ((IParametersMember) best_candidate).Parameters.HasParams ? pm.Parameters.Count - 1 : pm.Parameters.Count; - if (pm.Parameters.Count == arg_count || params_expanded || unexpanded_count == arg_count) { + if (pm.Parameters.Count == arg_count || params_expanded || HasUnfilledParams (best_candidate, pm, args)) { // Reject any inaccessible member if (!best_candidate.IsAccessible (rc) || !best_candidate.DeclaringType.IsAccessible (rc)) { rc.Report.SymbolRelatedToPreviousError (best_candidate); @@ -5473,6 +5510,39 @@ namespace Mono.CSharp { } } + static bool HasUnfilledParams (MemberSpec best_candidate, IParametersMember pm, Arguments args) + { + var p = ((IParametersMember)best_candidate).Parameters; + if (!p.HasParams) + return false; + + string name = null; + for (int i = p.Count - 1; i != 0; --i) { + var fp = p.FixedParameters [i]; + if ((fp.ModFlags & Parameter.Modifier.PARAMS) == 0) + continue; + + name = fp.Name; + break; + } + + foreach (var arg in args) { + var na = arg as NamedArgument; + if (na == null) + continue; + + if (na.Name == name) { + name = null; + break; + } + } + + if (name == null) + return false; + + return args.Count + 1 == pm.Parameters.Count; + } + bool VerifyArguments (ResolveContext ec, ref Arguments args, MemberSpec member, IParametersMember pm, bool chose_params_expanded) { var pd = pm.Parameters; @@ -5797,6 +5867,14 @@ namespace Mono.CSharp { } } + protected override void CloneTo (CloneContext clonectx, Expression target) + { + var t = (FieldExpr) target; + + if (InstanceExpression != null) + t.InstanceExpression = InstanceExpression.Clone (clonectx); + } + public override Expression CreateExpressionTree (ResolveContext ec) { return CreateExpressionTree (ec, true); @@ -6047,7 +6125,7 @@ namespace Mono.CSharp { return; } - if (TypeSpec.IsValueType (InstanceExpression.Type)) + if (TypeSpec.IsValueType (InstanceExpression.Type) && InstanceExpression is VariableReference) return; } @@ -6130,13 +6208,8 @@ namespace Mono.CSharp { public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound) { bool has_await_source = ec.HasSet (BuilderContext.Options.AsyncBody) && source.ContainsEmitWithAwait (); - if (isCompound && !(source is DynamicExpressionStatement)) { - if (has_await_source) { - if (IsInstance) - InstanceExpression = InstanceExpression.EmitToField (ec); - } else { - prepared = true; - } + if (isCompound && !(source is DynamicExpressionStatement) && !has_await_source) { + prepared = true; } if (IsInstance) { @@ -6148,7 +6221,7 @@ namespace Mono.CSharp { source.Emit (ec); - if (leave_copy) { + if (leave_copy || ec.NotifyEvaluatorOnStore) { ec.Emit (OpCodes.Dup); if (!IsStatic) { temp = new LocalTemporary (this.Type); @@ -6165,6 +6238,16 @@ namespace Mono.CSharp { ec.Emit (OpCodes.Stsfld, spec); else ec.Emit (OpCodes.Stfld, spec); + + if (ec.NotifyEvaluatorOnStore) { + if (!IsStatic) + throw new NotImplementedException ("instance field write"); + + if (leave_copy) + ec.Emit (OpCodes.Dup); + + ec.Module.Evaluator.EmitValueChangedCallback (ec, Name, type, loc); + } if (temp != null) { temp.Emit (ec); @@ -6227,7 +6310,6 @@ namespace Mono.CSharp { var temp = ec.GetTemporaryLocal (type); ec.Emit (OpCodes.Stloc, temp); ec.Emit (OpCodes.Ldloca, temp); - ec.FreeTemporaryLocal (temp, type); return; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/eval.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/eval.cs index d17dd9c406..1645b60195 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/eval.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/eval.cs @@ -71,6 +71,8 @@ namespace Mono.CSharp readonly ModuleContainer module; readonly ReflectionImporter importer; readonly CompilationSourceFile source_file; + + int? listener_id; public Evaluator (CompilerContext ctx) { @@ -288,6 +290,30 @@ namespace Mono.CSharp return compiled; } + static MethodInfo listener_proxy_value; + internal void EmitValueChangedCallback (EmitContext ec, string name, TypeSpec type, Location loc) + { + if (listener_id == null) + listener_id = ListenerProxy.Register (ModificationListener); + + if (listener_proxy_value == null) + listener_proxy_value = typeof (ListenerProxy).GetMethod ("ValueChanged"); + +#if STATIC + throw new NotSupportedException (); +#else + // object value, int row, int col, string name, int listenerId + if (type.IsStructOrEnum) + ec.Emit (OpCodes.Box, type); + + ec.EmitInt (loc.Row); + ec.EmitInt (loc.Column); + ec.Emit (OpCodes.Ldstr, name); + ec.EmitInt (listener_id.Value); + ec.Emit (OpCodes.Call, listener_proxy_value); +#endif + } + /// /// Evaluates and expression or statement and returns any result values. /// @@ -338,6 +364,11 @@ namespace Mono.CSharp Console.WriteLine ("Interrupted!\n{0}", e); } finally { invoking = false; + + if (listener_id != null) { + ListenerProxy.Unregister (listener_id.Value); + listener_id = null; + } } // @@ -445,6 +476,9 @@ namespace Mono.CSharp return result; } + // Experimental + public Action ModificationListener { get; set; } + enum InputKind { EOF, StatementOrExpression, @@ -734,6 +768,7 @@ namespace Mono.CSharp } module.EmitContainer (); + if (Report.Errors != 0){ if (undo != null) undo.ExecuteUndo (); @@ -1230,10 +1265,13 @@ namespace Mono.CSharp if (undo_actions == null) undo_actions = new List (); - var existing = current_container.Containers.FirstOrDefault (l => l.Basename == tc.Basename); - if (existing != null) { - current_container.RemoveContainer (existing); - undo_actions.Add (() => current_container.AddTypeContainer (existing)); + if (current_container.Containers != null) + { + var existing = current_container.Containers.FirstOrDefault (l => l.Basename == tc.Basename); + if (existing != null) { + current_container.RemoveContainer (existing); + undo_actions.Add (() => current_container.AddTypeContainer (existing)); + } } undo_actions.Add (() => current_container.RemoveContainer (tc)); @@ -1251,5 +1289,38 @@ namespace Mono.CSharp undo_actions = null; } } - + + static class ListenerProxy + { + static readonly Dictionary> listeners = new Dictionary> (); + + static int counter; + + public static int Register (Action listener) + { + lock (listeners) { + var id = counter++; + listeners.Add (id, listener); + return id; + } + } + + public static void Unregister (int listenerId) + { + lock (listeners) { + listeners.Remove (listenerId); + } + } + + public static void ValueChanged (object value, int row, int col, string name, int listenerId) + { + Action action; + lock (listeners) { + if (!listeners.TryGetValue (listenerId, out action)) + return; + } + + action (name, row, col, value); + } + } } 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 176f5339ea..cae61ece47 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs @@ -301,10 +301,33 @@ namespace Mono.CSharp return new ULongConstant (ec.BuiltinTypes, ~((ULongConstant) e).Value, e.Location); } if (e is EnumConstant) { - e = TryReduceConstant (ec, ((EnumConstant)e).Child); - if (e != null) - e = new EnumConstant (e, expr_type); - return e; + var res = TryReduceConstant (ec, ((EnumConstant)e).Child); + if (res != null) { + // + // Numeric promotion upgraded types to int but for enum constant + // original underlying constant type is needed + // + if (res.Type.BuiltinType == BuiltinTypeSpec.Type.Int) { + int v = ((IntConstant) res).Value; + switch (((EnumConstant) e).Child.Type.BuiltinType) { + case BuiltinTypeSpec.Type.UShort: + res = new UShortConstant (ec.BuiltinTypes, (ushort) v, e.Location); + break; + case BuiltinTypeSpec.Type.Short: + res = new ShortConstant (ec.BuiltinTypes, (short) v, e.Location); + break; + case BuiltinTypeSpec.Type.Byte: + res = new ByteConstant (ec.BuiltinTypes, (byte) v, e.Location); + break; + case BuiltinTypeSpec.Type.SByte: + res = new SByteConstant (ec.BuiltinTypes, (sbyte) v, e.Location); + break; + } + } + + res = new EnumConstant (res, expr_type); + } + return res; } return null; } @@ -1406,8 +1429,9 @@ namespace Mono.CSharp return null; if (probe_type_expr.IsStatic) { - ec.Report.Error (-244, loc, "The `{0}' operator cannot be applied to an operand of a static type", - OperatorName); + ec.Report.Error (7023, loc, "The second operand of `is' or `as' operator cannot be static type `{0}'", + probe_type_expr.GetSignatureForError ()); + return null; } if (expr.Type.IsPointer || probe_type_expr.IsPointer) { @@ -1425,6 +1449,11 @@ namespace Mono.CSharp return this; } + public override void EmitSideEffect (EmitContext ec) + { + expr.EmitSideEffect (ec); + } + public override void FlowAnalysis (FlowAnalysisContext fc) { expr.FlowAnalysis (fc); @@ -1495,17 +1524,20 @@ namespace Mono.CSharp } ec.Emit (on_true ? OpCodes.Brtrue : OpCodes.Brfalse, target); } - - Expression CreateConstantResult (ResolveContext ec, bool result) + + Expression CreateConstantResult (ResolveContext rc, bool result) { if (result) - ec.Report.Warning (183, 1, loc, "The given expression is always of the provided (`{0}') type", + rc.Report.Warning (183, 1, loc, "The given expression is always of the provided (`{0}') type", probe_type_expr.GetSignatureForError ()); else - ec.Report.Warning (184, 1, loc, "The given expression is never of the provided (`{0}') type", + rc.Report.Warning (184, 1, loc, "The given expression is never of the provided (`{0}') type", probe_type_expr.GetSignatureForError ()); - return ReducedExpression.Create (new BoolConstant (ec.BuiltinTypes, result, loc), this); + var c = new BoolConstant (rc.BuiltinTypes, result, loc); + return expr.IsSideEffectFree ? + ReducedExpression.Create (c, this) : + new SideEffectConstant (c, this, loc); } protected override Expression DoResolve (ResolveContext ec) @@ -1604,12 +1636,15 @@ namespace Mono.CSharp return CreateConstantResult (ec, !c.IsNull); // - // Do not optimize for imported type + // Do not optimize for imported type or dynamic type // if (d.MemberDefinition.IsImported && d.BuiltinType != BuiltinTypeSpec.Type.None && d.MemberDefinition.DeclaringAssembly != t.MemberDefinition.DeclaringAssembly) { return this; } + + if (d.BuiltinType == BuiltinTypeSpec.Type.Dynamic) + return this; // // Turn is check into simple null check for implicitly convertible reference types @@ -2584,7 +2619,9 @@ namespace Mono.CSharp public override void FlowAnalysis (FlowAnalysisContext fc) { if ((oper & Operator.LogicalMask) == 0) { + fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment; left.FlowAnalysis (fc); + fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment; right.FlowAnalysis (fc); return; } @@ -2936,8 +2973,8 @@ namespace Mono.CSharp } } - left = ConvertEnumOperandToUnderlyingType (rc, left); - right = ConvertEnumOperandToUnderlyingType (rc, right); + left = ConvertEnumOperandToUnderlyingType (rc, left, r.IsNullableType); + right = ConvertEnumOperandToUnderlyingType (rc, right, l.IsNullableType); return expr; } } else if ((oper == Operator.Addition || oper == Operator.Subtraction)) { @@ -2952,8 +2989,8 @@ namespace Mono.CSharp // which is not ambiguous with predefined enum operators // if (expr != null) { - left = ConvertEnumOperandToUnderlyingType (rc, left); - right = ConvertEnumOperandToUnderlyingType (rc, right); + left = ConvertEnumOperandToUnderlyingType (rc, left, false); + right = ConvertEnumOperandToUnderlyingType (rc, right, false); return expr; } @@ -3451,6 +3488,13 @@ namespace Mono.CSharp } else { LocalVariable temp = LocalVariable.CreateCompilerGenerated (rc.BuiltinTypes.Bool, rc.CurrentBlock, loc); + if (!Convert.ImplicitConversionExists (rc, left, temp.Type) && (oper == Operator.LogicalAnd ? GetOperatorFalse (rc, left, loc) : GetOperatorTrue (rc, left, loc)) == null) { + rc.Report.Error (7083, left.Location, + "Expression must be implicitly convertible to Boolean or its type `{0}' must define operator `{1}'", + lt.GetSignatureForError (), oper == Operator.LogicalAnd ? "false" : "true"); + return null; + } + args.Add (new Argument (temp.CreateReferenceExpression (rc, loc).Resolve (rc))); args.Add (new Argument (right)); right = new DynamicExpressionStatement (this, args, loc); @@ -3756,7 +3800,7 @@ namespace Mono.CSharp return null; } - static Expression ConvertEnumOperandToUnderlyingType (ResolveContext rc, Expression expr) + static Expression ConvertEnumOperandToUnderlyingType (ResolveContext rc, Expression expr, bool liftType) { TypeSpec underlying_type; if (expr.Type.IsNullableType) { @@ -3780,7 +3824,7 @@ namespace Mono.CSharp break; } - if (expr.Type.IsNullableType) + if (expr.Type.IsNullableType || liftType) underlying_type = rc.Module.PredefinedTypes.Nullable.TypeSpec.MakeGenericType (rc.Module, new[] { underlying_type }); if (expr.Type == underlying_type) @@ -4062,12 +4106,12 @@ namespace Mono.CSharp if (!TypeSpec.IsReferenceType (l) || !TypeSpec.IsReferenceType (r)) return null; - if (l.BuiltinType == BuiltinTypeSpec.Type.String || l.BuiltinType == BuiltinTypeSpec.Type.Delegate || MemberCache.GetUserOperator (l, CSharp.Operator.OpType.Equality, false) != null) + if (l.BuiltinType == BuiltinTypeSpec.Type.String || l.BuiltinType == BuiltinTypeSpec.Type.Delegate || l.IsDelegate || MemberCache.GetUserOperator (l, CSharp.Operator.OpType.Equality, false) != null) ec.Report.Warning (253, 2, loc, "Possible unintended reference comparison. Consider casting the right side expression to type `{0}' to get value comparison", l.GetSignatureForError ()); - if (r.BuiltinType == BuiltinTypeSpec.Type.String || r.BuiltinType == BuiltinTypeSpec.Type.Delegate || MemberCache.GetUserOperator (r, CSharp.Operator.OpType.Equality, false) != null) + if (r.BuiltinType == BuiltinTypeSpec.Type.String || r.BuiltinType == BuiltinTypeSpec.Type.Delegate || r.IsDelegate || MemberCache.GetUserOperator (r, CSharp.Operator.OpType.Equality, false) != null) ec.Report.Warning (252, 2, loc, "Possible unintended reference comparison. Consider casting the left side expression to type `{0}' to get value comparison", r.GetSignatureForError ()); @@ -6746,7 +6790,7 @@ namespace Mono.CSharp if (!Emit (ec, v)) v.Emit (ec); } - + public override void EmitStatement (EmitContext ec) { LocalTemporary v = null; @@ -7552,7 +7596,9 @@ namespace Mono.CSharp public override void Emit (EmitContext ec) { - EmitToFieldSource (ec); + var await_field = EmitToFieldSource (ec); + if (await_field != null) + await_field.Emit (ec); } protected sealed override FieldExpr EmitToFieldSource (EmitContext ec) @@ -7606,18 +7652,18 @@ namespace Mono.CSharp return await_stack_field; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { // no multi dimensional or jagged arrays if (arguments.Count != 1 || array_element_type.IsArray) { - base.EncodeAttributeValue (rc, enc, targetType); + base.EncodeAttributeValue (rc, enc, targetType, parameterType); return; } // No array covariance, except for array -> object if (type != targetType) { if (targetType.BuiltinType != BuiltinTypeSpec.Type.Object) { - base.EncodeAttributeValue (rc, enc, targetType); + base.EncodeAttributeValue (rc, enc, targetType, parameterType); return; } @@ -7631,7 +7677,7 @@ namespace Mono.CSharp if (array_data == null) { IntConstant ic = arguments[0] as IntConstant; if (ic == null || !ic.IsDefaultValue) { - base.EncodeAttributeValue (rc, enc, targetType); + base.EncodeAttributeValue (rc, enc, targetType, parameterType); } else { enc.Encode (0); } @@ -7641,7 +7687,7 @@ namespace Mono.CSharp enc.Encode (array_data.Count); foreach (var element in array_data) { - element.EncodeAttributeValue (rc, enc, array_element_type); + element.EncodeAttributeValue (rc, enc, array_element_type, parameterType); } } @@ -8369,7 +8415,7 @@ namespace Mono.CSharp return false; } - public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType) { // Target type is not System.Type therefore must be object // and we need to use different encoding sequence @@ -8804,7 +8850,7 @@ namespace Mono.CSharp // with disable flow analysis as we don't know whether left side expression // is used as variable or type // - if (expr is VariableReference || expr is ConstantExpr || expr is Linq.TransparentMemberAccess) { + if (expr is VariableReference || expr is ConstantExpr || expr is Linq.TransparentMemberAccess || expr is EventExpr) { expr = expr.Resolve (rc); } else if (expr is TypeParameterExpr) { expr.Error_UnexpectedKind (rc, flags, sn.Location); @@ -9429,6 +9475,10 @@ namespace Mono.CSharp { var ac = (ArrayContainer) ea.Expr.Type; + if (!has_await_args.HasValue && ec.HasSet (BuilderContext.Options.AsyncBody) && ea.Arguments.ContainsEmitWithAwait ()) { + LoadInstanceAndArguments (ec, false, true); + } + LoadInstanceAndArguments (ec, false, false); if (ac.Element.IsGenericParameter && mode == AddressOp.Load) @@ -9625,6 +9675,7 @@ namespace Mono.CSharp // CallRef (ref a[await Task.Factory.StartNew (() => 1)]); // ea.Expr = ea.Expr.EmitToField (ec); + ea.Arguments = ea.Arguments.Emit (ec, false, true); return this; } @@ -10026,6 +10077,10 @@ namespace Mono.CSharp loc = Location.Null; } + protected override void CloneTo (CloneContext clonectx, Expression target) + { + } + public override bool ContainsEmitWithAwait () { return false; @@ -11079,6 +11134,20 @@ namespace Mono.CSharp return e; } + public override void Emit (EmitContext ec) + { + if (method == null && TypeSpec.IsValueType (type) && initializers.Initializers.Count > 1 && ec.HasSet (BuilderContext.Options.AsyncBody) && initializers.ContainsEmitWithAwait ()) { + var fe = ec.GetTemporaryField (type); + + if (!Emit (ec, fe)) + fe.Emit (ec); + + return; + } + + base.Emit (ec); + } + public override bool Emit (EmitContext ec, IMemoryLocation target) { bool left_on_stack; @@ -11095,6 +11164,8 @@ namespace Mono.CSharp LocalTemporary temp = null; instance = target as LocalTemporary; + if (instance == null) + instance = target as StackFieldExpr; if (instance == null) { if (!left_on_stack) { @@ -11203,6 +11274,7 @@ namespace Mono.CSharp type.Define (); if ((ec.Report.Errors - errors) == 0) { parent.Module.AddAnonymousType (type); + type.PrepareEmit (); } return type; @@ -11333,4 +11405,13 @@ namespace Mono.CSharp Name, initializer); } } + + public class CatchFilterExpression : BooleanExpression + { + public CatchFilterExpression (Expression expr, Location loc) + : base (expr) + { + this.loc = loc; + } + } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/field.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/field.cs index d2aa3b38ec..b7f686e027 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/field.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/field.cs @@ -222,7 +222,9 @@ namespace Mono.CSharp if (MemberType.IsStatic) Error_VariableOfStaticClass (Location, GetSignatureForError (), MemberType, Report); - CheckBase (); + if (!IsCompilerGenerated) + CheckBase (); + IsTypePermitted (); } @@ -693,4 +695,39 @@ namespace Mono.CSharp return true; } } + + class PrimaryConstructorField : Field + { + // + // Proxy resolved parameter type expression to avoid type double resolve + // and problems with correct resolve context on partial classes + // + sealed class TypeExpressionFromParameter : TypeExpr + { + Parameter parameter; + + public TypeExpressionFromParameter (Parameter parameter) + { + this.parameter = parameter; + eclass = ExprClass.Type; + loc = parameter.Location; + } + + public override TypeSpec ResolveAsType (IMemberContext mc) + { + return parameter.Type; + } + } + + public PrimaryConstructorField (TypeDefinition parent, Parameter parameter) + : base (parent, new TypeExpressionFromParameter (parameter), Modifiers.PRIVATE, new MemberName (parameter.Name, parameter.Location), null) + { + caching_flags |= Flags.IsUsed | Flags.IsAssigned; + } + + public override string GetSignatureForError () + { + return MemberName.Name; + } + } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/generic.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/generic.cs index 3470c9464c..123534d9f9 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/generic.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/generic.cs @@ -268,8 +268,7 @@ namespace Mono.CSharp { iface_found = true; continue; } - - + var constraint_tp = type as TypeParameterSpec; if (constraint_tp != null) { if (tparam_types == null) { @@ -320,6 +319,12 @@ namespace Mono.CSharp { } } + if (constraint_tp.TypeArguments != null) { + var eb = constraint_tp.GetEffectiveBase (); + if (eb != null && !CheckConflictingInheritedConstraint (spec, eb, spec.BaseType, context, constraint.Location)) + break; + } + if (constraint_tp.HasSpecialStruct) { context.Module.Compiler.Report.Error (456, constraint.Location, "Type parameter `{0}' has the `struct' constraint, so it cannot be used as a constraint for `{1}'", @@ -770,6 +775,7 @@ namespace Mono.CSharp { int tp_pos; TypeSpec[] targs; TypeSpec[] ifaces_defined; + TypeSpec effective_base; // // Creates type owned type parameter @@ -1033,23 +1039,27 @@ namespace Mono.CSharp { return BaseType.IsStruct ? BaseType.BaseType : BaseType; } - var types = targs; - if (HasTypeConstraint) { - Array.Resize (ref types, types.Length + 1); + if (effective_base != null) + return effective_base; + + var types = new TypeSpec [HasTypeConstraint ? targs.Length + 1 : targs.Length]; - for (int i = 0; i < types.Length - 1; ++i) { - types[i] = types[i].BaseType; + for (int i = 0; i < targs.Length; ++i) { + var t = targs [i]; + + // Same issue as above, inherited constraints can be of struct type + if (t.IsStruct) { + types [i] = t.BaseType; + continue; } - types[types.Length - 1] = BaseType; - } else { - types = types.Select (l => l.BaseType).ToArray (); + types [i] = ((TypeParameterSpec)t).GetEffectiveBase (); } - if (types != null) - return Convert.FindMostEncompassedType (types); + if (HasTypeConstraint) + types [types.Length - 1] = BaseType; - return BaseType; + return effective_base = Convert.FindMostEncompassedType (types); } public override string GetSignatureForDocumentation () @@ -1313,12 +1323,17 @@ namespace Mono.CSharp { if (targs != null) { foreach (var ta in targs) { - var b_type = ta.BaseType; - if (b_type.BuiltinType != BuiltinTypeSpec.Type.Object && b_type.BuiltinType != BuiltinTypeSpec.Type.ValueType) - cache.AddBaseType (b_type); - var tps = ta as TypeParameterSpec; - var ifaces = tps != null ? tps.InterfacesDefined : ta.Interfaces; + IList ifaces; + if (tps != null) { + var b_type = tps.GetEffectiveBase (); + if (b_type != null && b_type.BuiltinType != BuiltinTypeSpec.Type.Object && b_type.BuiltinType != BuiltinTypeSpec.Type.ValueType) + cache.AddBaseType (b_type); + + ifaces = tps.InterfacesDefined; + } else { + ifaces = ta.Interfaces; + } if (ifaces != null) { foreach (var iface_type in ifaces) { @@ -1340,7 +1355,15 @@ namespace Mono.CSharp { if (TypeArguments != null) { foreach (var t in TypeArguments) { - if (((TypeParameterSpec) t).IsConvertibleToInterface (iface)) + var tps = t as TypeParameterSpec; + if (tps != null) { + if (tps.IsConvertibleToInterface (iface)) + return true; + + continue; + } + + if (t.ImplementsInterface (iface, false)) return true; } } @@ -1448,13 +1471,18 @@ namespace Mono.CSharp { if (tp != null) return Inflate (tp); - var ac = type as ArrayContainer; - if (ac != null) { - var et = Inflate (ac.Element); - if (et != ac.Element) - return ArrayContainer.MakeType (context.Module, et, ac.Rank); + var ec = type as ElementTypeSpec; + if (ec != null) { + var et = Inflate (ec.Element); + if (et != ec.Element) { + var ac = ec as ArrayContainer; + if (ac != null) + return ArrayContainer.MakeType (context.Module, et, ac.Rank); + + throw new NotImplementedException (); + } - return ac; + return ec; } if (type.Kind == MemberKind.MissingType) @@ -2163,6 +2191,8 @@ namespace Mono.CSharp { atypes = new TypeSpec [count]; + var errors = ec.Module.Compiler.Report.Errors; + for (int i = 0; i < count; i++){ var te = args[i].ResolveAsType (ec); if (te == null) { @@ -2186,7 +2216,7 @@ namespace Mono.CSharp { } } - if (!ok) + if (!ok || errors != ec.Module.Compiler.Report.Errors) atypes = null; return ok; @@ -2406,6 +2436,8 @@ namespace Mono.CSharp { return null; TypeSpec[] atypes = args.Arguments; + if (atypes == null) + return null; // // Now bind the parameters diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/iterators.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/iterators.cs index 0d3c19af9a..8b45f88a91 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/iterators.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/iterators.cs @@ -204,10 +204,13 @@ namespace Mono.CSharp protected StateMachine (ParametersBlock block, TypeDefinition parent, MemberBase host, TypeParameters tparams, string name, MemberKind kind) : base (block, parent, host, tparams, name, kind) { + OriginalTypeParameters = tparams; } #region Properties + public TypeParameters OriginalTypeParameters { get; private set; } + public StateMachineMethod StateMachineMethod { get { return method; @@ -721,7 +724,6 @@ namespace Mono.CSharp // The state as we generate the machine // Label move_next_ok; - Label iterator_body_end; protected Label move_next_error; LocalBuilder skip_finally; protected LocalBuilder current_pc; @@ -735,11 +737,7 @@ namespace Mono.CSharp #region Properties - public Label BodyEnd { - get { - return iterator_body_end; - } - } + public Label BodyEnd { get; set; } public LocalBuilder CurrentPC { @@ -827,11 +825,11 @@ namespace Mono.CSharp // We only care if the PC is zero (start executing) or non-zero (don't do anything) ec.Emit (OpCodes.Brtrue, move_next_error); - iterator_body_end = ec.DefineLabel (); + BodyEnd = ec.DefineLabel (); block.EmitEmbedded (ec); - ec.MarkLabel (iterator_body_end); + ec.MarkLabel (BodyEnd); EmitMoveNextEpilogue (ec); @@ -890,11 +888,11 @@ namespace Mono.CSharp ec.MarkLabel (labels[0]); - iterator_body_end = ec.DefineLabel (); + BodyEnd = ec.DefineLabel (); block.EmitEmbedded (ec); - ec.MarkLabel (iterator_body_end); + ec.MarkLabel (BodyEnd); if (async_init != null) { var catch_value = LocalVariable.CreateCompilerGenerated (ec.Module.Compiler.BuiltinTypes.Exception, block, Location); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/membercache.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/membercache.cs index 5b9d6e6479..82acb67b16 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/membercache.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/membercache.cs @@ -566,11 +566,7 @@ namespace Mono.CSharp { for (int i = 0; i < applicable.Count; ++i) { var entry = applicable [i]; - if ((entry.Modifiers & Modifiers.PRIVATE) != 0) - continue; - - if ((entry.Modifiers & Modifiers.AccessibilityMask) == Modifiers.INTERNAL && - !entry.DeclaringType.MemberDefinition.IsInternalAsPublic (member.Module.DeclaringAssembly)) + if ((entry.Modifiers & Modifiers.PUBLIC) == 0 && !entry.IsAccessible (member)) continue; // @@ -701,6 +697,14 @@ namespace Mono.CSharp { if ((name_entry.Modifiers & Modifiers.STATIC) != 0) continue; + // + // Ignore user private fields for definite assignment. This is sort of unexpected but + // rationale is to have consistent results when using reference assemblies which don't + // include any private fields and full assemblies + // + if ((name_entry.Modifiers & (Modifiers.PRIVATE | Modifiers.BACKING_FIELD)) == Modifiers.PRIVATE) + continue; + // // Fixed size buffers are not subject to definite assignment checking // diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/method.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/method.cs index 86b4d8e765..c74e7f3f33 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/method.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/method.cs @@ -563,6 +563,12 @@ namespace Mono.CSharp { if ((ModFlags & extern_static) != extern_static) { Report.Error (601, a.Location, "The DllImport attribute must be specified on a method marked `static' and `extern'"); } + + if (MemberName.IsGeneric || Parent.IsGenericOrParentIsGeneric) { + Report.Error (7042, a.Location, + "The DllImport attribute cannot be applied to a method that is generic or contained in a generic type"); + } + is_external_implementation = true; } @@ -719,6 +725,11 @@ namespace Mono.CSharp { if (MethodData != null) MethodData.Emit (Parent); + if (block != null && block.StateMachine is AsyncTaskStorey) { + var psm = Module.PredefinedAttributes.AsyncStateMachine; + psm.EmitAttribute (MethodBuilder, block.StateMachine); + } + if ((ModFlags & Modifiers.PARTIAL) == 0) Block = null; } @@ -1101,61 +1112,61 @@ namespace Mono.CSharp { } for (int i = 0; i < tparams.Count; ++i) { - var tp = tparams[i]; + var tp = tparams [i]; - if (!tp.ResolveConstraints (this)) + if (base_tparams == null) { + tp.ResolveConstraints (this); continue; + } // // Copy base constraints for override/explicit methods // - if (base_tparams != null) { - var base_tparam = base_tparams[i]; - var local_tparam = tp.Type; - local_tparam.SpecialConstraint = base_tparam.SpecialConstraint; + var base_tparam = base_tparams [i]; + var local_tparam = tp.Type; + local_tparam.SpecialConstraint = base_tparam.SpecialConstraint; - var inflator = new TypeParameterInflator (this, CurrentType, base_decl_tparams, base_targs); - base_tparam.InflateConstraints (inflator, local_tparam); + var inflator = new TypeParameterInflator (this, CurrentType, base_decl_tparams, base_targs); + base_tparam.InflateConstraints (inflator, local_tparam); - // - // Check all type argument constraints for possible collision or unification - // introduced by inflating inherited constraints in this context - // - // Conflict example: - // - // class A { virtual void Foo () where U : class, T {} } - // class B : A { override void Foo {} } - // - var local_tparam_targs = local_tparam.TypeArguments; - if (local_tparam_targs != null) { - for (int ii = 0; ii < local_tparam_targs.Length; ++ii) { - var ta = local_tparam_targs [ii]; - if (!ta.IsClass && !ta.IsStruct) - continue; - - TypeSpec[] unique_tparams = null; - for (int iii = ii + 1; iii < local_tparam_targs.Length; ++iii) { - // - // Remove any identical or unified constraint types - // - var tparam_checked = local_tparam_targs[iii]; - if (TypeSpecComparer.IsEqual (ta, tparam_checked) || TypeSpec.IsBaseClass (ta, tparam_checked, false)) { - unique_tparams = new TypeSpec[local_tparam_targs.Length - 1]; - Array.Copy (local_tparam_targs, 0, unique_tparams, 0, iii); - Array.Copy (local_tparam_targs, iii + 1, unique_tparams, iii, local_tparam_targs.Length - iii - 1); - } else if (!TypeSpec.IsBaseClass (tparam_checked, ta, false)) { - Constraints.Error_ConflictingConstraints (this, local_tparam, ta, tparam_checked, Location); - } - } - - if (unique_tparams != null) { - local_tparam_targs = unique_tparams; - local_tparam.TypeArguments = local_tparam_targs; - continue; + // + // Check all type argument constraints for possible collision or unification + // introduced by inflating inherited constraints in this context + // + // Conflict example: + // + // class A { virtual void Foo () where U : class, T {} } + // class B : A { override void Foo {} } + // + var local_tparam_targs = local_tparam.TypeArguments; + if (local_tparam_targs != null) { + for (int ii = 0; ii < local_tparam_targs.Length; ++ii) { + var ta = local_tparam_targs [ii]; + if (!ta.IsClass && !ta.IsStruct) + continue; + + TypeSpec[] unique_tparams = null; + for (int iii = ii + 1; iii < local_tparam_targs.Length; ++iii) { + // + // Remove any identical or unified constraint types + // + var tparam_checked = local_tparam_targs [iii]; + if (TypeSpecComparer.IsEqual (ta, tparam_checked) || TypeSpec.IsBaseClass (ta, tparam_checked, false)) { + unique_tparams = new TypeSpec[local_tparam_targs.Length - 1]; + Array.Copy (local_tparam_targs, 0, unique_tparams, 0, iii); + Array.Copy (local_tparam_targs, iii + 1, unique_tparams, iii, local_tparam_targs.Length - iii - 1); + } else if (!TypeSpec.IsBaseClass (tparam_checked, ta, false)) { + Constraints.Error_ConflictingConstraints (this, local_tparam, ta, tparam_checked, Location); } + } - Constraints.CheckConflictingInheritedConstraint (local_tparam, ta, this, Location); + if (unique_tparams != null) { + local_tparam_targs = unique_tparams; + local_tparam.TypeArguments = local_tparam_targs; + continue; } + + Constraints.CheckConflictingInheritedConstraint (local_tparam, ta, this, Location); } } } @@ -1343,12 +1354,6 @@ namespace Mono.CSharp { } } - if (block != null && block.StateMachine is AsyncTaskStorey) { - var psm = Module.PredefinedAttributes.AsyncStateMachine; - - psm.EmitAttribute (MethodBuilder, block.StateMachine); - } - if ((ModFlags & Modifiers.METHOD_EXTENSION) != 0) Module.PredefinedAttributes.Extension.EmitAttribute (MethodBuilder); @@ -1524,8 +1529,8 @@ namespace Mono.CSharp { } class GeneratedBaseInitializer: ConstructorBaseInitializer { - public GeneratedBaseInitializer (Location loc): - base (null, loc) + public GeneratedBaseInitializer (Location loc, Arguments arguments) + : base (arguments, loc) { } } @@ -1585,6 +1590,8 @@ namespace Mono.CSharp { } } + public bool IsPrimaryConstructor { get; set; } + MethodBase IMethodDefinition.Metadata { get { @@ -1673,6 +1680,16 @@ namespace Mono.CSharp { if (!CheckBase ()) return false; + if (Parent.PrimaryConstructorParameters != null && !IsPrimaryConstructor) { + if (Parent.Kind == MemberKind.Struct) { + Report.Error (9009, Location, "`{0}': Structs with primary constructor cannot have explicit constructor", + GetSignatureForError ()); + } else if (Initializer == null || Initializer is ConstructorBaseInitializer) { + Report.Error (9002, Location, "`{0}': Instance constructor of type with primary constructor must specify `this' constructor initializer", + GetSignatureForError ()); + } + } + var ca = ModifiersExtensions.MethodAttr (ModFlags) | MethodAttributes.RTSpecialName | MethodAttributes.SpecialName; ConstructorBuilder = Parent.TypeBuilder.DefineConstructor ( @@ -1744,7 +1761,7 @@ namespace Mono.CSharp { // block.AddThisVariable (bc); } else if (Parent.PartialContainer.Kind == MemberKind.Class) { - Initializer = new GeneratedBaseInitializer (Location); + Initializer = new GeneratedBaseInitializer (Location, null); } } @@ -1975,7 +1992,7 @@ namespace Mono.CSharp { return false; } } else { - if (implementing != null) { + if (implementing != null && !optional) { if (!method.IsAccessor) { if (implementing.IsAccessor) { container.Compiler.Report.SymbolRelatedToPreviousError (implementing); @@ -2461,6 +2478,11 @@ namespace Mono.CSharp { return false; } + public void PrepareEmit () + { + method_data.DefineMethodBuilder (Parent.PartialContainer, ParameterInfo); + } + public override void WriteDebugSymbol (MonoSymbolFile file) { if (method_data != null) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/nullable.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/nullable.cs index 19ec40870e..566c62af3a 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/nullable.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/nullable.cs @@ -529,6 +529,11 @@ namespace Mono.CSharp.Nullable return null; Expression res = base.ResolveOperator (ec, unwrap); + if (res == null) { + Error_OperatorCannotBeApplied (ec, loc, OperName (Oper), Expr.Type); + return null; + } + if (res != this) { if (user_operator == null) return res; @@ -1153,26 +1158,25 @@ namespace Mono.CSharp.Nullable // Constant lc = left as Constant; if (lc != null && !lc.IsDefaultValue) - return ReducedExpression.Create (lc, this); + return ReducedExpression.Create (lc, this, false); // // Reduce (left ?? null) to left OR (null-constant ?? right) to right // - if (right.IsNull || lc != null) - return ReducedExpression.Create (lc != null ? right : left, this); + if (right.IsNull || lc != null) { + // + // Special case null ?? null + // + if (right.IsNull && ltype == right.Type) + return null; + + return ReducedExpression.Create (lc != null ? right : left, this, false); + } right = Convert.ImplicitConversion (ec, right, ltype, loc); type = ltype; return this; } - - // - // Special case null ?? null - // - if (ltype == right.Type) { - type = ltype; - return this; - } } else { return null; } @@ -1185,7 +1189,7 @@ namespace Mono.CSharp.Nullable // Reduce (null ?? right) to right // if (left.IsNull) - return ReducedExpression.Create (right, this).Resolve (ec); + return ReducedExpression.Create (right, this, false).Resolve (ec); left = Convert.ImplicitConversion (ec, unwrap ?? left, rtype, loc); type = rtype; @@ -1229,7 +1233,15 @@ namespace Mono.CSharp.Nullable unwrap.EmitCheck (ec); ec.Emit (OpCodes.Brfalse, is_null_label); - left.Emit (ec); + // + // When both expressions are nullable the unwrap + // is needed only for null check not for value uwrap + // + if (type.IsNullableType && TypeSpecComparer.IsEqual (NullableInfo.GetUnderlyingType (type), unwrap.Type)) + unwrap.Load (ec); + else + left.Emit (ec); + ec.Emit (OpCodes.Br, end_label); ec.MarkLabel (is_null_label); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/parameter.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/parameter.cs index da2b13e4ab..f1215173cb 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/parameter.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/parameter.cs @@ -223,6 +223,7 @@ namespace Mono.CSharp { } static readonly string[] attribute_targets = new string[] { "param" }; + static readonly string[] attribute_targets_primary = new string[] { "param", "field" }; FullNamedExpression texpr; Modifier modFlags; @@ -233,6 +234,7 @@ namespace Mono.CSharp { protected int idx; public bool HasAddressTaken; + Constructor primary_constructor; TemporaryVariableReference expr_tree_variable; HoistedParameter hoisted_variant; @@ -307,7 +309,7 @@ namespace Mono.CSharp { public override string[] ValidAttributeTargets { get { - return attribute_targets; + return primary_constructor != null ? attribute_targets_primary : attribute_targets; } } @@ -315,6 +317,12 @@ namespace Mono.CSharp { public override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa) { + if (a.Target == AttributeTargets.Field) { + var field = MemberCache.FindMember (primary_constructor.Spec.DeclaringType, MemberFilter.Field (name, parameter_type), BindingRestriction.DeclaredOnly); + ((Field)field.MemberDefinition).ApplyAttributeBuilder (a, ctor, cdata, pa); + return; + } + if (a.Type == pa.In && ModFlags == Modifier.OUT) { a.Report.Error (36, a.Location, "An out parameter cannot have the `In' attribute"); return; @@ -371,6 +379,15 @@ namespace Mono.CSharp { return member.IsAccessibleAs (parameter_type); } + bool IsValidCallerContext (MemberCore memberContext) + { + var m = memberContext as Method; + if (m != null) + return !m.IsPartialImplementation; + + return true; + } + // // Resolve is used in method definitions // @@ -382,6 +399,10 @@ namespace Mono.CSharp { if (attributes != null) attributes.AttachTo (this, rc); + var ctor = rc.CurrentMemberDefinition as Constructor; + if (ctor != null && ctor.IsPrimaryConstructor) + primary_constructor = ctor; + parameter_type = texpr.ResolveAsType (rc); if (parameter_type == null) return null; @@ -416,6 +437,7 @@ namespace Mono.CSharp { { var pa = rc.Module.PredefinedAttributes; TypeSpec caller_type; + Attribute callerMemberName = null, callerFilePath = null; foreach (var attr in attributes.Attrs) { var atype = attr.ResolveTypeForComparison (); @@ -430,7 +452,14 @@ namespace Mono.CSharp { caller_type.GetSignatureForError (), parameter_type.GetSignatureForError ()); } + if (!IsValidCallerContext (rc.CurrentMemberDefinition)) { + rc.Report.Warning (4026, 1, attr.Location, + "The CallerMemberName applied to parameter `{0}' will have no effect because it applies to a member that is used in context that do not allow optional arguments", + name); + } + modFlags |= Modifier.CallerMemberName; + callerMemberName = attr; continue; } @@ -438,10 +467,16 @@ namespace Mono.CSharp { caller_type = rc.BuiltinTypes.Int; if (caller_type != parameter_type && !Convert.ImplicitNumericConversionExists (caller_type, parameter_type)) { rc.Report.Error (4017, attr.Location, - "The CallerMemberName attribute cannot be applied because there is no standard conversion from `{0}' to `{1}'", + "The CallerLineNumberAttribute attribute cannot be applied because there is no standard conversion from `{0}' to `{1}'", caller_type.GetSignatureForError (), parameter_type.GetSignatureForError ()); } + if (!IsValidCallerContext (rc.CurrentMemberDefinition)) { + rc.Report.Warning (4024, 1, attr.Location, + "The CallerLineNumberAttribute applied to parameter `{0}' will have no effect because it applies to a member that is used in context that do not allow optional arguments", + name); + } + modFlags |= Modifier.CallerLineNumber; continue; } @@ -454,10 +489,40 @@ namespace Mono.CSharp { caller_type.GetSignatureForError (), parameter_type.GetSignatureForError ()); } + if (!IsValidCallerContext (rc.CurrentMemberDefinition)) { + rc.Report.Warning (4025, 1, attr.Location, + "The CallerFilePath applied to parameter `{0}' will have no effect because it applies to a member that is used in context that do not allow optional arguments", + name); + } + modFlags |= Modifier.CallerFilePath; + callerFilePath = attr; continue; } } + + if ((modFlags & Modifier.CallerLineNumber) != 0) { + if (callerMemberName != null) { + rc.Report.Warning (7081, 1, callerMemberName.Location, + "The CallerMemberNameAttribute applied to parameter `{0}' will have no effect. It is overridden by the CallerLineNumberAttribute", + Name); + } + + if (callerFilePath != null) { + rc.Report.Warning (7082, 1, callerFilePath.Location, + "The CallerFilePathAttribute applied to parameter `{0}' will have no effect. It is overridden by the CallerLineNumberAttribute", + name); + } + } + + if ((modFlags & Modifier.CallerMemberName) != 0) { + if (callerFilePath != null) { + rc.Report.Warning (7080, 1, callerFilePath.Location, + "The CallerMemberNameAttribute applied to parameter `{0}' will have no effect. It is overridden by the CallerFilePathAttribute", + name); + } + + } } public void ResolveDefaultValue (ResolveContext rc) @@ -648,9 +713,9 @@ namespace Mono.CSharp { } else { builder.SetConstant (c.GetValue ()); } - } else if (default_expr.Type.IsStruct) { + } else if (default_expr.Type.IsStruct || default_expr.Type.IsGenericParameter) { // - // Handles special case where default expression is used with value-type + // Handles special case where default expression is used with value-type or type parameter // // void Foo (S s = default (S)) {} // diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/property.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/property.cs index 1d8c7e4fa1..b27566e025 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/property.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/property.cs @@ -82,6 +82,8 @@ namespace Mono.CSharp } } + public abstract void PrepareEmit (); + protected override bool VerifyClsCompliance () { if (!base.VerifyClsCompliance ()) @@ -197,7 +199,7 @@ namespace Mono.CSharp { } - public override MethodBuilder Define (TypeContainer parent) + public override void Define (TypeContainer parent) { base.Define (parent); @@ -205,12 +207,7 @@ namespace Mono.CSharp method_data = new MethodData (method, ModFlags, flags, this); - if (!method_data.Define (parent.PartialContainer, method.GetFullName (MemberName))) - return null; - - method_data.DefineMethodBuilder (parent.PartialContainer, ParameterInfo); - - return method_data.MethodBuilder; + method_data.Define (parent.PartialContainer, method.GetFullName (MemberName)); } public override TypeSpec ReturnType { @@ -262,7 +259,7 @@ namespace Mono.CSharp } } - public override MethodBuilder Define (TypeContainer parent) + public override void Define (TypeContainer parent) { parameters.Resolve (this); @@ -272,12 +269,7 @@ namespace Mono.CSharp method_data = new MethodData (method, ModFlags, flags, this); - if (!method_data.Define (parent.PartialContainer, method.GetFullName (MemberName))) - return null; - - method_data.DefineMethodBuilder (parent.PartialContainer, ParameterInfo); - - return method_data.MethodBuilder; + method_data.Define (parent.PartialContainer, method.GetFullName (MemberName)); } public override TypeSpec ReturnType { @@ -334,7 +326,7 @@ namespace Mono.CSharp return method.IsClsComplianceRequired (); } - public virtual MethodBuilder Define (TypeContainer parent) + public virtual void Define (TypeContainer parent) { var container = parent.PartialContainer; @@ -369,8 +361,6 @@ namespace Mono.CSharp if (Compiler.Settings.WriteMetadataOnly) block = null; } - - return null; } public bool HasCustomAccessModifier { @@ -522,7 +512,16 @@ namespace Mono.CSharp // Check base property accessors conflict // var base_prop = (PropertySpec) base_member; - if (Get != null) { + if (Get == null) { + if ((ModFlags & Modifiers.SEALED) != 0 && base_prop.HasGet && !base_prop.Get.IsAccessible (this)) { + // TODO: Should be different error code but csc uses for some reason same + Report.SymbolRelatedToPreviousError (base_prop); + Report.Error (545, Location, + "`{0}': cannot override because `{1}' does not have accessible get accessor", + GetSignatureForError (), base_prop.GetSignatureForError ()); + ok = false; + } + } else { if (!base_prop.HasGet) { if (ok) { Report.SymbolRelatedToPreviousError (base_prop); @@ -539,7 +538,16 @@ namespace Mono.CSharp } } - if (Set != null) { + if (Set == null) { + if ((ModFlags & Modifiers.SEALED) != 0 && base_prop.HasSet && !base_prop.Set.IsAccessible (this)) { + // TODO: Should be different error code but csc uses for some reason same + Report.SymbolRelatedToPreviousError (base_prop); + Report.Error (546, Location, + "`{0}': cannot override because `{1}' does not have accessible set accessor", + GetSignatureForError (), base_prop.GetSignatureForError ()); + ok = false; + } + } else { if (!base_prop.HasSet) { if (ok) { Report.SymbolRelatedToPreviousError (base_prop); @@ -624,24 +632,14 @@ namespace Mono.CSharp if (Get != null) { spec.Get = Get.Spec; - - var method = Get.Spec.GetMetaInfo () as MethodBuilder; - if (method != null) { - PropertyBuilder.SetGetMethod (method); - Parent.MemberCache.AddMember (this, method.Name, Get.Spec); - } + Parent.MemberCache.AddMember (this, Get.Spec.Name, Get.Spec); } else { CheckMissingAccessor (kind, parameters, true); } if (Set != null) { spec.Set = Set.Spec; - - var method = Set.Spec.GetMetaInfo () as MethodBuilder; - if (method != null) { - PropertyBuilder.SetSetMethod (method); - Parent.MemberCache.AddMember (this, method.Name, Set.Spec); - } + Parent.MemberCache.AddMember (this, Set.Spec.Name, Set.Spec); } else { CheckMissingAccessor (kind, parameters, false); } @@ -681,6 +679,25 @@ namespace Mono.CSharp } } + public override void PrepareEmit () + { + AccessorFirst.PrepareEmit (); + if (AccessorSecond != null) + AccessorSecond.PrepareEmit (); + + if (get != null) { + var method = Get.Spec.GetMetaInfo () as MethodBuilder; + if (method != null) + PropertyBuilder.SetGetMethod (method); + } + + if (set != null) { + var method = Set.Spec.GetMetaInfo () as MethodBuilder; + if (method != null) + PropertyBuilder.SetSetMethod (method); + } + } + protected override void SetMemberName (MemberName new_name) { base.SetMemberName (new_name); @@ -859,10 +876,10 @@ namespace Mono.CSharp { } - public override MethodBuilder Define (TypeContainer ds) + public override void Define (TypeContainer ds) { CheckAbstractAndExtern (block != null); - return base.Define (ds); + base.Define (ds); } public override string GetSignatureForError () @@ -1129,9 +1146,6 @@ namespace Mono.CSharp return true; } - if (Add.IsInterfaceImplementation) - SetIsUsed (); - backing_field = new Field (Parent, new TypeExpression (MemberType, Location), Modifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.PRIVATE | (ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)), @@ -1205,7 +1219,7 @@ namespace Mono.CSharp return method.IsClsComplianceRequired (); } - public virtual MethodBuilder Define (TypeContainer parent) + public virtual void Define (TypeContainer parent) { // Fill in already resolved event type to speed things up and // avoid confusing duplicate errors @@ -1216,17 +1230,13 @@ namespace Mono.CSharp method.flags | MethodAttributes.HideBySig | MethodAttributes.SpecialName, this); if (!method_data.Define (parent.PartialContainer, method.GetFullName (MemberName))) - return null; - - method_data.DefineMethodBuilder (parent.PartialContainer, ParameterInfo); + return; if (Compiler.Settings.WriteMetadataOnly) block = null; Spec = new MethodSpec (MemberKind.Method, parent.PartialContainer.Definition, this, ReturnType, ParameterInfo, method.ModFlags); Spec.IsAccessor = true; - - return method_data.MethodBuilder; } public override TypeSpec ReturnType { @@ -1240,6 +1250,12 @@ namespace Mono.CSharp return method.GetAttributeObsolete (); } + public MethodData MethodData { + get { + return method_data; + } + } + public override string[] ValidAttributeTargets { get { return attribute_targets; @@ -1338,23 +1354,16 @@ namespace Mono.CSharp // // Now define the accessors // - var AddBuilder = Add.Define (Parent); - if (AddBuilder == null) - return false; - - var RemoveBuilder = remove.Define (Parent); - if (RemoveBuilder == null) - return false; + add.Define (Parent); + remove.Define (Parent); EventBuilder = Parent.TypeBuilder.DefineEvent (GetFullName (MemberName), EventAttributes.None, MemberType.GetMetaInfo ()); - EventBuilder.SetAddOnMethod (AddBuilder); - EventBuilder.SetRemoveOnMethod (RemoveBuilder); spec = new EventSpec (Parent.Definition, this, MemberType, ModFlags, Add.Spec, remove.Spec); Parent.MemberCache.AddMember (this, GetFullName (MemberName), spec); - Parent.MemberCache.AddMember (this, AddBuilder.Name, Add.Spec); - Parent.MemberCache.AddMember (this, RemoveBuilder.Name, remove.Spec); + Parent.MemberCache.AddMember (this, Add.Spec.Name, Add.Spec); + Parent.MemberCache.AddMember (this, Remove.Spec.Name, remove.Spec); return true; } @@ -1376,6 +1385,15 @@ namespace Mono.CSharp base.Emit (); } + public override void PrepareEmit () + { + add.PrepareEmit (); + remove.PrepareEmit (); + + EventBuilder.SetAddOnMethod (add.MethodData.MethodBuilder); + EventBuilder.SetRemoveOnMethod (remove.MethodData.MethodBuilder); + } + public override void WriteDebugSymbol (MonoSymbolFile file) { add.WriteDebugSymbol (file); @@ -1465,7 +1483,7 @@ namespace Mono.CSharp this.parameters = parameters; } - public override MethodBuilder Define (TypeContainer parent) + public override void Define (TypeContainer parent) { // Disable reporting, parameters are resolved twice Report.DisableReporting (); @@ -1475,7 +1493,7 @@ namespace Mono.CSharp Report.EnableReporting (); } - return base.Define (parent); + base.Define (parent); } public override ParametersCompiled ParameterInfo { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/report.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/report.cs index 009007b0d5..5ae47d8a0d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/report.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/report.cs @@ -56,7 +56,9 @@ namespace Mono.CSharp { 3000, 3001, 3002, 3003, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3021, 3022, 3023, 3024, 3026, 3027, - 4014 + 4014, 4024, 4025, 4026, + 7035, 7080, 7081, 7082, 7095, + 8009, }; static HashSet AllWarningsHashSet; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/settings.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/settings.cs index dc097dbc60..3c7f13bdb1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/settings.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/settings.cs @@ -28,9 +28,10 @@ namespace Mono.CSharp { V_3 = 3, V_4 = 4, V_5 = 5, + V_6 = 6, Future = 100, - Default = LanguageVersion.V_5, + Default = LanguageVersion.Future, } public enum RuntimeVersion @@ -1136,11 +1137,13 @@ namespace Mono.CSharp { switch (value.ToLowerInvariant ()) { case "iso-1": + case "1": settings.Version = LanguageVersion.ISO_1; return ParseResult.Success; case "default": settings.Version = LanguageVersion.Default; return ParseResult.Success; + case "2": case "iso-2": settings.Version = LanguageVersion.ISO_2; return ParseResult.Success; @@ -1153,12 +1156,15 @@ namespace Mono.CSharp { case "5": settings.Version = LanguageVersion.V_5; return ParseResult.Success; + case "6": + settings.Version = LanguageVersion.V_6; + return ParseResult.Success; case "future": settings.Version = LanguageVersion.Future; return ParseResult.Success; } - report.Error (1617, "Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', `3', `4', `5', `Default' or `Future'", value); + report.Error (1617, "Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', Default or value in range 1 to 6", value); return ParseResult.Error; case "/codepage": 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 ed4160aa45..e7a360db67 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs @@ -101,7 +101,7 @@ namespace Mono.CSharp { return DoFlowAnalysis (fc); } - if (this is EmptyStatement) + if (this is EmptyStatement || loc.IsNull) return true; if (fc.UnreachableReported) @@ -688,11 +688,7 @@ namespace Mono.CSharp { infinite = true; } - base.Resolve (bc); - - Iterator.Resolve (bc); - - return true; + return base.Resolve (bc) && Iterator.Resolve (bc); } protected override bool DoFlowAnalysis (FlowAnalysisContext fc) @@ -859,11 +855,11 @@ namespace Mono.CSharp { var prev_loop = bc.EnclosingLoop; var prev_los = bc.EnclosingLoopOrSwitch; bc.EnclosingLoopOrSwitch = bc.EnclosingLoop = this; - Statement.Resolve (bc); + var ok = Statement.Resolve (bc); bc.EnclosingLoopOrSwitch = prev_los; bc.EnclosingLoop = prev_loop; - return true; + return ok; } // @@ -1202,15 +1198,16 @@ namespace Mono.CSharp { var async_type = storey.ReturnType; if (async_type == null && async_block.ReturnTypeInference != null) { - async_block.ReturnTypeInference.AddCommonTypeBoundAsync (expr.Type); + if (expr.Type.Kind == MemberKind.Void && !(this is ContextualReturn)) + ec.Report.Error (4029, loc, "Cannot return an expression of type `void'"); + else + async_block.ReturnTypeInference.AddCommonTypeBoundAsync (expr.Type); return true; } if (async_type.Kind == MemberKind.Void) { - ec.Report.Error (127, loc, - "`{0}': A return keyword must not be followed by any expression when method returns void", - ec.GetSignatureForError ()); - + ec.Report.Error (8030, loc, + "Anonymous function or lambda expression converted to a void returning delegate cannot return a value"); return false; } @@ -1218,18 +1215,14 @@ namespace Mono.CSharp { if (this is ContextualReturn) return true; - // Same error code as .NET but better error message if (async_block.DelegateType != null) { - ec.Report.Error (1997, loc, - "`{0}': A return keyword must not be followed by an expression when async delegate returns `Task'. Consider using `Task' return type", - async_block.DelegateType.GetSignatureForError ()); + ec.Report.Error (8031, loc, + "Async lambda expression or anonymous method converted to a `Task' cannot return a value. Consider returning `Task'"); } else { ec.Report.Error (1997, loc, "`{0}': A return keyword must not be followed by an expression when async method returns `Task'. Consider using `Task' return type", ec.GetSignatureForError ()); - } - return false; } @@ -1245,12 +1238,9 @@ namespace Mono.CSharp { } } } else { - // Same error code as .NET but better error message if (block_return_type.Kind == MemberKind.Void) { - ec.Report.Error (127, loc, - "`{0}': A return keyword must not be followed by any expression when delegate returns void", - am.GetSignatureForError ()); - + ec.Report.Error (8030, loc, + "Anonymous function or lambda expression converted to a void returning delegate cannot return a value"); return false; } @@ -1294,23 +1284,42 @@ namespace Mono.CSharp { protected override void DoEmit (EmitContext ec) { if (expr != null) { - expr.Emit (ec); var async_body = ec.CurrentAnonymousMethod as AsyncInitializer; if (async_body != null) { - var async_return = ((AsyncTaskStorey) async_body.Storey).HoistedReturn; + var storey = (AsyncTaskStorey)async_body.Storey; + Label exit_label = async_body.BodyEnd; + // // It's null for await without async - if (async_return != null) { - async_return.EmitAssign (ec); + // + if (storey.HoistedReturnValue != null) { + // + // Special case hoisted return value (happens in try/finally scenario) + // + if (ec.TryFinallyUnwind != null) { + if (storey.HoistedReturnValue is VariableReference) { + storey.HoistedReturnValue = ec.GetTemporaryField (storey.HoistedReturnValue.Type); + } + + exit_label = TryFinally.EmitRedirectedReturn (ec, async_body); + } + var async_return = (IAssignMethod)storey.HoistedReturnValue; + async_return.EmitAssign (ec, expr, false, false); ec.EmitEpilogue (); + } else { + expr.Emit (ec); + + if (ec.TryFinallyUnwind != null) + exit_label = TryFinally.EmitRedirectedReturn (ec, async_body); } - ec.Emit (OpCodes.Leave, async_body.BodyEnd); + ec.Emit (OpCodes.Leave, exit_label); return; } + expr.Emit (ec); ec.EmitEpilogue (); if (unwind_protect || ec.EmitAccurateDebugInfo) @@ -1431,8 +1440,6 @@ namespace Mono.CSharp { } else { label.AddGotoReference (rc, true); } - - try_finally = null; } else { label.AddGotoReference (rc, false); } @@ -1451,8 +1458,27 @@ namespace Mono.CSharp { throw new InternalErrorException ("goto emitted before target resolved"); Label l = label.LabelTarget (ec); + + if (ec.TryFinallyUnwind != null && IsLeavingFinally (label.Block)) { + var async_body = (AsyncInitializer) ec.CurrentAnonymousMethod; + l = TryFinally.EmitRedirectedJump (ec, async_body, l, label.Block); + } + ec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, l); } + + bool IsLeavingFinally (Block labelBlock) + { + var b = try_finally.Statement as Block; + while (b != null) { + if (b == labelBlock) + return true; + + b = b.Parent; + } + + return false; + } public override object Accept (StructuralVisitor visitor) { @@ -1791,9 +1817,20 @@ namespace Mono.CSharp { protected override void DoEmit (EmitContext ec) { - if (expr == null) - ec.Emit (OpCodes.Rethrow); - else { + if (expr == null) { + var atv = ec.AsyncThrowVariable; + if (atv != null) { + if (atv.HoistedVariant != null) { + atv.HoistedVariant.Emit (ec); + } else { + atv.Emit (ec); + } + + ec.Emit (OpCodes.Throw); + } else { + ec.Emit (OpCodes.Rethrow); + } + } else { expr.Emit (ec); ec.Emit (OpCodes.Throw); @@ -1842,7 +1879,14 @@ namespace Mono.CSharp { protected override void DoEmit (EmitContext ec) { - ec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, ec.LoopEnd); + var l = ec.LoopEnd; + + if (ec.TryFinallyUnwind != null) { + var async_body = (AsyncInitializer) ec.CurrentAnonymousMethod; + l = TryFinally.EmitRedirectedJump (ec, async_body, l, enclosing_loop.Statement as Block); + } + + ec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, l); } protected override bool DoFlowAnalysis (FlowAnalysisContext fc) @@ -1883,7 +1927,14 @@ namespace Mono.CSharp { protected override void DoEmit (EmitContext ec) { - ec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, ec.LoopBegin); + var l = ec.LoopBegin; + + if (ec.TryFinallyUnwind != null) { + var async_body = (AsyncInitializer) ec.CurrentAnonymousMethod; + l = TryFinally.EmitRedirectedJump (ec, async_body, l, enclosing_loop.Statement as Block); + } + + ec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, l); } protected override bool DoResolve (BlockContext bc) @@ -2185,13 +2236,13 @@ namespace Mono.CSharp { { li.CreateBuilder (ec); - if (Initializer != null) + if (Initializer != null && !IsUnreachable) ((ExpressionStatement) Initializer).EmitStatement (ec); if (declarators != null) { foreach (var d in declarators) { d.Variable.CreateBuilder (ec); - if (d.Initializer != null) { + if (d.Initializer != null && !IsUnreachable) { ec.Mark (d.Variable.Location); ((ExpressionStatement) d.Initializer).EmitStatement (ec); } @@ -2521,6 +2572,10 @@ namespace Mono.CSharp { public void EmitAddressOf (EmitContext ec) { + // TODO: Need something better for temporary variables + if ((flags & Flags.CompilerGenerated) != 0) + CreateBuilder (ec); + ec.Emit (OpCodes.Ldloca, builder); } @@ -2622,7 +2677,8 @@ namespace Mono.CSharp { FinallyBlock = 1 << 14, CatchBlock = 1 << 15, Iterator = 1 << 20, - NoFlowAnalysis = 1 << 21 + NoFlowAnalysis = 1 << 21, + InitializationEmitted = 1 << 22 } public Block Parent; @@ -2922,7 +2978,7 @@ namespace Mono.CSharp { end_unreachable = s.FlowAnalysis (fc); if (s.IsUnreachable) { - statements[startIndex] = new EmptyStatement (s.loc); + statements [startIndex] = RewriteUnreachableStatement (s); continue; } @@ -2949,7 +3005,7 @@ namespace Mono.CSharp { if (s.IsUnreachable) { s.FlowAnalysis (fc); - statements[startIndex] = new EmptyStatement (s.loc); + statements [startIndex] = RewriteUnreachableStatement (s); } } } @@ -2964,6 +3020,24 @@ namespace Mono.CSharp { return !Explicit.HasReachableClosingBrace; } + static Statement RewriteUnreachableStatement (Statement s) + { + // LAMESPEC: It's not clear whether declararion statement should be part of reachability + // analysis. Even csc report unreachable warning for it but it's actually used hence + // we try to emulate this behaviour + // + // Consider: + // goto L; + // int v; + // L: + // v = 1; + + if (s is BlockVariable) + return s; + + return new EmptyStatement (s.loc); + } + public void ScanGotoJump (Statement label) { int i; @@ -3121,8 +3195,11 @@ namespace Mono.CSharp { return am_storey; } - public override void Emit (EmitContext ec) + public void EmitScopeInitialization (EmitContext ec) { + if ((flags & Flags.InitializationEmitted) != 0) + return; + if (am_storey != null) { DefineStoreyContainer (ec, am_storey); am_storey.EmitStoreyInstantiation (ec, this); @@ -3131,6 +3208,13 @@ namespace Mono.CSharp { if (scope_initializers != null) EmitScopeInitializers (ec); + flags |= Flags.InitializationEmitted; + } + + public override void Emit (EmitContext ec) + { + EmitScopeInitialization (ec); + if (ec.EmitAccurateDebugInfo && !IsCompilerGenerated && ec.Mark (StartLocation)) { ec.Emit (OpCodes.Nop); } @@ -3209,8 +3293,9 @@ namespace Mono.CSharp { for (ExplicitBlock b = ref_block; b.AnonymousMethodStorey != storey; b = b.Parent.Explicit) { ParametersBlock pb; + AnonymousMethodStorey b_storey = b.AnonymousMethodStorey; - if (b.AnonymousMethodStorey != null) { + if (b_storey != null) { // // Don't add storey cross reference for `this' when the storey ends up not // beeing attached to any parent @@ -3229,21 +3314,23 @@ namespace Mono.CSharp { b.AnonymousMethodStorey.AddCapturedThisField (ec, parent); break; } - } - b.AnonymousMethodStorey.AddParentStoreyReference (ec, storey); - b.AnonymousMethodStorey.HoistedThis = storey.HoistedThis; + } // // Stop propagation inside same top block // - if (b.ParametersBlock == ParametersBlock.Original) + if (b.ParametersBlock == ParametersBlock.Original) { + b_storey.AddParentStoreyReference (ec, storey); +// b_storey.HoistedThis = storey.HoistedThis; break; + } - b = b.ParametersBlock; + b = pb = b.ParametersBlock; + } else { + pb = b as ParametersBlock; } - pb = b as ParametersBlock; if (pb != null && pb.StateMachine != null) { if (pb.StateMachine == storey) break; @@ -3268,8 +3355,14 @@ namespace Mono.CSharp { pb.StateMachine.AddParentStoreyReference (ec, storey); } - - b.HasCapturedVariable = true; + + // + // Add parent storey reference only when this is not captured directly + // + if (b_storey != null) { + b_storey.AddParentStoreyReference (ec, storey); + b_storey.HoistedThis = storey.HoistedThis; + } } } } @@ -3717,16 +3810,14 @@ namespace Mono.CSharp { var label = value as LabeledStatement; Block b = block; if (label != null) { - do { - if (label.Block == b) - return label; - b = b.Parent; - } while (b != null); + if (IsLabelVisible (label, b)) + return label; + } else { List list = (List) value; for (int i = 0; i < list.Count; ++i) { label = list[i]; - if (label.Block == b) + if (IsLabelVisible (label, b)) return label; } } @@ -3734,6 +3825,17 @@ namespace Mono.CSharp { return null; } + static bool IsLabelVisible (LabeledStatement label, Block b) + { + do { + if (label.Block == b) + return true; + b = b.Parent; + } while (b != null); + + return false; + } + public ParameterInfo GetParameterInfo (Parameter p) { for (int i = 0; i < parameters.Count; ++i) { @@ -5449,10 +5551,10 @@ namespace Mono.CSharp { EmitTryBodyPrepare (ec); EmitTryBody (ec); - ec.BeginFinallyBlock (); + bool beginFinally = EmitBeginFinallyBlock (ec); Label start_finally = ec.DefineLabel (); - if (resume_points != null) { + if (resume_points != null && beginFinally) { var state_machine = (StateMachineInitializer) ec.CurrentAnonymousMethod; ec.Emit (OpCodes.Ldloc, state_machine.SkipFinally); @@ -5477,7 +5579,8 @@ namespace Mono.CSharp { EmitFinallyBody (ec); } - ec.EndExceptionBlock (); + if (beginFinally) + ec.EndExceptionBlock (); } public override void EmitForDispose (EmitContext ec, LocalBuilder pc, Label end, bool have_dispatcher) @@ -5551,6 +5654,12 @@ namespace Mono.CSharp { return res; } + protected virtual bool EmitBeginFinallyBlock (EmitContext ec) + { + ec.BeginFinallyBlock (); + return true; + } + public override Reachability MarkReachable (Reachability rc) { base.MarkReachable (rc); @@ -6255,12 +6364,76 @@ namespace Mono.CSharp { public class Catch : Statement { + class FilterStatement : Statement + { + readonly Catch ctch; + + public FilterStatement (Catch ctch) + { + this.ctch = ctch; + } + + protected override void CloneTo (CloneContext clonectx, Statement target) + { + } + + protected override void DoEmit (EmitContext ec) + { + if (ctch.li != null) { + if (ctch.hoisted_temp != null) + ctch.hoisted_temp.Emit (ec); + else + ctch.li.Emit (ec); + } + + var expr_start = ec.DefineLabel (); + var end = ec.DefineLabel (); + + ec.Emit (OpCodes.Brtrue_S, expr_start); + ec.EmitInt (0); + ec.Emit (OpCodes.Br, end); + ec.MarkLabel (expr_start); + + ctch.Filter.Emit (ec); + + ec.MarkLabel (end); + ec.Emit (OpCodes.Endfilter); + ec.BeginFilterHandler (); + ec.Emit (OpCodes.Pop); + } + + protected override bool DoFlowAnalysis (FlowAnalysisContext fc) + { + ctch.Filter.FlowAnalysis (fc); + return true; + } + + public override bool Resolve (BlockContext bc) + { + ctch.Filter = ctch.Filter.Resolve (bc); + + if (ctch.Filter != null) { + if (ctch.Filter.ContainsEmitWithAwait ()) { + bc.Report.Error (7094, ctch.Filter.Location, "The `await' operator cannot be used in the filter expression of a catch clause"); + } + + var c = ctch.Filter as Constant; + if (c != null && !c.IsDefaultValue) { + bc.Report.Warning (7095, 1, ctch.Filter.Location, "Exception filter expression is a constant"); + } + } + + return true; + } + } + ExplicitBlock block; LocalVariable li; FullNamedExpression type_expr; CompilerAssign assign; TypeSpec type; - + LocalTemporary hoisted_temp; + public Catch (ExplicitBlock block, Location loc) { this.block = block; @@ -6281,6 +6454,10 @@ namespace Mono.CSharp { } } + public Expression Filter { + get; set; + } + public bool IsGeneral { get { return type_expr == null; @@ -6309,46 +6486,77 @@ namespace Mono.CSharp { protected override void DoEmit (EmitContext ec) { + if (Filter != null) { + ec.BeginExceptionFilterBlock (); + ec.Emit (OpCodes.Isinst, IsGeneral ? ec.BuiltinTypes.Object : CatchType); + + if (li != null) + EmitCatchVariableStore (ec); + + if (Block.HasAwait) { + Block.EmitScopeInitialization (ec); + } else { + Block.Emit (ec); + } + + return; + } + if (IsGeneral) ec.BeginCatchBlock (ec.BuiltinTypes.Object); else ec.BeginCatchBlock (CatchType); if (li != null) { - li.CreateBuilder (ec); - - // - // Special case hoisted catch variable, we have to use a temporary variable - // to pass via anonymous storey initialization with the value still on top - // of the stack - // - if (li.HoistedVariant != null) { - LocalTemporary lt = new LocalTemporary (li.Type); - lt.Store (ec); - - // switch to assigning from the temporary variable and not from top of the stack - assign.UpdateSource (lt); - } + EmitCatchVariableStore (ec); } else { ec.Emit (OpCodes.Pop); } - Block.Emit (ec); + if (!Block.HasAwait) + Block.Emit (ec); } - public override bool Resolve (BlockContext ec) + void EmitCatchVariableStore (EmitContext ec) { - using (ec.Set (ResolveContext.Options.CatchScope)) { - if (type_expr != null) { - type = type_expr.ResolveAsType (ec); + li.CreateBuilder (ec); + + // + // Special case hoisted catch variable, we have to use a temporary variable + // to pass via anonymous storey initialization with the value still on top + // of the stack + // + if (li.HoistedVariant != null) { + hoisted_temp = new LocalTemporary (li.Type); + hoisted_temp.Store (ec); + + // switch to assignment from temporary variable and not from top of the stack + assign.UpdateSource (hoisted_temp); + } + } + + public override bool Resolve (BlockContext bc) + { + using (bc.Set (ResolveContext.Options.CatchScope)) { + if (type_expr == null) { + if (CreateExceptionVariable (bc.Module.Compiler.BuiltinTypes.Object)) { + Expression source = new EmptyExpression (li.Type); + assign = new CompilerAssign (new LocalVariableReference (li, Location.Null), source, Location.Null); + Block.AddScopeStatement (new StatementExpression (assign, Location.Null)); + } + } else { + type = type_expr.ResolveAsType (bc); if (type == null) return false; - if (type.BuiltinType != BuiltinTypeSpec.Type.Exception && !TypeSpec.IsBaseClass (type, ec.BuiltinTypes.Exception, false)) { - ec.Report.Error (155, loc, "The type caught or thrown must be derived from System.Exception"); + if (li == null) + CreateExceptionVariable (type); + + if (type.BuiltinType != BuiltinTypeSpec.Type.Exception && !TypeSpec.IsBaseClass (type, bc.BuiltinTypes.Exception, false)) { + bc.Report.Error (155, loc, "The type caught or thrown must be derived from System.Exception"); } else if (li != null) { li.Type = type; - li.PrepareAssignmentAnalysis (ec); + li.PrepareAssignmentAnalysis (bc); // source variable is at the top of the stack Expression source = new EmptyExpression (li.Type); @@ -6363,14 +6571,31 @@ namespace Mono.CSharp { } } + if (Filter != null) { + Block.AddScopeStatement (new FilterStatement (this)); + } + Block.SetCatchBlock (); - return Block.Resolve (ec); + return Block.Resolve (bc); } } + bool CreateExceptionVariable (TypeSpec type) + { + if (!Block.HasAwait) + return false; + + // TODO: Scan the block for rethrow expression + //if (!Block.HasRethrow) + // return; + + li = LocalVariable.CreateCompilerGenerated (type, block, Location.Null); + return true; + } + protected override bool DoFlowAnalysis (FlowAnalysisContext fc) { - if (li != null) { + if (li != null && !li.IsCompilerGenerated) { fc.SetVariableAssigned (li.VariableInfo, true); } @@ -6381,6 +6606,10 @@ namespace Mono.CSharp { { base.MarkReachable (rc); + var c = Filter as Constant; + if (c != null && c.IsDefaultValue) + return Reachability.CreateUnreachable (); + return block.MarkReachable (rc); } @@ -6391,6 +6620,9 @@ namespace Mono.CSharp { if (type_expr != null) target.type_expr = (FullNamedExpression) type_expr.Clone (clonectx); + if (Filter != null) + target.Filter = Filter.Clone (clonectx); + target.block = (ExplicitBlock) clonectx.LookupBlock (block); } } @@ -6399,6 +6631,8 @@ namespace Mono.CSharp { { ExplicitBlock fini; List try_exit_dat; + List int CompareVersions(ITextSourceVersion newVersion) { + Debug.Assert(rwLock.IsReadLockHeld || rwLock.IsUpgradeableReadLockHeld || rwLock.IsWriteLockHeld); if (currentVersion != null && newVersion != null && currentVersion.BelongsToSameDocumentAs(newVersion)) return currentVersion.CompareAge(newVersion); else @@ -137,7 +149,8 @@ namespace ICSharpCode.SharpDevelop.Parser #region Expire Cache + GetExistingUnresolvedFile + GetCachedParseInformation public void ExpireCache() { - lock (this) { + rwLock.EnterWriteLock(); + try { if (PrimaryProject == null) { parserService.RemoveEntry(this); } else { @@ -148,12 +161,15 @@ namespace ICSharpCode.SharpDevelop.Parser } // force re-parse on next ParseFile() call even if unchanged this.currentVersion = null; + } finally { + rwLock.ExitWriteLock(); } } public IUnresolvedFile GetExistingUnresolvedFile(ITextSourceVersion version, IProject parentProject) { - lock (this) { + rwLock.EnterReadLock(); + try { if (version != null && CompareVersions(version) != 0) { return null; } @@ -161,12 +177,15 @@ namespace ICSharpCode.SharpDevelop.Parser if (index < 0) return null; return entries[index].UnresolvedFile; + } finally { + rwLock.ExitReadLock(); } } public ParseInformation GetCachedParseInformation(ITextSourceVersion version, IProject parentProject) { - lock (this) { + rwLock.EnterReadLock(); + try { if (version != null && CompareVersions(version) != 0) { return null; } @@ -174,6 +193,8 @@ namespace ICSharpCode.SharpDevelop.Parser if (index < 0) return null; return entries[index].CachedParseInformation; + } finally { + rwLock.ExitReadLock(); } } #endregion @@ -218,7 +239,8 @@ namespace ICSharpCode.SharpDevelop.Parser } ProjectEntry result; - lock (this) { + rwLock.EnterUpgradeableReadLock(); + try { int index = FindIndexForProject(parentProject); int versionComparison = CompareVersions(fileContent.Version); if (versionComparison > 0 || index < 0) { @@ -253,24 +275,32 @@ namespace ICSharpCode.SharpDevelop.Parser } // Only if all parse runs succeeded, register the parse information. - currentVersion = fileContent.Version; - for (int i = 0; i < entries.Count; i++) { - if (fullParseInformationRequested || (entries[i].CachedParseInformation != null && results[i].NewParseInformation.IsFullParseInformation)) - entries[i] = new ProjectEntry(entries[i].Project, results[i].NewUnresolvedFile, results[i].NewParseInformation); - else - entries[i] = new ProjectEntry(entries[i].Project, results[i].NewUnresolvedFile, null); - if (entries[i].Project != null) - entries[i].Project.OnParseInformationUpdated(results[i]); - parserService.RaiseParseInformationUpdated(results[i]); + rwLock.EnterWriteLock(); + try { + currentVersion = fileContent.Version; + for (int i = 0; i < entries.Count; i++) { + if (fullParseInformationRequested || (entries[i].CachedParseInformation != null && results[i].NewParseInformation.IsFullParseInformation)) + entries[i] = new ProjectEntry(entries[i].Project, results[i].NewUnresolvedFile, results[i].NewParseInformation); + else + entries[i] = new ProjectEntry(entries[i].Project, results[i].NewUnresolvedFile, null); + if (entries[i].Project != null) + entries[i].Project.OnParseInformationUpdated(results[i]); + parserService.RaiseParseInformationUpdated(results[i]); + } + result = entries[index]; + } finally { + rwLock.ExitWriteLock(); } - result = entries[index]; - } // exit lock + } finally { + rwLock.ExitUpgradeableReadLock(); + } parserService.RegisterForCacheExpiry(this); return result; } ParseInformation ParseWithExceptionHandling(ITextSource fileContent, bool fullParseInformationRequested, IProject project, CancellationToken cancellationToken) { + Debug.Assert(rwLock.IsUpgradeableReadLockHeld && !rwLock.IsWriteLockHeld); #if DEBUG if (Debugger.IsAttached) return parser.Parse(fileName, fileContent, fullParseInformationRequested, project, cancellationToken); @@ -285,6 +315,8 @@ namespace ICSharpCode.SharpDevelop.Parser #endregion #region ParseAsync + /// lock object for protecting the runningAsyncParse* fields + object runningAsyncParseLock = new object(); Task runningAsyncParseTask; ITextSourceVersion runningAsyncParseFileContentVersion; IProject runningAsyncParseProject; @@ -324,19 +356,24 @@ namespace ICSharpCode.SharpDevelop.Parser } } Task task; - lock (this) { + lock (runningAsyncParseLock) { if (fileContent != null) { // Optimization: // don't start a background task if fileContent was specified and up-to-date parse info is available - int index = FindIndexForProject(parentProject); - int versionComparison = CompareVersions(fileContent.Version); - if (versionComparison == 0 && index >= 0) { - // Ensure we have parse info for the specified project (entry.UnresolvedFile is null for newly registered projects) - // If full parse info is requested, ensure we have full parse info. - if (entries[index].UnresolvedFile != null && !(requestFullParseInformation && entries[index].CachedParseInformation == null)) { - // We already have the requested version parsed, just return it: - return Task.FromResult(entries[index]); + rwLock.EnterReadLock(); + try { + int index = FindIndexForProject(parentProject); + int versionComparison = CompareVersions(fileContent.Version); + if (versionComparison == 0 && index >= 0) { + // Ensure we have parse info for the specified project (entry.UnresolvedFile is null for newly registered projects) + // If full parse info is requested, ensure we have full parse info. + if (entries[index].UnresolvedFile != null && !(requestFullParseInformation && entries[index].CachedParseInformation == null)) { + // We already have the requested version parsed, just return it: + return Task.FromResult(entries[index]); + } } + } finally { + rwLock.ExitReadLock(); } // Optimization: // if an equivalent task is already running, return that one instead @@ -356,7 +393,7 @@ namespace ICSharpCode.SharpDevelop.Parser } return DoParse(fileContent, parentProject, requestFullParseInformation, cancellationToken); } finally { - lock (this) { + lock (runningAsyncParseLock) { runningAsyncParseTask = null; runningAsyncParseFileContentVersion = null; runningAsyncParseProject = null; @@ -383,7 +420,8 @@ namespace ICSharpCode.SharpDevelop.Parser throw new ArgumentNullException("unresolvedFile"); FreezableHelper.Freeze(unresolvedFile); var newParseInfo = new ParseInformation(unresolvedFile, null, false); - lock (this) { + rwLock.EnterWriteLock(); + try { int index = FindIndexForProject(project); if (index >= 0) { currentVersion = null; @@ -392,6 +430,8 @@ namespace ICSharpCode.SharpDevelop.Parser project.OnParseInformationUpdated(args); parserService.RaiseParseInformationUpdated(args); } + } finally { + rwLock.ExitWriteLock(); } } } diff --git a/src/Main/SharpDevelop/Workbench/FileService.cs b/src/Main/SharpDevelop/Workbench/FileService.cs index 41a18fb0ff..36816e36a4 100644 --- a/src/Main/SharpDevelop/Workbench/FileService.cs +++ b/src/Main/SharpDevelop/Workbench/FileService.cs @@ -580,20 +580,12 @@ namespace ICSharpCode.SharpDevelop.Workbench return false; if (!eargs.OperationAlreadyDone) { try { - if (isDirectory && Directory.Exists(oldName)) { - - if (Directory.Exists(newName)) { - MessageService.ShowMessage(StringParser.Parse("${res:Gui.ProjectBrowser.FileInUseError}")); - return false; + if (FileHelpers.CheckRenameOrReplacePossible(eargs)) { + if (isDirectory) { + Directory.Move(oldName, newName); + } else { + File.Move(oldName, newName); } - Directory.Move(oldName, newName); - - } else if (File.Exists(oldName)) { - if (File.Exists(newName)) { - MessageService.ShowMessage(StringParser.Parse("${res:Gui.ProjectBrowser.FileInUseError}")); - return false; - } - File.Move(oldName, newName); } } catch (Exception e) { if (isDirectory) { @@ -624,20 +616,12 @@ namespace ICSharpCode.SharpDevelop.Workbench return false; if (!eargs.OperationAlreadyDone) { try { - if (isDirectory && Directory.Exists(oldName)) { - - if (!overwrite && Directory.Exists(newName)) { - MessageService.ShowMessage(StringParser.Parse("${res:Gui.ProjectBrowser.FileInUseError}")); - return false; - } - FileUtility.DeepCopy(oldName, newName, overwrite); - - } else if (File.Exists(oldName)) { - if (!overwrite && File.Exists(newName)) { - MessageService.ShowMessage(StringParser.Parse("${res:Gui.ProjectBrowser.FileInUseError}")); - return false; + if (FileHelpers.CheckRenameOrReplacePossible(eargs, overwrite)) { + if (isDirectory) { + FileUtility.DeepCopy(oldName, newName, overwrite); + } else { + File.Copy(oldName, newName, overwrite); } - File.Copy(oldName, newName, overwrite); } } catch (Exception e) { if (isDirectory) { diff --git a/src/Main/SharpDevelop/app.template.config b/src/Main/SharpDevelop/app.template.config index 5896802746..40a0be1c0b 100644 --- a/src/Main/SharpDevelop/app.template.config +++ b/src/Main/SharpDevelop/app.template.config @@ -43,8 +43,8 @@ - - + + diff --git a/src/Setup/Files.wxs b/src/Setup/Files.wxs index c9aaef23c8..d23a95d9fc 100644 --- a/src/Setup/Files.wxs +++ b/src/Setup/Files.wxs @@ -1342,6 +1342,9 @@ + + + diff --git a/src/Setup/Setup.wxs b/src/Setup/Setup.wxs index 1633ffb543..d32bd32c2c 100644 --- a/src/Setup/Setup.wxs +++ b/src/Setup/Setup.wxs @@ -436,6 +436,7 @@ + diff --git a/src/Tools/StressTest/StressTest.sln b/src/Tools/StressTest/StressTest.sln index 390728c9f4..5f54b0427c 100644 --- a/src/Tools/StressTest/StressTest.sln +++ b/src/Tools/StressTest/StressTest.sln @@ -1,7 +1,9 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -# SharpDevelop 4.3 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +# SharpDevelop 5.0 +VisualStudioVersion = 12.0.20827.3 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StressTest", "StressTest\StressTest.csproj", "{30D10654-A5F5-4AC5-A370-E6DD4D0FAC50}" EndProject Global @@ -10,9 +12,9 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {30D10654-A5F5-4AC5-A370-E6DD4D0FAC50}.Debug|x86.Build.0 = Debug|x86 {30D10654-A5F5-4AC5-A370-E6DD4D0FAC50}.Debug|x86.ActiveCfg = Debug|x86 - {30D10654-A5F5-4AC5-A370-E6DD4D0FAC50}.Release|x86.Build.0 = Release|x86 + {30D10654-A5F5-4AC5-A370-E6DD4D0FAC50}.Debug|x86.Build.0 = Debug|x86 {30D10654-A5F5-4AC5-A370-E6DD4D0FAC50}.Release|x86.ActiveCfg = Release|x86 + {30D10654-A5F5-4AC5-A370-E6DD4D0FAC50}.Release|x86.Build.0 = Release|x86 EndGlobalSection EndGlobal diff --git a/src/Tools/StressTest/StressTest/StressTest.csproj b/src/Tools/StressTest/StressTest/StressTest.csproj index d712b438de..090ba83d63 100644 --- a/src/Tools/StressTest/StressTest/StressTest.csproj +++ b/src/Tools/StressTest/StressTest/StressTest.csproj @@ -98,9 +98,6 @@ - - - /addindir:"$(MsBuildProjectDirectory)\$(OutputPath)" diff --git a/src/Tools/StressTest/StressTest/UserControl.xaml.cs b/src/Tools/StressTest/StressTest/UserControl.xaml.cs index 7946890d57..680d165bcb 100644 --- a/src/Tools/StressTest/StressTest/UserControl.xaml.cs +++ b/src/Tools/StressTest/StressTest/UserControl.xaml.cs @@ -35,6 +35,7 @@ using ICSharpCode.Core; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Workbench; namespace StressTest {