diff --git a/data/resources/StringResources.de.resx b/data/resources/StringResources.de.resx
index aa4ea7305c..bc5f5117f2 100644
--- a/data/resources/StringResources.de.resx
+++ b/data/resources/StringResources.de.resx
@@ -4033,6 +4033,12 @@ Grund: Der Wert zu dem zurückgesetzt werden soll ist ungültig weil sich eine a
Das öffentliche Schlüsseltoken der Assembly
+
+ Assembly referenzieren
+
+
+ Wenn auf false gesetzt, gibt diese Referenz nur eine Build-Reihenfolgenabhängigkeit an und fügt keine Assembly-Referenz zum Projekt hinzu.
+
Festgelegte Version
@@ -4979,6 +4985,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
Kopiere Wert in Zwischenablage
+
+ Name
+
Nicht-öffentliche Mitglieder
@@ -5000,6 +5009,12 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
Statische Mitglieder
+
+ Typ
+
+
+ Wert
+
Speicher
@@ -5375,6 +5390,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
Öffne beinhaltenden Ordner im Explorer
+
+ Kommandozeile hier öffnen
+
Alle Knoten einklappen
@@ -5510,6 +5528,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
Projekt sta&rten
+
+ Projekt ohne Debugger starten
+
Als St&artprojekt festlegen
diff --git a/data/resources/StringResources.fr.resx b/data/resources/StringResources.fr.resx
index 2f0e2f9e55..2ea1fca7a5 100644
--- a/data/resources/StringResources.fr.resx
+++ b/data/resources/StringResources.fr.resx
@@ -1862,6 +1862,9 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?
Pas-Ã -pas en cours
+
+ Décompiler le code sans symboles
+
Utiliser 'Seulement mon code' pour le pas-Ã -pas
@@ -3379,6 +3382,9 @@ Configurez le chemin vers NAnt dans les options de SharpDevelop.
L'élément sélectionné n'est ni une classe ni un membre surchargeable: aucun symbole dérivé n'est disponible.
+
+ Impossible de trouver la définition du type sous le curseur.
+
Envoyer cette ligne vers la console Ruby
@@ -3774,6 +3780,9 @@ Toutes les modifications seront perdues.
Impossible de charger le concepteur. Vérifier les erreurs de syntaxe du code source et si toutes les références sont disponibles.
+
+ Une ou plusieurs erreurs sont survenues en essayant de vider le contenu du concepteur. C'est peut-être une exception non gérée dans un composant tiers sur le formulaire ou le contrôle.
+
Ne peut charger la librairie contenant la barre de composants.
Les composants Windows Form ne seront pas accessibles, veuillez configurer manuellement la barre de composants (clic droit sur une catégorie de la barre de menu -> Paramétrer la barre de menu).
@@ -3988,6 +3997,12 @@ Utilisez seulement des lettres, chiffres, espace, '.' ou '_'.
La culture supportée par la référence
+
+ Embarquer les types interop
+
+
+ Précise si les type d'interop COM définis dans l'assembly référencé sont embarqués dans l'assembly cible.
+
Copie locale
@@ -4006,6 +4021,12 @@ Utilisez seulement des lettres, chiffres, espace, '.' ou '_'.
Le jeton de clé publique
+
+ Référencer l'assembly
+
+
+ Si positionné à Faux, cette référence spécifie uniquement une dépendance dans l'ordre de la construction sans référencer l'assembly.
+
Version Spécifique
@@ -4051,6 +4072,9 @@ Utilisez seulement des lettres, chiffres, espace, '.' ou '_'.
Chargement de ${Filename}...
+
+ Fermer la solution
+
Laisser la solution précédente ouverte
@@ -4084,6 +4108,14 @@ Utilisez seulement des lettres, chiffres, espace, '.' ou '_'.
Mettre à jour le projet
+
+ Le projet '${ProjectName}' cible MSBuild ${OldToolsVersion}, mais cette version n'est pas installée.
+Voulez vous mettre à jour le projet vers MSBuild ${NewToolsVersion}?
+Le projet ne sera pas ouvert sans cette mise à jour.
+
+
+ Mettre à jour vers MSBuild ${NewToolsVersion}
+
Cette solution a été créée par une précédente version de SharpDevelop.
La mettre à jour vous permet d'utiliser de nouveaux languages, ou les évolutions du framework.
@@ -4165,7 +4197,7 @@ Allez dans 'Outils/Options->Style Visuel pour changer l'ambiance actuelle.Processus de travail {0} ASP.NET/IIS(Express) introuvable.
- Pas d'URL du projet spécifiée ou de programme externe. Vérifier le serveur web dans Propriétés du projet - Onglet debug.
+ Aucun programme externe ni URL spécifié. Vérifier le serveur web dans Propriétés du projet - onglet Web.
Port:
@@ -4783,7 +4815,7 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace
Vous ne pouvez pas changer pour une fonction sans symboles.
- Les options de décompilation du code doivent être activés pour aller vers une fonction sans symboles.
+ Impossible de basculer vers une méthode sans symboles de déboguage.Recompilez avec les symboles ou activer l'option de décompilation du code sans symboles.
[Méthodes externes]
@@ -4941,6 +4973,9 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace
Copier la valeur dans le presse-papier
+
+ Nom
+
Membres non publics
@@ -4962,6 +4997,12 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace
Membres statiques
+
+ Type
+
+
+ Valeur
+
Mémoire
@@ -5001,12 +5042,18 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace
Adresse
+
+ (dynamique)
+
Aucun symbole n'est chargé.
Symboles chargés.
+
+ (en mémoire)
+
Ordre
@@ -5331,6 +5378,9 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace
Ouvrir le répertoire dans l'explorateur
+
+ Ouvrir une invite de commande ici
+
Réduire tous les noeuds
@@ -5466,6 +5516,9 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace
Lance&r projet
+
+ Exécuter ce projet sans débogueur
+
Définir comme projet de dém&arrage
diff --git a/data/resources/StringResources.nl.resx b/data/resources/StringResources.nl.resx
index 4ccfb33a77..5660fe197f 100644
--- a/data/resources/StringResources.nl.resx
+++ b/data/resources/StringResources.nl.resx
@@ -4023,6 +4023,12 @@ Alleen letters, getallen, spatie, '.' of '_' zijn toegestaan.
De openbare sleutel token
+
+ Referentie assembly
+
+
+ Indien false, specificeert deze referentie enkel een bouw-volgorde afhankelijkheid en heeft niet tot gevolg dat de assembly gerefereerd wordt.
+
Specifieke versie
@@ -4969,6 +4975,9 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie
Kopieer waarde naar klembord
+
+ Naam
+
Niet openbare leden
@@ -4990,6 +4999,12 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie
Statische leden
+
+ Type
+
+
+ Waarde
+
Geheugen
@@ -5365,6 +5380,9 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie
Open de document bevattende map in de Explorer
+
+ Open hier de commando prompt
+
Alle knooppunten invouwen
@@ -5500,6 +5518,9 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie
P&roject starten
+
+ Project uitvoeren zonder foutopsporing
+
Als startproject instellen.
diff --git a/data/resources/StringResources.resx b/data/resources/StringResources.resx
index 363b3b0163..f0096690f8 100644
--- a/data/resources/StringResources.resx
+++ b/data/resources/StringResources.resx
@@ -5270,6 +5270,9 @@ Stop/terminate the debuggee.
Copy value to clipboard
Item in variable's context menu
+
+ Name
+
Non-Public members
@@ -5297,6 +5300,12 @@ Shows the full callstack of the error.
Static members
+
+ Type
+
+
+ Value
+
Memory
@@ -5686,6 +5695,9 @@ Removed the end part of the original message ", reason '${Message}'" since this
Open containing folder in Explorer
String for the editor tab context menu that will open the directory in which a documents file is contained in Windows Explorer.
+
+ Open command prompt here
+
Collapse all nodes
@@ -5830,6 +5842,9 @@ Removed the end part of the original message ", reason '${Message}'" since this
&Run Project
+
+ Run Project without Debugger
+
Set as St&artUp Project
diff --git a/data/templates/packages/Modernizr.1.7.nupkg b/data/templates/packages/Modernizr.1.7.nupkg
deleted file mode 100644
index df76835723..0000000000
Binary files a/data/templates/packages/Modernizr.1.7.nupkg and /dev/null differ
diff --git a/data/templates/packages/Modernizr.2.5.3.nupkg b/data/templates/packages/Modernizr.2.5.3.nupkg
new file mode 100644
index 0000000000..98ade6d191
Binary files /dev/null and b/data/templates/packages/Modernizr.2.5.3.nupkg differ
diff --git a/data/templates/packages/jQuery.1.6.1.nupkg b/data/templates/packages/jQuery.1.6.1.nupkg
deleted file mode 100644
index 7591b33c89..0000000000
Binary files a/data/templates/packages/jQuery.1.6.1.nupkg and /dev/null differ
diff --git a/data/templates/packages/jQuery.1.7.2.nupkg b/data/templates/packages/jQuery.1.7.2.nupkg
new file mode 100644
index 0000000000..033bae95d0
Binary files /dev/null and b/data/templates/packages/jQuery.1.7.2.nupkg differ
diff --git a/data/templates/project/CSharp/MvcRazorProject.xpt b/data/templates/project/CSharp/MvcRazorProject.xpt
index 37e610e87b..d517855fe8 100644
--- a/data/templates/project/CSharp/MvcRazorProject.xpt
+++ b/data/templates/project/CSharp/MvcRazorProject.xpt
@@ -273,8 +273,8 @@ Aliquam suscipit tellus vel nunc elementum fringilla.
@ViewBag.Title
-
-
+
+
@@ -300,8 +300,8 @@ Aliquam suscipit tellus vel nunc elementum fringilla.
-
-
+
+
]]>
diff --git a/data/templates/project/CSharp/MvcWebProject.xpt b/data/templates/project/CSharp/MvcWebProject.xpt
index bd14354e5e..93d614f7d1 100644
--- a/data/templates/project/CSharp/MvcWebProject.xpt
+++ b/data/templates/project/CSharp/MvcWebProject.xpt
@@ -280,8 +280,8 @@ namespace ${StandardNamespace}
" rel="stylesheet" type="text/css">
-
-
+
+
@@ -307,8 +307,8 @@ namespace ${StandardNamespace}
-
-
+
+
]]>
diff --git a/data/templates/project/VB/MvcRazorProject.xpt b/data/templates/project/VB/MvcRazorProject.xpt
index bd94faf848..87ba3a7275 100644
--- a/data/templates/project/VB/MvcRazorProject.xpt
+++ b/data/templates/project/VB/MvcRazorProject.xpt
@@ -265,8 +265,8 @@ Aliquam suscipit tellus vel nunc elementum fringilla.
@ViewData("Title")
-
-
+
+
@@ -292,8 +292,8 @@ Aliquam suscipit tellus vel nunc elementum fringilla.
-
-
+
+
]]>
diff --git a/data/templates/project/VB/MvcWebProject.xpt b/data/templates/project/VB/MvcWebProject.xpt
index f472bafb05..5be3b65b5a 100644
--- a/data/templates/project/VB/MvcWebProject.xpt
+++ b/data/templates/project/VB/MvcWebProject.xpt
@@ -272,8 +272,8 @@ End Class
" rel="stylesheet" type="text/css">
-
-
+
+
@@ -299,8 +299,8 @@ End Class
-
-
+
+
]]>
diff --git a/samples/MSTest/MSTest.SharpDevelop.Tests/MSTest.SharpDevelop.Tests.csproj b/samples/MSTest/MSTest.SharpDevelop.Tests/MSTest.SharpDevelop.Tests.csproj
new file mode 100644
index 0000000000..8334f2708a
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop.Tests/MSTest.SharpDevelop.Tests.csproj
@@ -0,0 +1,69 @@
+
+
+
+ {51D56190-67B7-4A49-BA0A-24010460CCC6}
+ Debug
+ x86
+ Library
+ MSTest.SharpDevelop.Tests
+ MSTest.SharpDevelop.Tests
+ v4.0
+ Properties
+
+
+ x86
+
+
+ bin\Debug\
+ True
+ Full
+ False
+ True
+ DEBUG;TRACE
+
+
+ bin\Release\
+ False
+ None
+ True
+ False
+ TRACE
+
+
+
+ ..\..\..\bin\ICSharpCode.Core.dll
+
+
+ ..\..\..\bin\ICSharpCode.SharpDevelop.dll
+
+
+ ..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll
+
+
+ ..\..\..\src\Tools\NUnit\nunit.framework.dll
+
+
+ ..\..\..\src\Libraries\RhinoMocks\Rhino.Mocks.dll
+
+
+
+ 3.5
+
+
+
+ ..\..\..\AddIns\Analysis\UnitTesting\UnitTesting.dll
+
+
+
+
+
+
+
+
+
+ {8DF3A610-47F9-4448-B455-952BD57CB5CC}
+ MSTest.SharpDevelop
+
+
+
+
\ No newline at end of file
diff --git a/samples/MSTest/MSTest.SharpDevelop.Tests/MSTestFrameworkTests.cs b/samples/MSTest/MSTest.SharpDevelop.Tests/MSTestFrameworkTests.cs
new file mode 100644
index 0000000000..be70c9d48c
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop.Tests/MSTestFrameworkTests.cs
@@ -0,0 +1,338 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+
+using ICSharpCode.MSTest;
+using ICSharpCode.SharpDevelop.Dom;
+using ICSharpCode.SharpDevelop.Project;
+using ICSharpCode.UnitTesting;
+using NUnit.Framework;
+using Rhino.Mocks;
+
+namespace MSTest.SharpDevelop.Tests
+{
+ [TestFixture]
+ public class MSTestFrameworkTests
+ {
+ MSTestFramework testFramework;
+ IProject fakeProject;
+
+ [SetUp]
+ public void Init()
+ {
+ testFramework = new MSTestFramework();
+
+ fakeProject = MockRepository.GenerateStub
();
+ fakeProject.Stub(p => p.SyncRoot).Return(fakeProject);
+ }
+
+ void AddReferencesToProject(params string[] referenceNames)
+ {
+ List projectItems = referenceNames
+ .Select(name => new ReferenceProjectItem(fakeProject, name) as ProjectItem)
+ .ToList();
+
+ AddItemsToProject(projectItems);
+ }
+
+ void AddItemsToProject(List projectItems)
+ {
+ fakeProject
+ .Stub(project => project.Items)
+ .Return(new ReadOnlyCollection(projectItems));
+ }
+
+ void AddFileAndReferenceToProject(string fileName, string reference)
+ {
+ var projectItems = new List();
+ projectItems.Add(new FileProjectItem(fakeProject, ItemType.Compile, fileName));
+ projectItems.Add(new ReferenceProjectItem(fakeProject, reference));
+
+ AddItemsToProject(projectItems);
+ }
+
+ void NoItemsInProject()
+ {
+ AddReferencesToProject();
+ }
+
+ IClass CreateClassWithoutAnyAttributes()
+ {
+ IClass fakeClass = MockRepository.GenerateStub();
+ AddAttributesToClass(fakeClass, new List());
+ return fakeClass;
+ }
+
+ void AddAttributesToClass(IClass fakeClass, List attributes)
+ {
+ fakeClass.Stub(c => c.Attributes).Return(attributes);
+ }
+
+ IClass CreateClassWithAttributes(params string[] attributeNames)
+ {
+ IClass fakeClass = MockRepository.GenerateStub();
+
+ List attributes = CreateAttributes(attributeNames);
+
+ AddAttributesToClass(fakeClass, attributes);
+
+ return fakeClass;
+ }
+
+ List CreateAttributes(params string[] attributeNames)
+ {
+ return attributeNames.Select(name => CreateAttribute(name)).ToList();
+ }
+
+ IAttribute CreateAttribute(string name)
+ {
+ IReturnType returnType = MockRepository.GenerateStub();
+ returnType.Stub(t => t.FullyQualifiedName).Return(name);
+
+ IAttribute attribute = MockRepository.GenerateStub();
+ attribute.Stub(a => a.AttributeType).Return(returnType);
+ return attribute;
+ }
+
+ void MakeClassAbstract(IClass fakeClass)
+ {
+ fakeClass.Stub(c => c.IsAbstract).Return(true);
+ }
+
+ IMethod CreateMethodWithoutAnyAttributes()
+ {
+ IMethod fakeMethod = MockRepository.GenerateStub();
+ AddAttributesToMethod(fakeMethod, new List());
+ return fakeMethod;
+ }
+
+ IMethod CreateMethodWithAttributes(params string[] attributeNames)
+ {
+ IMethod fakeMethod = MockRepository.GenerateStub();
+ List attributes = CreateAttributes(attributeNames);
+ AddAttributesToMethod(fakeMethod, attributes);
+ return fakeMethod;
+ }
+
+ void AddAttributesToMethod(IMethod method, List attributes)
+ {
+ method.Stub(m => m.Attributes).Return(attributes);
+ }
+
+ List GetTestMembersFor(IClass fakeClass)
+ {
+ return testFramework.GetTestMembersFor(fakeClass).ToList();
+ }
+
+ void AddMethodsToClass(IClass fakeClass, List methods)
+ {
+ fakeClass.Stub(c => c.Methods).Return(methods);
+ }
+
+ [Test]
+ public void IsTestProject_NullProject_ReturnsFalse()
+ {
+ bool result = testFramework.IsTestProject(null);
+
+ Assert.IsFalse(result);
+ }
+
+ [Test]
+ public void IsTestProject_ProjectWithMSTestAssemblyReference_ReturnsTrue()
+ {
+ AddReferencesToProject("System", "Microsoft.VisualStudio.QualityTools.UnitTestFramework");
+
+ bool result = testFramework.IsTestProject(fakeProject);
+
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ public void IsTestProject_ProjectWithoutMSTestAssemblyReference_ReturnsFalse()
+ {
+ NoItemsInProject();
+ bool result = testFramework.IsTestProject(fakeProject);
+
+ Assert.IsFalse(result);
+ }
+
+ [Test]
+ public void IsTestProject_ProjectWithMSTestAssemblyReferenceInUpperCase_ReturnsTrue()
+ {
+ AddReferencesToProject("MICROSOFT.VISUALSTUDIO.QUALITYTOOLS.UNITTESTFRAMEWORK");
+
+ bool result = testFramework.IsTestProject(fakeProject);
+
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ public void IsTestProject_ProjectWithMSTestAssemblyReferenceAndFileProjectItem_ReturnsTrue()
+ {
+ AddFileAndReferenceToProject("test.cs", "Microsoft.VisualStudio.QualityTools.UnitTestFramework");
+
+ bool result = testFramework.IsTestProject(fakeProject);
+
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ public void IsTestProject_ProjectWithMSTestAssemblyReferenceUsingFullName_ReturnsTrue()
+ {
+ AddReferencesToProject("Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=2.5.3.9345, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77");
+
+ bool result = testFramework.IsTestProject(fakeProject);
+
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ public void IsTestClass_ClassHasNoAttributes_ReturnsFalse()
+ {
+ IClass fakeClass = CreateClassWithoutAnyAttributes();
+
+ bool result = testFramework.IsTestClass(fakeClass);
+
+ Assert.IsFalse(result);
+ }
+
+ [Test]
+ public void IsTestClass_ClassHasTestFixtureAttributeMissingAttributePart_ReturnsTrue()
+ {
+ IClass fakeClass = CreateClassWithAttributes("TestClass");
+
+ bool result = testFramework.IsTestClass(fakeClass);
+
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ public void IsTestClass_ClassHasTestClassAttributeAndIsAbstract_ReturnsFalse()
+ {
+ IClass fakeClass = CreateClassWithAttributes("TestClass");
+ MakeClassAbstract(fakeClass);
+
+ bool result = testFramework.IsTestClass(fakeClass);
+
+ Assert.IsFalse(result);
+ }
+
+ [Test]
+ public void IsTestClass_ClassHasTestClassAttributeIncludingAttributePart_ReturnsTrue()
+ {
+ IClass fakeClass = CreateClassWithAttributes("TestClassAttribute");
+
+ bool result = testFramework.IsTestClass(fakeClass);
+
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ public void IsTestClass_ClassHasFullyQualifiedMSTestClassAttribute_ReturnsTrue()
+ {
+ IClass fakeClass = CreateClassWithAttributes("Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute");
+
+ bool result = testFramework.IsTestClass(fakeClass);
+
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ public void IsTestClass_ClassIsNull_ReturnsFalse()
+ {
+ bool result = testFramework.IsTestClass(null);
+
+ Assert.IsFalse(result);
+ }
+
+ [Test]
+ public void IsTestMember_MethodHasNoAttributes_ReturnsFalse()
+ {
+ IMethod method = CreateMethodWithoutAnyAttributes();
+
+ bool result = testFramework.IsTestMember(method);
+
+ Assert.IsFalse(result);
+ }
+
+ [Test]
+ public void IsTestMember_MethodHasTestMethodAttributeWithoutAttributePart_ReturnsTrue()
+ {
+ IMethod method = CreateMethodWithAttributes("TestMethod");
+
+ bool result = testFramework.IsTestMember(method);
+
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ public void IsTestMember_MethodHasTestMethodAttributeAttribute_ReturnsTrue()
+ {
+ IMethod method = CreateMethodWithAttributes("TestMethodAttribute");
+
+ bool result = testFramework.IsTestMember(method);
+
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ public void IsTestMember_MethodHasFullyQualifiedMSTestTestMethodAttribute_ReturnsTrue()
+ {
+ IMethod method = CreateMethodWithAttributes("Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute");
+
+ bool result = testFramework.IsTestMember(method);
+
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ public void IsTestMember_MethodIsNull_ReturnsFalse()
+ {
+ bool result = testFramework.IsTestMember(null);
+
+ Assert.IsFalse(result);
+ }
+
+ [Test]
+ public void IsTestMember_MemberNotMethod_ReturnsFalse()
+ {
+ IMember member = MockRepository.GenerateStub();
+
+ bool result = testFramework.IsTestMember(member);
+
+ Assert.IsFalse(result);
+ }
+
+ [Test]
+ public void GetTestMembersFor_ClassHasNoMethods_ReturnsFalse()
+ {
+ IClass fakeClass = CreateClassWithAttributes("TestClass");
+ AddMethodsToClass(fakeClass, new List());
+
+ List testMembers = GetTestMembersFor(fakeClass);
+
+ Assert.AreEqual(0, testMembers.Count);
+ }
+
+ [Test]
+ public void GetTestMembersFor_ClassHasTwoMethodsAndSecondOneIsTestMethod_ReturnsSecondTestMethodOnly()
+ {
+ IClass fakeClass = CreateClassWithAttributes("TestClass");
+
+ var methods = new List();
+ methods.Add(CreateMethodWithoutAnyAttributes());
+ IMethod testMethod = CreateMethodWithAttributes("TestMethod");
+ methods.Add(testMethod);
+ AddMethodsToClass(fakeClass, methods);
+
+ List testMembers = GetTestMembersFor(fakeClass);
+
+ Assert.AreEqual(1, testMembers.Count);
+ Assert.AreEqual(testMethod, testMembers[0].Member);
+ }
+ }
+}
diff --git a/samples/MSTest/MSTest.SharpDevelop.Tests/MSTestResultsTests.cs b/samples/MSTest/MSTest.SharpDevelop.Tests/MSTestResultsTests.cs
new file mode 100644
index 0000000000..c5304011f6
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop.Tests/MSTestResultsTests.cs
@@ -0,0 +1,184 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Xml;
+using ICSharpCode.MSTest;
+using ICSharpCode.SharpDevelop.Dom;
+using ICSharpCode.UnitTesting;
+using NUnit.Framework;
+
+namespace MSTest.SharpDevelop.Tests
+{
+ [TestFixture]
+ public class MSTestResultsTests
+ {
+ MSTestResults testResults;
+
+ void CreateMSTestResults(string xml)
+ {
+ using (var reader = new XmlTextReader(new StringReader(xml))) {
+ testResults = new MSTestResults(reader);
+ }
+ }
+
+ void AssertTestResultsAreEqual(TestResult[] expectedResults)
+ {
+ List expectedResultsAsString = ConvertToStrings(expectedResults);
+ List actualResultsAsString = ConvertToStrings(testResults);
+ CollectionAssert.AreEqual(expectedResultsAsString, actualResultsAsString);
+ }
+
+ List ConvertToStrings(IEnumerable results)
+ {
+ return results.Select(
+ result => String.Format(
+ "Name: {0}, Result: {1}, Message: '{2}', StackTrace: '{3}', StackPosition: {4}",
+ result.Name,
+ result.ResultType,
+ result.Message,
+ result.StackTrace,
+ result.StackTraceFilePosition))
+ .ToList();
+ }
+
+ [Test]
+ public void Results_OneClassWithTwoPassingTestMethods_ReturnsTwoResults()
+ {
+ CreateMSTestResults(oneClassWithTwoPassingTestMethods);
+
+ var expectedResults = new TestResult[] {
+ new TestResult("FooTest.UnitTest1.TestMethod1") {
+ ResultType = TestResultType.Success
+ },
+ new TestResult("FooTest.UnitTest1.TestMethod2") {
+ ResultType = TestResultType.Success
+ },
+ };
+ AssertTestResultsAreEqual(expectedResults);
+ }
+
+ string oneClassWithTwoPassingTestMethods =
+
+@"
+
+
+ These are default test settings for a local test run.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+";
+
+ [Test]
+ public void Results_OneTestMethodThrowsException_ReturnsOneErrorResultWithStackTrace()
+ {
+ CreateMSTestResults(oneTestMethodThrowsException);
+
+ var expectedResults = new TestResult[] {
+ new TestResult("FooTest.UnitTest1.TestMethod1") {
+ ResultType = TestResultType.Failure,
+ Message = "System.ApplicationException: asdfafds",
+ StackTrace = " at FooTest.UnitTest1.TestMethod1() in d:\\projects\\FooTest\\UnitTest1.cs:line 21\r\n",
+ StackTraceFilePosition = new FilePosition(@"d:\projects\FooTest\UnitTest1.cs", 21, 1)
+ }
+ };
+ AssertTestResultsAreEqual(expectedResults);
+ }
+
+ string oneTestMethodThrowsException =
+
+@"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+";
+ }
+}
diff --git a/samples/MSTest/MSTest.SharpDevelop.Tests/Properties/AssemblyInfo.cs b/samples/MSTest/MSTest.SharpDevelop.Tests/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..cdff605abd
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop.Tests/Properties/AssemblyInfo.cs
@@ -0,0 +1,31 @@
+#region Using directives
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+#endregion
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("MSTest.SharpDevelop.Tests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MSTest.SharpDevelop.Tests")]
+[assembly: AssemblyCopyright("Copyright 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// This sets the default COM visibility of types in the assembly to invisible.
+// If you need to expose a type to COM, use [ComVisible(true)] on that type.
+[assembly: ComVisible(false)]
+
+// The assembly version has following format :
+//
+// Major.Minor.Build.Revision
+//
+// You can specify all the values or you can use the default the Revision and
+// Build Numbers by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0")]
diff --git a/samples/MSTest/MSTest.SharpDevelop.sln b/samples/MSTest/MSTest.SharpDevelop.sln
new file mode 100644
index 0000000000..6166e73ff1
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop.sln
@@ -0,0 +1,24 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+# SharpDevelop 4.2.0.8749-Beta 2
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSTest.SharpDevelop", "MSTest.SharpDevelop\MSTest.SharpDevelop.csproj", "{8DF3A610-47F9-4448-B455-952BD57CB5CC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSTest.SharpDevelop.Tests", "MSTest.SharpDevelop.Tests\MSTest.SharpDevelop.Tests.csproj", "{51D56190-67B7-4A49-BA0A-24010460CCC6}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8DF3A610-47F9-4448-B455-952BD57CB5CC}.Debug|x86.Build.0 = Debug|x86
+ {8DF3A610-47F9-4448-B455-952BD57CB5CC}.Debug|x86.ActiveCfg = Debug|x86
+ {8DF3A610-47F9-4448-B455-952BD57CB5CC}.Release|x86.Build.0 = Release|x86
+ {8DF3A610-47F9-4448-B455-952BD57CB5CC}.Release|x86.ActiveCfg = Release|x86
+ {51D56190-67B7-4A49-BA0A-24010460CCC6}.Debug|x86.Build.0 = Debug|x86
+ {51D56190-67B7-4A49-BA0A-24010460CCC6}.Debug|x86.ActiveCfg = Debug|x86
+ {51D56190-67B7-4A49-BA0A-24010460CCC6}.Release|x86.Build.0 = Release|x86
+ {51D56190-67B7-4A49-BA0A-24010460CCC6}.Release|x86.ActiveCfg = Release|x86
+ EndGlobalSection
+EndGlobal
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTest.SharpDevelop.csproj b/samples/MSTest/MSTest.SharpDevelop/MSTest.SharpDevelop.csproj
new file mode 100644
index 0000000000..05165c7eb6
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTest.SharpDevelop.csproj
@@ -0,0 +1,103 @@
+
+
+
+ {8DF3A610-47F9-4448-B455-952BD57CB5CC}
+ Debug
+ x86
+ Library
+ ICSharpCode.MSTest
+ MSTest.SharpDevelop
+ v4.0
+ Properties
+ ..\..\..\AddIns\Samples\MSTest
+ False
+ False
+ 4
+ false
+
+
+ x86
+ False
+ Auto
+ 4194304
+ 4096
+
+
+ true
+ Full
+ False
+ True
+ DEBUG;TRACE
+
+
+ False
+ None
+ True
+ False
+ TRACE
+
+
+
+ ..\..\..\bin\ICSharpCode.Core.dll
+ False
+
+
+ ..\..\..\bin\ICSharpCode.Core.Presentation.dll
+ False
+
+
+ ..\..\..\bin\ICSharpCode.SharpDevelop.dll
+ False
+
+
+ ..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll
+ False
+
+
+ ..\..\..\bin\ICSharpCode.SharpDevelop.Widgets.dll
+ False
+
+
+
+
+
+ 3.5
+
+
+ 4.0
+
+
+
+ ..\..\..\AddIns\Analysis\UnitTesting\UnitTesting.dll
+ False
+
+
+
+
+
+
+
+
+
+
+ MSTestOptionsPanel.xaml
+ Code
+
+
+
+
+
+
+
+
+
+
+
+ Always
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTest.addin b/samples/MSTest/MSTest.SharpDevelop/MSTest.addin
new file mode 100644
index 0000000000..3049a6c8d0
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTest.addin
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTestApplication.cs b/samples/MSTest/MSTest.SharpDevelop/MSTestApplication.cs
new file mode 100644
index 0000000000..62e3985228
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTestApplication.cs
@@ -0,0 +1,46 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.Diagnostics;
+
+using ICSharpCode.UnitTesting;
+
+namespace ICSharpCode.MSTest
+{
+ public class MSTestApplication
+ {
+ SelectedTests selectedTests;
+ string resultsFileName;
+
+ public MSTestApplication(SelectedTests selectedTests, string resultsFileName)
+ {
+ this.selectedTests = selectedTests;
+ this.resultsFileName = resultsFileName;
+ GetProcessStartInfo();
+ }
+
+ void GetProcessStartInfo()
+ {
+ ProcessStartInfo = new ProcessStartInfo(MSTestOptions.MSTestPath, GetCommandLine());
+ }
+
+ string GetCommandLine()
+ {
+ var commandLine = new MSTestApplicationCommandLine();
+ commandLine.AppendQuoted("testcontainer", selectedTests.Project.OutputAssemblyFullPath);
+ commandLine.AppendQuoted("resultsfile", resultsFileName);
+ commandLine.Append("detail", "errorstacktrace");
+ if (selectedTests.NamespaceFilter != null) {
+ commandLine.Append("test", selectedTests.NamespaceFilter);
+ } else if (selectedTests.Member != null) {
+ commandLine.Append("test", selectedTests.Member.FullyQualifiedName);
+ } else if (selectedTests.Class != null) {
+ commandLine.Append("test", selectedTests.Class.FullyQualifiedName);
+ }
+ return commandLine.ToString();
+ }
+
+ public ProcessStartInfo ProcessStartInfo { get; private set; }
+ }
+}
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTestApplicationCommandLine.cs b/samples/MSTest/MSTest.SharpDevelop/MSTestApplicationCommandLine.cs
new file mode 100644
index 0000000000..669d88bba7
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTestApplicationCommandLine.cs
@@ -0,0 +1,37 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.Text;
+
+namespace ICSharpCode.MSTest
+{
+ public class MSTestApplicationCommandLine
+ {
+ StringBuilder commandLine = new StringBuilder();
+
+ public MSTestApplicationCommandLine()
+ {
+ }
+
+ public void Append(string argument, string value)
+ {
+ AppendFormat("/{0}:{1} ", argument, value);
+ }
+
+ public void AppendQuoted(string argument, string value)
+ {
+ AppendFormat("/{0}:\"{1}\" ", argument, value);
+ }
+
+ void AppendFormat(string format, string argument, string value)
+ {
+ commandLine.AppendFormat(format, argument, value);
+ }
+
+ public override string ToString()
+ {
+ return commandLine.ToString();
+ }
+ }
+}
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTestDebugger.cs b/samples/MSTest/MSTest.SharpDevelop/MSTestDebugger.cs
new file mode 100644
index 0000000000..aa4ad68eee
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTestDebugger.cs
@@ -0,0 +1,134 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.Diagnostics;
+using System.IO;
+
+using ICSharpCode.SharpDevelop.Debugging;
+using ICSharpCode.UnitTesting;
+
+namespace ICSharpCode.MSTest
+{
+ public class MSTestDebugger : TestRunnerBase
+ {
+ IUnitTestDebuggerService debuggerService;
+ IUnitTestMessageService messageService;
+ IDebugger debugger;
+ string resultsFileName;
+
+ public MSTestDebugger()
+ : this(
+ new UnitTestDebuggerService(),
+ new UnitTestMessageService())
+ {
+ }
+
+ public MSTestDebugger(
+ IUnitTestDebuggerService debuggerService,
+ IUnitTestMessageService messageService)
+ {
+ this.debuggerService = debuggerService;
+ this.messageService = messageService;
+ this.debugger = debuggerService.CurrentDebugger;
+ }
+
+ public override void Start(SelectedTests selectedTests)
+ {
+ ProcessStartInfo startInfo = GetProcessStartInfo(selectedTests);
+ if (IsDebuggerRunning) {
+ if (CanStopDebugging()) {
+ debugger.Stop();
+ Start(startInfo);
+ }
+ } else {
+ Start(startInfo);
+ }
+ }
+
+ protected override ProcessStartInfo GetProcessStartInfo(SelectedTests selectedTests)
+ {
+ resultsFileName = new MSTestResultsFileName(selectedTests).FileName;
+ CreateDirectoryForResultsFile();
+ var mstestApplication = new MSTestApplication(selectedTests, resultsFileName);
+ return mstestApplication.ProcessStartInfo;
+ }
+
+ public bool IsDebuggerRunning {
+ get { return debuggerService.IsDebuggerLoaded && debugger.IsDebugging; }
+ }
+
+ bool CanStopDebugging()
+ {
+ string question = "${res:XML.MainMenu.RunMenu.Compile.StopDebuggingQuestion}";
+ string caption = "${res:XML.MainMenu.RunMenu.Compile.StopDebuggingTitle}";
+ return messageService.AskQuestion(question, caption);
+ }
+
+ void CreateDirectoryForResultsFile()
+ {
+ string path = Path.GetDirectoryName(resultsFileName);
+ if (!Directory.Exists(path)) {
+ Directory.CreateDirectory(path);
+ }
+ }
+
+ void Start(ProcessStartInfo startInfo)
+ {
+ StartDebugger(startInfo);
+ }
+
+ void StartDebugger(ProcessStartInfo startInfo)
+ {
+ LogCommandLine(startInfo);
+
+ bool running = false;
+ debugger.DebugStopped += DebugStopped;
+ try {
+ debugger.Start(startInfo);
+ running = true;
+ } finally {
+ if (!running) {
+ debugger.DebugStopped -= DebugStopped;
+ }
+ }
+ }
+
+ void DebugStopped(object source, EventArgs e)
+ {
+ debugger.DebugStopped -= DebugStopped;
+
+ if (File.Exists(resultsFileName)) {
+ var testResults = new MSTestResults(resultsFileName);
+ var workbench = new UnitTestWorkbench();
+ workbench.SafeThreadAsyncCall(() => UpdateTestResults(testResults));
+ } else {
+ messageService.ShowFormattedErrorMessage("Unable to find test results file: '{0}'.", resultsFileName);
+ OnAllTestsFinished(source, e);
+ }
+ }
+
+ void UpdateTestResults(MSTestResults testResults)
+ {
+ foreach (TestResult result in testResults) {
+ OnTestFinished(this, new TestFinishedEventArgs(result));
+ }
+ OnAllTestsFinished(this, new EventArgs());
+ }
+
+ public override void Stop()
+ {
+ if (debugger.IsDebugging) {
+ debugger.Stop();
+ }
+ }
+
+ public override void Dispose()
+ {
+ Stop();
+ try {
+ File.Delete(resultsFileName);
+ } catch { }
+ }
+ }
+}
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTestFramework.cs b/samples/MSTest/MSTest.SharpDevelop/MSTestFramework.cs
new file mode 100644
index 0000000000..50e7d4eb59
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTestFramework.cs
@@ -0,0 +1,109 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using ICSharpCode.SharpDevelop.Dom;
+using ICSharpCode.SharpDevelop.Project;
+using ICSharpCode.UnitTesting;
+
+namespace ICSharpCode.MSTest
+{
+ public class MSTestFramework : ITestFramework
+ {
+ public bool IsBuildNeededBeforeTestRun {
+ get { return true; }
+ }
+
+ public bool IsTestMember(IMember member)
+ {
+ var method = member as IMethod;
+ if (method == null)
+ return false;
+
+ return IsTestMethod(method);
+ }
+
+ bool IsTestMethod(IMethod method)
+ {
+ foreach (IAttribute attribute in method.Attributes) {
+ if (IsMSTestMethodAttribute(attribute)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ bool IsMSTestMethodAttribute(IAttribute attribute)
+ {
+ return IsMSTestMethodAttribute(attribute.AttributeType.FullyQualifiedName);
+ }
+
+ bool IsMSTestMethodAttribute(string name)
+ {
+ return
+ name == "TestMethod" ||
+ name == "TestMethodAttribute" ||
+ name == "Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute";
+ }
+
+ public bool IsTestClass(IClass c)
+ {
+ if ((c == null) || (c.IsAbstract))
+ return false;
+
+ foreach (IAttribute attribute in c.Attributes) {
+ if (IsMSTestClassAttribute(attribute)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ bool IsMSTestClassAttribute(IAttribute attribute)
+ {
+ return IsMSTestClassAttribute(attribute.AttributeType.FullyQualifiedName);
+ }
+
+ bool IsMSTestClassAttribute(string name)
+ {
+ return
+ name == "TestClass" ||
+ name == "TestClassAttribute" ||
+ name == "Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute";
+ }
+
+ public bool IsTestProject(IProject project)
+ {
+ if (project == null)
+ return false;
+
+ foreach (ProjectItem item in project.Items) {
+ if (item.IsMSTestAssemblyReference()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public IEnumerable GetTestMembersFor(IClass c)
+ {
+ return c.Methods
+ .Where(IsTestMethod)
+ .Select(method => new TestMember(method));
+ }
+
+ public ITestRunner CreateTestRunner()
+ {
+ return new MSTestRunner();
+ }
+
+ public ITestRunner CreateTestDebugger()
+ {
+ return new MSTestDebugger();
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTestOptions.cs b/samples/MSTest/MSTest.SharpDevelop/MSTestOptions.cs
new file mode 100644
index 0000000000..f60a73467b
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTestOptions.cs
@@ -0,0 +1,26 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.IO;
+using ICSharpCode.Core;
+
+namespace ICSharpCode.MSTest
+{
+ public static class MSTestOptions
+ {
+ static Properties properties = PropertyService.Get("MSTestOptions", new Properties());
+
+ public static string MSTestPath {
+ get { return properties.Get("MSTestPath", GetDefaultMSTestPath()); }
+ set { properties.Set("MSTestPath", value); }
+ }
+
+ static string GetDefaultMSTestPath()
+ {
+ return Path.Combine(
+ Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
+ @"Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe");
+ }
+ }
+}
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTestOptionsPanel.xaml b/samples/MSTest/MSTest.SharpDevelop/MSTestOptionsPanel.xaml
new file mode 100644
index 0000000000..57da7506a1
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTestOptionsPanel.xaml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTestOptionsPanel.xaml.cs b/samples/MSTest/MSTest.SharpDevelop/MSTestOptionsPanel.xaml.cs
new file mode 100644
index 0000000000..e4fca61cf0
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTestOptionsPanel.xaml.cs
@@ -0,0 +1,64 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.ComponentModel;
+using System.Windows.Controls;
+using System.Windows.Input;
+
+using ICSharpCode.SharpDevelop.Gui;
+using ICSharpCode.SharpDevelop.Widgets;
+using Microsoft.Win32;
+
+namespace ICSharpCode.MSTest
+{
+ public partial class MSTestOptionsPanel : OptionPanel, INotifyPropertyChanged
+ {
+ string msTestPath;
+ bool changed;
+
+ public MSTestOptionsPanel()
+ {
+ InitializeComponent();
+ BrowseCommand = new RelayCommand(Browse);
+ msTestPath = MSTestOptions.MSTestPath;
+ DataContext = this;
+ }
+
+ public ICommand BrowseCommand { get; private set; }
+
+ void Browse()
+ {
+ var dialog = new OpenFileDialog();
+ if (dialog.ShowDialog() ?? false) {
+ MSTestPath = dialog.FileName;
+ }
+ }
+
+ public string MSTestPath {
+ get { return msTestPath; }
+ set {
+ msTestPath = value;
+ changed = true;
+ OnPropertyChanged("MSTestPath");
+ }
+ }
+
+ public override bool SaveOptions()
+ {
+ if (changed) {
+ MSTestOptions.MSTestPath = msTestPath;
+ }
+ return true;
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ void OnPropertyChanged(string name)
+ {
+ if (PropertyChanged != null) {
+ PropertyChanged(this, new PropertyChangedEventArgs(name));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTestQualifiedClassName.cs b/samples/MSTest/MSTest.SharpDevelop/MSTestQualifiedClassName.cs
new file mode 100644
index 0000000000..5fa3fdc4ee
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTestQualifiedClassName.cs
@@ -0,0 +1,31 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+
+namespace ICSharpCode.MSTest
+{
+ public class MSTestQualifiedClassName
+ {
+ public MSTestQualifiedClassName(string qualifiedClassName)
+ {
+ ClassName = GetClassName(qualifiedClassName);
+ }
+
+ string GetClassName(string qualifiedClassName)
+ {
+ int index = qualifiedClassName.IndexOf(',');
+ if (index > 0) {
+ return qualifiedClassName.Substring(0, index);
+ }
+ return qualifiedClassName;
+ }
+
+ public string ClassName { get; private set; }
+
+ public string GetQualifiedMethodName(string methodName)
+ {
+ return String.Format("{0}.{1}", ClassName, methodName);
+ }
+ }
+}
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTestResult.cs b/samples/MSTest/MSTest.SharpDevelop/MSTestResult.cs
new file mode 100644
index 0000000000..51674abe68
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTestResult.cs
@@ -0,0 +1,93 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.IO;
+using ICSharpCode.SharpDevelop.Dom;
+using ICSharpCode.SharpDevelop.Gui;
+using ICSharpCode.UnitTesting;
+
+namespace ICSharpCode.MSTest
+{
+ public class MSTestResult
+ {
+ public MSTestResult(string id)
+ {
+ this.Id = id;
+ }
+
+ public string Id { get; private set; }
+ public string Name { get; private set; }
+ public TestResultType ResultType { get; private set; }
+ public string StackTrace { get; set; }
+ public string Message { get; set; }
+
+ public void UpdateTestName(string qualifiedClassName, string methodName)
+ {
+ UpdateTestName(new MSTestQualifiedClassName(qualifiedClassName), methodName);
+ }
+
+ public void UpdateTestName(MSTestQualifiedClassName qualifiedClassName, string methodName)
+ {
+ this.Name = qualifiedClassName.GetQualifiedMethodName(methodName);
+ }
+
+ public void UpdateResult(string result)
+ {
+ if (result == "Passed") {
+ this.ResultType = TestResultType.Success;
+ } else if (result == "Failed") {
+ this.ResultType = TestResultType.Failure;
+ }
+ }
+
+ public bool IsError {
+ get { return ResultType == TestResultType.Failure; }
+ }
+
+ public TestResult ToTestResult()
+ {
+ return new TestResult(Name) {
+ ResultType = ResultType,
+ Message = GetMessage(),
+ StackTrace = StackTrace,
+ StackTraceFilePosition = GetStackTraceFilePosition()
+ };
+ }
+
+ string GetMessage()
+ {
+ if (String.IsNullOrEmpty(Message))
+ return String.Empty;
+
+ int index = Message.IndexOf('\n');
+ if (index > 0) {
+ return Message.Substring(index + 1);
+ }
+ return Message;
+ }
+
+ FilePosition GetStackTraceFilePosition()
+ {
+ if (!String.IsNullOrEmpty(StackTrace)) {
+ return ParseFilePositionFromStackTrace();
+ }
+ return FilePosition.Empty;
+ }
+
+ FilePosition ParseFilePositionFromStackTrace()
+ {
+ FileLineReference fileLineRef = OutputTextLineParser.GetNUnitOutputFileLineReference(StackTrace, true);
+ if (fileLineRef != null) {
+ return CreateFilePosition(fileLineRef);
+ }
+ return FilePosition.Empty;
+ }
+
+ FilePosition CreateFilePosition(FileLineReference fileLineRef)
+ {
+ string fileName = Path.GetFullPath(fileLineRef.FileName);
+ return new FilePosition(fileName, fileLineRef.Line, fileLineRef.Column + 1);
+ }
+ }
+}
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTestResults.cs b/samples/MSTest/MSTest.SharpDevelop/MSTestResults.cs
new file mode 100644
index 0000000000..c02fff240d
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTestResults.cs
@@ -0,0 +1,91 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.Collections.Generic;
+using System.Xml;
+
+using ICSharpCode.UnitTesting;
+
+namespace ICSharpCode.MSTest
+{
+ public class MSTestResults : List
+ {
+ Dictionary testDefinitions = new Dictionary();
+
+ public MSTestResults(string fileName)
+ : this(new XmlTextReader(fileName))
+ {
+ }
+
+ public MSTestResults(XmlTextReader reader)
+ {
+ ReadResults(reader);
+ }
+
+ void ReadResults(XmlTextReader reader)
+ {
+ while (reader.Read()) {
+ switch (reader.NodeType) {
+ case XmlNodeType.Element:
+ if (reader.Name == "UnitTest") {
+ ReadUnitTest(reader);
+ } else if (reader.Name == "UnitTestResult") {
+ ReadUnitTestResult(reader);
+ }
+ break;
+ }
+ }
+ }
+
+ void ReadUnitTest(XmlTextReader reader)
+ {
+ var testResult = new MSTestResult(reader.GetAttribute("id"));
+ testDefinitions.Add(testResult.Id, testResult);
+
+ if (reader.ReadToDescendant("TestMethod")) {
+ testResult.UpdateTestName(reader.GetAttribute("className"), reader.GetAttribute("name"));
+ }
+ }
+
+ void ReadUnitTestResult(XmlTextReader reader)
+ {
+ string testId = reader.GetAttribute("testId");
+ MSTestResult testResult = FindTestResult(testId);
+ if (testResult != null) {
+ testResult.UpdateResult(reader.GetAttribute("outcome"));
+ if (testResult.IsError) {
+ ReadErrorInformation(testResult, reader);
+ }
+ Add(testResult.ToTestResult());
+ }
+ }
+
+ void ReadErrorInformation(MSTestResult testResult, XmlTextReader reader)
+ {
+ while (reader.Read()) {
+ switch (reader.NodeType) {
+ case XmlNodeType.EndElement:
+ if (reader.Name == "UnitTestResult") {
+ return;
+ }
+ break;
+ case XmlNodeType.Element:
+ if (reader.Name == "Message") {
+ testResult.Message = reader.ReadElementContentAsString();
+ } else if (reader.Name == "StackTrace") {
+ testResult.StackTrace = reader.ReadElementContentAsString();
+ }
+ break;
+ }
+ }
+ }
+
+ MSTestResult FindTestResult(string testId)
+ {
+ MSTestResult testResult = null;
+ testDefinitions.TryGetValue(testId, out testResult);
+ return testResult;
+ }
+ }
+}
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTestResultsFileName.cs b/samples/MSTest/MSTest.SharpDevelop/MSTestResultsFileName.cs
new file mode 100644
index 0000000000..51c1fdd1a3
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTestResultsFileName.cs
@@ -0,0 +1,27 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.IO;
+using ICSharpCode.UnitTesting;
+
+namespace ICSharpCode.MSTest
+{
+ public class MSTestResultsFileName
+ {
+ public MSTestResultsFileName(SelectedTests selectedTests)
+ {
+ FileName = GetFileName(selectedTests);
+ }
+
+ public string FileName { get; private set; }
+
+ string GetFileName(SelectedTests selectedTests)
+ {
+ return Path.Combine(
+ Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
+ "Temp",
+ selectedTests.Project.Name + "-Results.trx");
+ }
+ }
+}
diff --git a/samples/MSTest/MSTest.SharpDevelop/MSTestRunner.cs b/samples/MSTest/MSTest.SharpDevelop/MSTestRunner.cs
new file mode 100644
index 0000000000..a5fb6be9be
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/MSTestRunner.cs
@@ -0,0 +1,138 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.Diagnostics;
+using System.IO;
+
+using ICSharpCode.SharpDevelop.Util;
+using ICSharpCode.UnitTesting;
+
+namespace ICSharpCode.MSTest
+{
+ public class MSTestRunner : TestRunnerBase
+ {
+ IUnitTestProcessRunner processRunner;
+ IFileSystem fileSystem;
+ IUnitTestMessageService messageService;
+ string resultsFileName;
+
+ public MSTestRunner()
+ : this(new UnitTestProcessRunner(),
+ new UnitTestFileService(),
+ new UnitTestMessageService())
+ {
+ }
+
+ public MSTestRunner(
+ IUnitTestProcessRunner processRunner,
+ IFileSystem fileSystem,
+ IUnitTestMessageService messageService)
+ {
+ this.processRunner = processRunner;
+ this.fileSystem = fileSystem;
+ this.messageService = messageService;
+
+ processRunner.LogStandardOutputAndError = false;
+ processRunner.OutputLineReceived += OutputLineReceived;
+ processRunner.ErrorLineReceived += OutputLineReceived;
+ processRunner.ProcessExited += ProcessRunnerExited;
+ }
+
+ void ProcessRunnerExited(object source, EventArgs e)
+ {
+ // Read all tests.
+ if (FileExists(resultsFileName)) {
+ var testResults = new MSTestResults(resultsFileName);
+ var workbench = new UnitTestWorkbench();
+ workbench.SafeThreadAsyncCall(() => UpdateTestResults(testResults));
+ } else {
+ messageService.ShowFormattedErrorMessage("Unable to find test results file: '{0}'.", resultsFileName);
+ OnAllTestsFinished(source, e);
+ }
+ }
+
+ void UpdateTestResults(MSTestResults testResults)
+ {
+ foreach (TestResult result in testResults) {
+ OnTestFinished(this, new TestFinishedEventArgs(result));
+ }
+ OnAllTestsFinished(this, new EventArgs());
+ }
+
+ void OutputLineReceived(object source, LineReceivedEventArgs e)
+ {
+ OnMessageReceived(e.Line);
+ }
+
+ public override void Start(SelectedTests selectedTests)
+ {
+ ProcessStartInfo startInfo = GetProcessStartInfo(selectedTests);
+ TryDeleteResultsFile();
+ Start(startInfo);
+ }
+
+ protected override ProcessStartInfo GetProcessStartInfo(SelectedTests selectedTests)
+ {
+ resultsFileName = new MSTestResultsFileName(selectedTests).FileName;
+ CreateDirectoryForResultsFile();
+ var mstestApplication = new MSTestApplication(selectedTests, resultsFileName);
+ return mstestApplication.ProcessStartInfo;
+ }
+
+ void Start(ProcessStartInfo processStartInfo)
+ {
+ LogCommandLine(processStartInfo);
+
+ if (FileExists(processStartInfo.FileName)) {
+ processRunner.WorkingDirectory = processStartInfo.WorkingDirectory;
+ processRunner.Start(processStartInfo.FileName, processStartInfo.Arguments);
+ } else {
+ ShowApplicationDoesNotExistMessage(processStartInfo.FileName);
+ }
+ }
+
+ void CreateDirectoryForResultsFile()
+ {
+ string path = Path.GetDirectoryName(resultsFileName);
+ if (!Directory.Exists(path)) {
+ Directory.CreateDirectory(path);
+ }
+ }
+
+ bool FileExists(string fileName)
+ {
+ return fileSystem.FileExists(fileName);
+ }
+
+ void ShowApplicationDoesNotExistMessage(string fileName)
+ {
+ string resourceString = "${res:ICSharpCode.UnitTesting.TestRunnerNotFoundMessageFormat}";
+ messageService.ShowFormattedErrorMessage(resourceString, fileName);
+ }
+
+ public override void Stop()
+ {
+ processRunner.Kill();
+ }
+
+ public override void Dispose()
+ {
+ processRunner.ErrorLineReceived -= OutputLineReceived;
+ processRunner.OutputLineReceived -= OutputLineReceived;
+ processRunner.ProcessExited -= ProcessRunnerExited;
+
+ TryDeleteResultsFile();
+ }
+
+ void TryDeleteResultsFile()
+ {
+ try {
+ Console.WriteLine("Deleting results file: " + resultsFileName);
+ File.Delete(resultsFileName);
+ } catch (Exception ex) {
+ Console.WriteLine(ex.Message);
+ }
+ }
+ }
+}
diff --git a/samples/MSTest/MSTest.SharpDevelop/ProjectItemExtensions.cs b/samples/MSTest/MSTest.SharpDevelop/ProjectItemExtensions.cs
new file mode 100644
index 0000000000..c88914e902
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/ProjectItemExtensions.cs
@@ -0,0 +1,28 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using ICSharpCode.SharpDevelop.Project;
+
+namespace ICSharpCode.MSTest
+{
+ public static class ProjectItemExtensions
+ {
+ public static bool IsMSTestAssemblyReference(this ProjectItem item)
+ {
+ var referenceItem = item as ReferenceProjectItem;
+ if (referenceItem == null)
+ return false;
+
+ return IsMSTestAssemblyReference(referenceItem);
+ }
+
+ public static bool IsMSTestAssemblyReference(this ReferenceProjectItem item)
+ {
+ return String.Equals(
+ item.ShortName,
+ "Microsoft.VisualStudio.QualityTools.UnitTestFramework",
+ StringComparison.OrdinalIgnoreCase);
+ }
+ }
+}
diff --git a/samples/MSTest/MSTest.SharpDevelop/Properties/AssemblyInfo.cs b/samples/MSTest/MSTest.SharpDevelop/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..8ab66e9a48
--- /dev/null
+++ b/samples/MSTest/MSTest.SharpDevelop/Properties/AssemblyInfo.cs
@@ -0,0 +1,31 @@
+#region Using directives
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+#endregion
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("MSTest.SharpDevelop")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MSTest.SharpDevelop")]
+[assembly: AssemblyCopyright("Copyright 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// This sets the default COM visibility of types in the assembly to invisible.
+// If you need to expose a type to COM, use [ComVisible(true)] on that type.
+[assembly: ComVisible(false)]
+
+// The assembly version has following format :
+//
+// Major.Minor.Build.Revision
+//
+// You can specify all the values or you can use the default the Revision and
+// Build Numbers by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0")]
diff --git a/src/AddIns/Analysis/CodeCoverage/Test/Testing/CodeCoverageTestRunnerTests.cs b/src/AddIns/Analysis/CodeCoverage/Test/Testing/CodeCoverageTestRunnerTests.cs
index 416c25431c..a0f2da9c78 100644
--- a/src/AddIns/Analysis/CodeCoverage/Test/Testing/CodeCoverageTestRunnerTests.cs
+++ b/src/AddIns/Analysis/CodeCoverage/Test/Testing/CodeCoverageTestRunnerTests.cs
@@ -118,7 +118,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing
string expectedCommandLine =
"--target \"d:\\sharpdevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"--target-work-dir \"c:\\projects\\MyTests\\bin\\Debug\" " +
- "--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /results=\\\"d:\\temp\\results.txt\\\"\" " +
+ "--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml /results=\\\"d:\\temp\\results.txt\\\"\" " +
"--output \"c:\\projects\\MyTests\\PartCover\\coverage.xml\" " +
"--include [MyTests]*";
@@ -218,7 +218,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing
"\"d:\\sharpdevelop\\bin\\Tools\\PartCover\\PartCover.exe\" " +
"--target \"d:\\sharpdevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"--target-work-dir \"c:\\projects\\MyTests\\bin\\Debug\" " +
- "--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\"\" " +
+ "--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml\" " +
"--output \"c:\\projects\\MyTests\\PartCover\\coverage.xml\" " +
"--include [*]*";
}
diff --git a/src/AddIns/Analysis/CodeCoverage/Test/Testing/PartCoverApplicationTests.cs b/src/AddIns/Analysis/CodeCoverage/Test/Testing/PartCoverApplicationTests.cs
index b4e2ecdc85..1f4c628ef4 100644
--- a/src/AddIns/Analysis/CodeCoverage/Test/Testing/PartCoverApplicationTests.cs
+++ b/src/AddIns/Analysis/CodeCoverage/Test/Testing/PartCoverApplicationTests.cs
@@ -133,7 +133,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing
string expectedCommandLine =
"--target \"d:\\sharpdevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"--target-work-dir \"c:\\projects\\MyTests\\bin\\Debug\" " +
- "--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\"\" " +
+ "--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml\" " +
"--output \"c:\\projects\\MyTests\\PartCover\\coverage.xml\" " +
"--include [*]*";
@@ -157,7 +157,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing
string expectedCommandLine =
"--target \"d:\\sharpdevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"--target-work-dir \"c:\\projects\\MyTests\\bin\\Debug\" " +
- "--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\"\" " +
+ "--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml\" " +
"--output \"c:\\projects\\MyTests\\PartCover\\coverage.xml\" " +
"--include [MyTests]* " +
"--include [MoreTests]* " +
diff --git a/src/AddIns/Analysis/UnitTesting/Src/NUnitConsoleCommandLine.cs b/src/AddIns/Analysis/UnitTesting/Src/NUnitConsoleApplication.cs
similarity index 96%
rename from src/AddIns/Analysis/UnitTesting/Src/NUnitConsoleCommandLine.cs
rename to src/AddIns/Analysis/UnitTesting/Src/NUnitConsoleApplication.cs
index f6ff76fb75..5eb4586197 100644
--- a/src/AddIns/Analysis/UnitTesting/Src/NUnitConsoleCommandLine.cs
+++ b/src/AddIns/Analysis/UnitTesting/Src/NUnitConsoleApplication.cs
@@ -51,6 +51,7 @@ namespace ICSharpCode.UnitTesting
NoDots = options.NoDots;
Labels = options.Labels;
ShadowCopy = !options.NoShadow;
+ NoXmlOutputFile = !options.CreateXmlOutputFile;
if (options.CreateXmlOutputFile) {
GenerateXmlOutputFileName();
@@ -121,6 +122,11 @@ namespace ICSharpCode.UnitTesting
///
public string XmlOutputFile;
+ ///
+ /// Use /noxml.
+ ///
+ public bool NoXmlOutputFile = true;
+
///
/// Fixture to test. Null = test all fixtures.
///
@@ -195,7 +201,9 @@ namespace ICSharpCode.UnitTesting
b.Append(" /labels");
if (NoDots)
b.Append(" /nodots");
- if (XmlOutputFile != null) {
+ if (NoXmlOutputFile) {
+ b.Append(" /noxml");
+ } else if (XmlOutputFile != null) {
b.Append(" /xml=\"");
b.Append(XmlOutputFile);
b.Append('"');
diff --git a/src/AddIns/Analysis/UnitTesting/Test/Frameworks/NUnitConsoleCommandLineTests.cs b/src/AddIns/Analysis/UnitTesting/Test/Frameworks/NUnitConsoleCommandLineTests.cs
index cfebc1c133..93f237a0bd 100644
--- a/src/AddIns/Analysis/UnitTesting/Test/Frameworks/NUnitConsoleCommandLineTests.cs
+++ b/src/AddIns/Analysis/UnitTesting/Test/Frameworks/NUnitConsoleCommandLineTests.cs
@@ -32,6 +32,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = false;
app.ShadowCopy = true;
+ app.NoXmlOutputFile = false;
app.Results = @"C:\results.txt";
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /results=\"C:\\results.txt\"";
@@ -45,6 +46,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = true;
app.ShadowCopy = true;
+ app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /nologo";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@@ -57,6 +59,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = false;
app.ShadowCopy = false;
+ app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /noshadow";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@@ -70,6 +73,7 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.NoThread = true;
+ app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /nothread";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@@ -83,6 +87,7 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.NoDots = true;
+ app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /nodots";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@@ -96,6 +101,7 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.Labels = true;
+ app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /labels";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@@ -109,6 +115,7 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.Fixture = "TestFixture";
+ app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /run=\"TestFixture\"";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@@ -122,6 +129,7 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.NamespaceFilter = "TestFixture";
+ app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /run=\"TestFixture\"";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@@ -135,11 +143,26 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.XmlOutputFile = @"C:\NUnit.xml";
+ app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /xml=\"C:\\NUnit.xml\"";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
}
+ [Test]
+ public void NoXmlWhenXmlOutputFileSpecified()
+ {
+ SelectedTests selectedTests = new SelectedTests(project);
+ NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
+ app.NoLogo = false;
+ app.ShadowCopy = true;
+ app.XmlOutputFile = @"C:\NUnit.xml";
+ app.NoXmlOutputFile = true;
+
+ string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /noxml";
+ Assert.AreEqual(expectedCommandLine, app.GetArguments());
+ }
+
[Test]
public void TestMethod()
{
@@ -149,6 +172,7 @@ namespace UnitTesting.Tests.Frameworks
app.ShadowCopy = true;
app.Fixture = "TestFixture";
app.Test = "Test";
+ app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /run=\"TestFixture.Test\"";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@@ -163,6 +187,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = false;
app.ShadowCopy = true;
+ app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /run=\"TestFixture.Test\"";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@@ -175,6 +200,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = false;
app.ShadowCopy = true;
+ app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /run=\"Project.MyTests\"";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@@ -187,6 +213,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = true;
app.ShadowCopy = true;
+ app.NoXmlOutputFile = false;
FileUtility.ApplicationRootPath = @"C:\SharpDevelop";
@@ -211,6 +238,7 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.Results = @"C:\results.txt";
+ app.NoXmlOutputFile = false;
string expectedCommandLine =
"\"C:\\Projects\\MyTests\\MyTests.dll\" " +
@@ -235,6 +263,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = false;
app.ShadowCopy = true;
+ app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" " +
"/run=\"MyTests.TestFixture+InnerTest\"";
diff --git a/src/AddIns/Analysis/UnitTesting/Test/Frameworks/NUnitConsoleProcessStartInfoTestFixture.cs b/src/AddIns/Analysis/UnitTesting/Test/Frameworks/NUnitConsoleProcessStartInfoTestFixture.cs
index a63fad5c3a..8902702f73 100644
--- a/src/AddIns/Analysis/UnitTesting/Test/Frameworks/NUnitConsoleProcessStartInfoTestFixture.cs
+++ b/src/AddIns/Analysis/UnitTesting/Test/Frameworks/NUnitConsoleProcessStartInfoTestFixture.cs
@@ -50,7 +50,7 @@ namespace UnitTesting.Tests.Frameworks
public void CommandLineArgumentsAreNUnitConsoleExeCommandLineArguments()
{
string expectedCommandLine =
- "\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\"";
+ "\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" /noxml";
Assert.AreEqual(expectedCommandLine, info.Arguments);
}
diff --git a/src/AddIns/Analysis/UnitTesting/Test/Tree/RunNUnitTestsForMethodTestFixture.cs b/src/AddIns/Analysis/UnitTesting/Test/Tree/RunNUnitTestsForMethodTestFixture.cs
index a8edcd6ccf..d604124e99 100644
--- a/src/AddIns/Analysis/UnitTesting/Test/Tree/RunNUnitTestsForMethodTestFixture.cs
+++ b/src/AddIns/Analysis/UnitTesting/Test/Tree/RunNUnitTestsForMethodTestFixture.cs
@@ -173,7 +173,7 @@ namespace UnitTesting.Tests.Tree
StartNUnitTestRunner();
string expectedArgs =
- "\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" " +
+ "\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" /noxml " +
"/results=\"c:\\temp\\tmp66.tmp\" " +
"/run=\"MyTests.MyTestClass.MyTestMethod\"";
Assert.AreEqual(expectedArgs, context.MockProcessRunner.CommandArgumentsPassedToStartMethod);
diff --git a/src/AddIns/Analysis/UnitTesting/Test/Tree/RunNUnitTestsWithDebuggerTestFixture.cs b/src/AddIns/Analysis/UnitTesting/Test/Tree/RunNUnitTestsWithDebuggerTestFixture.cs
index 19ccf38875..2bea660cd7 100644
--- a/src/AddIns/Analysis/UnitTesting/Test/Tree/RunNUnitTestsWithDebuggerTestFixture.cs
+++ b/src/AddIns/Analysis/UnitTesting/Test/Tree/RunNUnitTestsWithDebuggerTestFixture.cs
@@ -57,7 +57,7 @@ namespace UnitTesting.Tests.Tree
StartTestDebugger();
string expectedArguments =
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" " +
- "/noshadow " +
+ "/noshadow /noxml " +
"/results=\"c:\\temp\\tmp66.tmp\" " +
"/run=\"MyTests.MyTestClass.MyTestMethod\"";
@@ -167,7 +167,7 @@ namespace UnitTesting.Tests.Tree
string commandLine = "\"C:\\SharpDevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" " +
- "/noshadow " +
+ "/noshadow /noxml " +
"/results=\"c:\\temp\\tmp66.tmp\" " +
"/run=\"MyTests.MyTestClass.MyTestMethod\"";
Assert.AreEqual(commandLine, message);
diff --git a/src/AddIns/Analysis/UnitTesting/Test/Tree/RunTestInPadCommandTestFixture.cs b/src/AddIns/Analysis/UnitTesting/Test/Tree/RunTestInPadCommandTestFixture.cs
index dbb49a143e..e008a885e4 100644
--- a/src/AddIns/Analysis/UnitTesting/Test/Tree/RunTestInPadCommandTestFixture.cs
+++ b/src/AddIns/Analysis/UnitTesting/Test/Tree/RunTestInPadCommandTestFixture.cs
@@ -79,7 +79,7 @@ namespace UnitTesting.Tests.Tree
{
runCommand.Run();
buildProject.FireBuildCompleteEvent();
- string expectedArgs = "\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\"";
+ string expectedArgs = "\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" /noxml";
Assert.AreEqual(expectedArgs, processRunner.CommandArgumentsPassedToStartMethod);
}
diff --git a/src/AddIns/Analysis/UnitTesting/Test/Tree/RunTestWithDebuggerCommandTestFixture.cs b/src/AddIns/Analysis/UnitTesting/Test/Tree/RunTestWithDebuggerCommandTestFixture.cs
index 6babf3d975..6aa2a63386 100644
--- a/src/AddIns/Analysis/UnitTesting/Test/Tree/RunTestWithDebuggerCommandTestFixture.cs
+++ b/src/AddIns/Analysis/UnitTesting/Test/Tree/RunTestWithDebuggerCommandTestFixture.cs
@@ -34,7 +34,7 @@ namespace UnitTesting.Tests.Tree
public void DebuggerStartsUnitTestApplicationWithCorrectCommandLineArguments()
{
string expectedArguments =
- "\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\"";
+ "\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" /noxml";
string actualArguments = debuggerService.MockDebugger.ProcessStartInfo.Arguments;
Assert.AreEqual(expectedArguments, actualArguments);
@@ -54,7 +54,7 @@ namespace UnitTesting.Tests.Tree
{
string expectedText =
"\"D:\\SharpDevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
- "\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\"\r\n";
+ "\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" /noxml\r\n";
string actualText = context.UnitTestCategory.Text;
Assert.AreEqual(expectedText, actualText);
diff --git a/src/AddIns/Analysis/UnitTesting/UnitTesting.csproj b/src/AddIns/Analysis/UnitTesting/UnitTesting.csproj
index bdf1445c65..77590cce8d 100644
--- a/src/AddIns/Analysis/UnitTesting/UnitTesting.csproj
+++ b/src/AddIns/Analysis/UnitTesting/UnitTesting.csproj
@@ -126,7 +126,7 @@
Component
-
+
diff --git a/src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.csproj b/src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.csproj
index 5fdddc6f26..34524f74cd 100644
--- a/src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.csproj
+++ b/src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.csproj
@@ -231,7 +231,6 @@
-
diff --git a/src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/ViewInBrowser.cs b/src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/ViewInBrowser.cs
deleted file mode 100644
index 4a89a3e636..0000000000
--- a/src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/ViewInBrowser.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
-//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
-//
-//using System;
-//using System.IO;
-//using System.Linq;
-//
-//using ICSharpCode.Core;
-//using ICSharpCode.SharpDevelop.Gui.OptionPanels;
-//using ICSharpCode.SharpDevelop.Project;
-//using ICSharpCode.SharpDevelop.Project.Commands;
-//
-//namespace ICSharpCode.AspNet.Mvc
-//{
-// public class ViewInBrowser : AbstractMenuCommand
-// {
-// public override void Run()
-// {
-// var node = ProjectBrowserPad.Instance.SelectedNode as FileNode;
-// if (node == null) {
-// return;
-// }
-//
-// var project = ProjectService.CurrentProject as CompilableProject;
-// if (project == null) {
-// return;
-// }
-//
-// if (!project.IsWebProject) {
-// MessageService.ShowError("${res:ProjectComponent.ContextMenu.NotAWebProject}");
-// return;
-// }
-//
-// if (!WebProjectService.IsIISOrIISExpressInstalled) {
-// MessageService.ShowError("${res:ICSharpCode.WebProjectOptionsPanel.IISNotFound}");
-// return;
-// }
-//
-// string fileName = node.FileName;
-//
-//// // set project options
-//// project.StartAction = StartAction.StartURL;
-//// string directoryName = Path.GetDirectoryName(project.FileName) + "\\";
-//// project.StartUrl = fileName.Replace(directoryName, "/").Replace("\\", "/");
-//
-// // set web server options
-// string projectName = project.Name;
-// WebProjectOptions existingOptions = WebProjectsOptions.Instance.GetWebProjectOptions(projectName);
-//
-// var options = new WebProjectOptions {
-// Data = new WebProjectDebugData {
-// WebServer = WebProjectService.IsIISExpressInstalled ? WebServer.IISExpress : WebServer.IIS,
-// Port = (existingOptions != null && existingOptions.Data != null) ? existingOptions.Data.Port : "8080", //TODO: port collision detection
-// ProjectUrl = string.Format("{0}/{1}", WebBehavior.LocalHost, project.Name)
-// },
-// ProjectName = projectName
-// };
-//
-// if (options.Data.WebServer == WebServer.IISExpress) {
-// options.Data.ProjectUrl = string.Format(
-// @"{0}:{1}/{2}", WebBehavior.LocalHost, options.Data.Port, projectName);
-// }
-//
-// WebProjectsOptions.Instance.SetWebProjectOptions(projectName, options);
-//
-// // create virtual directory
-// string error = WebProjectService.CreateVirtualDirectory(
-// options.Data.WebServer,
-// projectName,
-// Path.GetDirectoryName(ProjectService.CurrentProject.FileName));
-// LoggingService.Info(error ?? string.Empty);
-//
-// // RunProject
-// new RunProject().Run();
-// }
-// }
-//}
diff --git a/src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/WebProjectOptions/WebProjectOptionsPanel.xaml.cs b/src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/WebProjectOptions/WebProjectOptionsPanel.xaml.cs
index 74aca4a832..1fa62e73e3 100644
--- a/src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/WebProjectOptions/WebProjectOptionsPanel.xaml.cs
+++ b/src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/WebProjectOptions/WebProjectOptionsPanel.xaml.cs
@@ -26,6 +26,7 @@ namespace ICSharpCode.AspNet.Mvc
protected override void Load(MSBuildBasedProject project, string configuration, string platform)
{
+ base.Load(project, configuration, platform);
CreateWebProject(project);
if (!WebProjectService.IsIISOrIISExpressInstalled) {
StatusLabel.Text = ResourceService.GetString("ICSharpCode.WebProjectOptionsPanel.IISNotFound");
diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonComponentWalker.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonComponentWalker.cs
index 74395e322a..56fea8db0d 100644
--- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonComponentWalker.cs
+++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonComponentWalker.cs
@@ -165,7 +165,7 @@ namespace ICSharpCode.PythonBinding
MemberExpression eventExpression = node.Left as MemberExpression;
string eventName = eventExpression.Name.ToString();
- PythonControlFieldExpression field = PythonControlFieldExpression.Create(eventExpression);
+ fieldExpression = PythonControlFieldExpression.Create(eventExpression);
MemberExpression eventHandlerExpression = node.Right as MemberExpression;
string eventHandlerName = eventHandlerExpression.Name.ToString();
diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonResolverContext.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonResolverContext.cs
index c98cdfe6f3..c8f6129d3e 100644
--- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonResolverContext.cs
+++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonResolverContext.cs
@@ -4,6 +4,8 @@
using System;
using System.Collections;
using System.Collections.Generic;
+
+using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
namespace ICSharpCode.PythonBinding
@@ -118,7 +120,7 @@ namespace ICSharpCode.PythonBinding
public bool PartialNamespaceExistsInProjectReferences(string name)
{
- foreach (IProjectContent referencedContent in projectContent.ReferencedContents) {
+ foreach (IProjectContent referencedContent in projectContent.ThreadSafeGetReferencedContents()) {
if (PartialNamespaceExists(referencedContent, name)) {
return true;
}
diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadFormWithButtonFollowedByTimerTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadFormWithButtonFollowedByTimerTestFixture.cs
new file mode 100644
index 0000000000..6ba6b96b49
--- /dev/null
+++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadFormWithButtonFollowedByTimerTestFixture.cs
@@ -0,0 +1,108 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.IO;
+using System.Windows.Forms;
+
+using ICSharpCode.PythonBinding;
+using ICSharpCode.Scripting.Tests.Utils;
+using NUnit.Framework;
+using PythonBinding.Tests.Utils;
+
+namespace PythonBinding.Tests.Designer
+{
+ ///
+ /// Fix ArgumentNullException when form has a button followed by a timer and the
+ /// first timer statement is the setting of the event handler.
+ ///
+ [TestFixture]
+ public class LoadFormWithButtonFollowedByTimerTestFixture : LoadFormTestFixtureBase
+ {
+ MockPropertyDescriptor mockTickPropertyDescriptor;
+
+ public override string PythonCode {
+ get {
+ return
+ "import System.Drawing\r\n" +
+ "import System.Windows.Forms\r\n" +
+ "\r\n" +
+ "from System.Drawing import *\r\n" +
+ "from System.Windows.Forms import *\r\n" +
+ "\r\n" +
+ "class MainForm(Form):\r\n" +
+ " def __init__(self):\r\n" +
+ " self.InitializeComponent()\r\n" +
+ "\r\n" +
+ " def InitializeComponent(self):\r\n" +
+ " self._components = System.ComponentModel.Container()\r\n" +
+ " self._button1 = System.Windows.Forms.Button()\r\n" +
+ " self._timer1 = System.Windows.Forms.Timer(self._components)\r\n" +
+ " self.SuspendLayout()\r\n" +
+ " # \r\n" +
+ " # button1\r\n" +
+ " # \r\n" +
+ " self._button1.Location = System.Drawing.Point(37, 29)\r\n" +
+ " self._button1.Name = \"button1\"\r\n" +
+ " self._button1.Size = System.Drawing.Size(75, 23)\r\n" +
+ " self._button1.TabIndex = 0\r\n" +
+ " self._button1.Text = \"button1\"\r\n" +
+ " self._button1.UseVisualStyleBackColor = True\r\n" +
+ " # \r\n" +
+ " # timer1\r\n" +
+ " # \r\n" +
+ " self._timer1.Tick += self.Timer1Tick\r\n" +
+ " # \r\n" +
+ " # MainForm\r\n" +
+ " # \r\n" +
+ " self.ClientSize = System.Drawing.Size(284, 264)\r\n" +
+ " self.Controls.Add(self._button1)\r\n" +
+ " self.Name = \"MainForm\"\r\n" +
+ " self.Text = \"PyWinTest\"\r\n" +
+ " self.ResumeLayout(False)\r\n" +
+ "\r\n" +
+ "\r\n" +
+ " def Timer1Tick(self, sender, e):\r\n" +
+ " pass";
+ }
+ }
+
+ public override void BeforeSetUpFixture()
+ {
+ mockTickPropertyDescriptor = new MockPropertyDescriptor("Tick", null, false);
+ ComponentCreator.SetEventPropertyDescriptor(mockTickPropertyDescriptor);
+ }
+
+ [Test]
+ public void EventDescriptorUsedToGetEventProperty()
+ {
+ Assert.IsNotNull(ComponentCreator.EventDescriptorPassedToGetEventProperty);
+ }
+
+ [Test]
+ public void EventDescriptorNameUsedToGetEventPropertyIsTick()
+ {
+ Assert.AreEqual("Tick", ComponentCreator.EventDescriptorPassedToGetEventProperty.Name);
+ }
+
+ [Test]
+ public void GetPropertyValueSetForTimer()
+ {
+ string value = mockTickPropertyDescriptor.GetValue(null) as String;
+ Assert.AreEqual("Timer1Tick", value);
+ }
+
+ [Test]
+ public void GetComponentUsedWhenSettingTickHandler()
+ {
+ IComponent expectedComponent = ComponentCreator.GetComponent("timer1");
+
+ object component = mockTickPropertyDescriptor.GetSetValueComponent();
+
+ Assert.AreEqual(expectedComponent, component);
+ }
+ }
+}
diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj b/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj
index 420b4455a0..89fead0f8e 100644
--- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj
+++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj
@@ -265,6 +265,7 @@
+
diff --git a/src/AddIns/BackendBindings/VBNetBinding/Project/Src/FormattingStrategy/VBNetFormattingStrategy.cs b/src/AddIns/BackendBindings/VBNetBinding/Project/Src/FormattingStrategy/VBNetFormattingStrategy.cs
index 4a751e7d6e..5fa9e46fec 100644
--- a/src/AddIns/BackendBindings/VBNetBinding/Project/Src/FormattingStrategy/VBNetFormattingStrategy.cs
+++ b/src/AddIns/BackendBindings/VBNetBinding/Project/Src/FormattingStrategy/VBNetFormattingStrategy.cs
@@ -143,7 +143,7 @@ namespace ICSharpCode.VBNetBinding
InsertDocumentationComments(editor, lineNr, cursorOffset);
}
- if (ch == '\n' && lineAboveText != null) {
+ if (ch == '\n' && lineAbove != null) {
if (LanguageUtils.IsInsideDocumentationComment(editor, lineAbove, lineAbove.EndOffset)) {
editor.Document.Insert(cursorOffset, "''' ");
return;
@@ -410,7 +410,7 @@ namespace ICSharpCode.VBNetBinding
while ((currentToken = lexer.NextToken()).Kind != Tokens.EOF) {
if (prevToken == null)
prevToken = currentToken;
- if (IsBlockStart(lexer, currentToken, prevToken)) {
+ if (IsBlockStart(lexer, currentToken, prevToken) && !IsAutomaticPropertyWithDefaultValue(lexer, currentToken, prevToken)) {
if ((tokens.Count > 0 && tokens.Peek().Kind != Tokens.Interface) || IsDeclaration(currentToken.Kind))
tokens.Push(currentToken);
}
@@ -438,6 +438,30 @@ namespace ICSharpCode.VBNetBinding
return false;
}
+ static bool IsAutomaticPropertyWithDefaultValue(ILexer lexer, Token currentToken, Token prevToken)
+ {
+ if (currentToken.Kind != Tokens.Property)
+ return false;
+ lexer.StartPeek();
+
+ int parenthesesNesting = 0;
+
+ // look for parameter list, = or EOL
+ Token t;
+ while ((t = lexer.Peek()).Kind != Tokens.EOF) {
+ if (t.Kind == Tokens.OpenParenthesis)
+ parenthesesNesting++;
+ if (t.Kind == Tokens.CloseParenthesis)
+ parenthesesNesting--;
+ if (parenthesesNesting == 0 && t.Kind == Tokens.Assign)
+ return true;
+ if (t.Kind == Tokens.EOL)
+ return false;
+ }
+
+ return false;
+ }
+
static Token GetClosestMissing(List missingEnds, VBStatement statement, ITextEditor editor, int lineNr)
{
Token closest = null;
@@ -612,7 +636,7 @@ namespace ICSharpCode.VBNetBinding
Indent(editor, indentation, new string(' ', endColumn - startColumn - 1));
}
- if (!inInterface && !isMustOverride && !isDeclare && !isDelegate) {
+ if (!inInterface && !isMustOverride && !isDeclare && !isDelegate && !IsAutomaticPropertyWithDefaultValue(lexer, currentToken, prevToken)) {
Indent(editor, indentation);
if (currentToken.Kind == Tokens.Select)
diff --git a/src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/ProjectImports.cs b/src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/ProjectImports.cs
index f189be0d58..766ef099d3 100644
--- a/src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/ProjectImports.cs
+++ b/src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/ProjectImports.cs
@@ -35,7 +35,7 @@ namespace ICSharpCode.VBNetBinding.OptionPanels
}
IProjectContent projectContent = ParserService.GetProjectContent(project);
- foreach(IProjectContent refProjectContent in projectContent.ReferencedContents) {
+ foreach(IProjectContent refProjectContent in projectContent.ThreadSafeGetReferencedContents()) {
AddNamespaces(refProjectContent);
}
diff --git a/src/AddIns/BackendBindings/VBNetBinding/Test/FormattingStrategy/EndSubTests.cs b/src/AddIns/BackendBindings/VBNetBinding/Test/FormattingStrategy/EndSubTests.cs
index 01d104c1b8..fd3624b556 100644
--- a/src/AddIns/BackendBindings/VBNetBinding/Test/FormattingStrategy/EndSubTests.cs
+++ b/src/AddIns/BackendBindings/VBNetBinding/Test/FormattingStrategy/EndSubTests.cs
@@ -173,5 +173,52 @@ namespace ICSharpCode.VBNetBinding.Tests
RunTest(code, cursorOffset, expectedCode, expectedOffset, '\n');
}
+
+ [Test]
+ public void AutomaticPropertyWithInitializer()
+ {
+ string code = "Public Class Foo\r\n" +
+ "\tPublic Property Bar As Boolean = True\r\n" +
+ "\r\n" + // This extra new line is required. This is the new line just entered by the user.
+ "End Class";
+
+ string bar = "= True\r\n";
+ int cursorOffset = code.IndexOf(bar) + bar.Length;
+
+ string expectedCode = "Public Class Foo\r\n" +
+ "\tPublic Property Bar As Boolean = True\r\n" +
+ "\t\r\n" +
+ "End Class";
+
+ int expectedOffset = ("Public Class Foo\r\n" +
+ "\tPublic Property Bar As Boolean = True\r\n" +
+ "\t").Length;
+
+ RunTest(code, cursorOffset, expectedCode, expectedOffset, '\n');
+ }
+
+ [Test]
+ public void StandardProperty()
+ {
+ string code = "Public Class Foo\r\n" +
+ "\tPublic Property Bar As Boolean\r\n" +
+ "\r\n" + // This extra new line is required. This is the new line just entered by the user.
+ "End Class";
+
+ string bar = "As Boolean\r\n";
+ int cursorOffset = code.IndexOf(bar) + bar.Length;
+
+ string expectedCode = "Public Class Foo\r\n" +
+ "\tPublic Property Bar As Boolean\r\n" +
+ "\t\t\r\n" +
+ "\tEnd Property\r\n" +
+ "End Class";
+
+ int expectedOffset = ("Public Class Foo\r\n" +
+ "\tPublic Property Bar As Boolean\r\n" +
+ "\t\t").Length;
+
+ RunTest(code, cursorOffset, expectedCode, expectedOffset, '\n');
+ }
}
}
diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataHelper.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataHelper.cs
index 6aec28a8c5..6ab91827e8 100644
--- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataHelper.cs
+++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataHelper.cs
@@ -311,7 +311,7 @@ namespace ICSharpCode.XamlBinding
{
List list = new List();
- foreach (IProjectContent content in projectContent.ReferencedContents) {
+ foreach (IProjectContent content in projectContent.ThreadSafeGetReferencedContents()) {
foreach (IAttribute att in content.GetAssemblyAttributes()) {
if (att.PositionalArguments.Count == 2
&& att.AttributeType.FullyQualifiedName == "System.Windows.Markup.XmlnsDefinitionAttribute") {
diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompilationUnit.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompilationUnit.cs
index 7ac7da7d53..dbba1cbb8b 100644
--- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompilationUnit.cs
+++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompilationUnit.cs
@@ -2,10 +2,12 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
-using System.Linq;
-using ICSharpCode.SharpDevelop.Dom;
using System.Collections;
using System.Collections.Generic;
+using System.Linq;
+
+using ICSharpCode.SharpDevelop;
+using ICSharpCode.SharpDevelop.Dom;
namespace ICSharpCode.XamlBinding
{
@@ -81,7 +83,7 @@ namespace ICSharpCode.XamlBinding
IReturnType type = FindTypeInAssembly(pc, xmlNamespace, className);
if (type != null)
return type;
- foreach (IProjectContent p in pc.ReferencedContents) {
+ foreach (IProjectContent p in pc.ThreadSafeGetReferencedContents()) {
type = FindTypeInAssembly(p, xmlNamespace, className);
if (type != null)
return type;
@@ -117,7 +119,7 @@ namespace ICSharpCode.XamlBinding
else {
var list = new List();
AddNamespaceMembersInAssembly(pc, xmlNamespace, list);
- foreach (IProjectContent p in pc.ReferencedContents) {
+ foreach (IProjectContent p in pc.ThreadSafeGetReferencedContents()) {
AddNamespaceMembersInAssembly(p, xmlNamespace, list);
}
return list.OfType();
diff --git a/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs b/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs
index 216aab5df9..9632eb7b95 100644
--- a/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs
+++ b/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs
@@ -41,5 +41,26 @@ namespace ICSharpCode.SharpDevelop.Services
// Properties for the DebuggeeExceptionForm
public FormWindowState DebuggeeExceptionWindowState { get; set; }
+
+ ///
+ /// Used to update status of some debugger properties while debugger is running.
+ ///
+ internal static void ResetStatus(Action resetStatus)
+ {
+ Process proc = WindowsDebugger.CurrentProcess;
+ // debug session is running
+ if (proc != null) {
+ bool wasPausedNow = false;
+ // if it is not paused, break execution
+ if (!proc.IsPaused) {
+ proc.Break();
+ wasPausedNow = true;
+ }
+ resetStatus(proc);
+ // continue if it was not paused before
+ if (wasPausedNow)
+ proc.AsyncContinue();
+ }
+ }
}
}
diff --git a/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml.cs b/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml.cs
index f467805274..dd878773cf 100644
--- a/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml.cs
+++ b/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml.cs
@@ -50,19 +50,7 @@ namespace Debugger.AddIn.Options
public override bool SaveOptions()
{
bool result = base.SaveOptions();
- Process proc = WindowsDebugger.CurrentProcess;
- // debug session is running
- if (proc != null) {
- bool wasPausedNow = false;
- // if it is not paused, break execution
- if (!proc.IsPaused) {
- proc.Break();
- wasPausedNow = true;
- }
- proc.Debugger.ResetJustMyCodeStatus();
- // continue if it was not paused before
- if (wasPausedNow) proc.AsyncContinue();
- }
+ DebuggingOptions.ResetStatus(proc => proc.Debugger.ResetJustMyCodeStatus());
return result;
}
}
diff --git a/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingSymbolsPanel.cs b/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingSymbolsPanel.cs
index 8abeb8e487..2e0329b2a6 100644
--- a/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingSymbolsPanel.cs
+++ b/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingSymbolsPanel.cs
@@ -30,11 +30,11 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
public override bool StorePanelContents()
{
DebuggingOptions.Instance.SymbolsSearchPaths = pathList.GetList();
- Process proc = WindowsDebugger.CurrentProcess;
- if (proc != null) {
- proc.Debugger.ReloadModuleSymbols();
- proc.Debugger.ResetJustMyCodeStatus();
- }
+ DebuggingOptions.ResetStatus(
+ proc => {
+ proc.Debugger.ReloadModuleSymbols();
+ proc.Debugger.ResetJustMyCodeStatus();
+ });
return true;
}
}
diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/CallStackPad.xaml.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/CallStackPad.xaml.cs
index 0edd6f1f3d..960339446d 100644
--- a/src/AddIns/Debugger/Debugger.AddIn/Pads/CallStackPad.xaml.cs
+++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/CallStackPad.xaml.cs
@@ -12,6 +12,7 @@ using System.Windows.Media;
using Debugger;
using Debugger.AddIn.TreeModel;
using ICSharpCode.Core;
+using ICSharpCode.SharpDevelop.Gui.Pads;
using ICSharpCode.SharpDevelop.Services;
namespace ICSharpCode.SharpDevelop.Gui.Pads
@@ -21,10 +22,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
///
public partial class CallStackPadContent : UserControl
{
+ CallStackPad callStackPad;
Process debuggedProcess;
- public CallStackPadContent()
+ public CallStackPadContent(CallStackPad pad)
{
+ this.callStackPad = pad;
InitializeComponent();
view.ContextMenu = CreateMenu();
@@ -40,7 +43,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
extMethodsItem.IsChecked = DebuggingOptions.Instance.ShowExternalMethods;
extMethodsItem.Click += delegate {
extMethodsItem.IsChecked = DebuggingOptions.Instance.ShowExternalMethods = !DebuggingOptions.Instance.ShowExternalMethods;
- CallStackPad.InvalidateCallstackPad();
+ callStackPad.InvalidatePad();
};
MenuItem moduleItem = new MenuItem();
@@ -49,7 +52,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
moduleItem.Click += delegate {
moduleItem.IsChecked = DebuggingOptions.Instance.ShowModuleNames = !DebuggingOptions.Instance.ShowModuleNames;
((GridView)view.View).Columns[0].Width = DebuggingOptions.Instance.ShowModuleNames ? 100d : 0d;
- CallStackPad.InvalidateCallstackPad();
+ callStackPad.InvalidatePad();
};
MenuItem argNamesItem = new MenuItem();
@@ -57,7 +60,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
argNamesItem.IsChecked = DebuggingOptions.Instance.ShowArgumentNames;
argNamesItem.Click += delegate {
argNamesItem.IsChecked = DebuggingOptions.Instance.ShowArgumentNames = !DebuggingOptions.Instance.ShowArgumentNames;
- CallStackPad.InvalidateCallstackPad();
+ callStackPad.InvalidatePad();
};
MenuItem argValuesItem = new MenuItem();
@@ -65,7 +68,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
argValuesItem.IsChecked = DebuggingOptions.Instance.ShowArgumentValues;
argValuesItem.Click += delegate {
argValuesItem.IsChecked = DebuggingOptions.Instance.ShowArgumentValues = !DebuggingOptions.Instance.ShowArgumentValues;
- CallStackPad.InvalidateCallstackPad();
+ callStackPad.InvalidatePad();
};
MenuItem lineItem = new MenuItem();
@@ -74,7 +77,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
lineItem.Click += delegate {
lineItem.IsChecked = DebuggingOptions.Instance.ShowLineNumbers = !DebuggingOptions.Instance.ShowLineNumbers;
((GridView)view.View).Columns[2].Width = DebuggingOptions.Instance.ShowLineNumbers ? 50d : 0d;
- CallStackPad.InvalidateCallstackPad();
+ callStackPad.InvalidatePad();
};
return new ContextMenu() {
@@ -98,12 +101,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
if (debuggedProcess != null) {
debuggedProcess.Paused += debuggedProcess_Paused;
}
- CallStackPad.InvalidateCallstackPad();
+ callStackPad.InvalidatePad();
}
void debuggedProcess_Paused(object sender, ProcessEventArgs e)
{
- CallStackPad.InvalidateCallstackPad();
+ callStackPad.InvalidatePad();
}
void View_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
@@ -150,13 +153,13 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
var items = new ObservableCollection();
using(new PrintTimes("Callstack refresh")) {
bool showExternalMethods = DebuggingOptions.Instance.ShowExternalMethods;
- bool previousItemIsExternalMethod = false;
+ bool previousItemIsExternalMethod = false;
- debuggedProcess.EnqueueForEach(
- Dispatcher,
- debuggedProcess.SelectedThread.GetCallstack(100),
- f => items.AddIfNotNull(CreateItem(f, showExternalMethods, ref previousItemIsExternalMethod))
- );
+ debuggedProcess.EnqueueForEach(
+ Dispatcher,
+ debuggedProcess.SelectedThread.GetCallstack(100),
+ f => items.AddIfNotNull(CreateItem(f, showExternalMethods, ref previousItemIsExternalMethod))
+ );
}
view.ItemsSource = items;
}
@@ -287,7 +290,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
protected override void InitializeComponents()
{
- callStackList = new CallStackPadContent();
+ callStackList = new CallStackPadContent(this);
}
protected override void SelectProcess(Process process)
@@ -299,11 +302,5 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
{
callStackList.RefreshPad();
}
-
- public static void InvalidateCallstackPad()
- {
- if (instance != null)
- instance.InvalidatePad();
- }
}
}
diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/WatchPadCommands.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/WatchPadCommands.cs
index 8faa9a6054..051113efa6 100644
--- a/src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/WatchPadCommands.cs
+++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/WatchPadCommands.cs
@@ -29,20 +29,13 @@ namespace Debugger.AddIn
var inputWindow = new WatchInputBox(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.AddWatch}"),
StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.EnterExpression}"));
inputWindow.Owner = ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWindow;
- var result = inputWindow.ShowDialog();
- if (!result.HasValue || !result.Value)
+ if (inputWindow.ShowDialog() != true)
return;
string input = inputWindow.CommandText;
if (!string.IsNullOrEmpty(input)) {
- // get language
- if (ProjectService.CurrentProject == null) return;
-
- string language = ProjectService.CurrentProject.Language;
-
- var text = new TextNode(null, input,
- language == "VB" || language == "VBNet" ? SupportedLanguage.VBNet : SupportedLanguage.CSharp).ToSharpTreeNode();
+ var text = new TextNode(null, input, inputWindow.ScriptLanguage).ToSharpTreeNode();
var list = pad.WatchList;
if(!list.WatchItems.Any(n => text.Node.FullName == ((TreeNodeWrapper)n).Node.FullName))
diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/TreeNodeWrapper.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/TreeNodeWrapper.cs
index 6c8dd6ac22..048c0a26b2 100644
--- a/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/TreeNodeWrapper.cs
+++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/TreeNodeWrapper.cs
@@ -39,6 +39,16 @@ namespace Debugger.AddIn.Pads.Controls
get { return Node.HasChildNodes; }
}
+ public override bool CanDelete()
+ {
+ return Parent is WatchRootNode;
+ }
+
+ public override void Delete()
+ {
+ Parent.Children.Remove(this);
+ }
+
protected override void LoadChildren()
{
if (Node.HasChildNodes) {
diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchList.xaml.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchList.xaml.cs
index 07ad0ec678..2809cb6adf 100644
--- a/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchList.xaml.cs
+++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchList.xaml.cs
@@ -69,17 +69,18 @@ namespace Debugger.AddIn.Pads.Controls
void WatchListAutoCompleteCellCommandEntered(object sender, EventArgs e)
{
- if (SelectedNode == null) return;
+ var selectedNode = SelectedNode;
+ if (selectedNode == null) return;
if (WatchType != WatchListType.Watch) return;
var cell = ((WatchListAutoCompleteCell)sender);
- SelectedNode.Node.Name = cell.CommandText;
+ selectedNode.Node.Name = cell.CommandText;
myList.UnselectAll();
if (WatchType == WatchListType.Watch && WatchPad.Instance != null) {
WatchPad.Instance.InvalidatePad();
}
- SelectedNode.IsEditing = false;
+ selectedNode.IsEditing = false;
}
void MyListPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchListAutoCompleteCell.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchListAutoCompleteCell.cs
index 60e8147132..4cf639972f 100644
--- a/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchListAutoCompleteCell.cs
+++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchListAutoCompleteCell.cs
@@ -25,7 +25,7 @@ namespace Debugger.AddIn.Pads.Controls
{
public partial class WatchListAutoCompleteCell : UserControl
{
- private string language;
+ string language;
protected ConsoleControl console;
@@ -33,7 +33,7 @@ namespace Debugger.AddIn.Pads.Controls
DependencyProperty.Register("CommandText", typeof(string), typeof(WatchListAutoCompleteCell),
new UIPropertyMetadata(null, new PropertyChangedCallback(OnCommandTextChanged)));
- private NRefactoryResolver resolver;
+ NRefactoryResolver resolver;
public event EventHandler CommandEntered;
@@ -72,7 +72,7 @@ namespace Debugger.AddIn.Pads.Controls
this.Process = debugger.DebuggedProcess;
}
- private Process Process { get; set; }
+ Process Process { get; set; }
///
/// Gets/sets the command text displayed at the command prompt.
@@ -82,13 +82,13 @@ namespace Debugger.AddIn.Pads.Controls
set { console.CommandText = value; }
}
- private ITextEditor TextEditor {
+ ITextEditor TextEditor {
get {
return console.TextEditor;
}
}
- private void console_TextAreaPreviewKeyDown(object sender, KeyEventArgs e)
+ void console_TextAreaPreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Return || e.Key == Key.Escape) {
@@ -106,7 +106,7 @@ namespace Debugger.AddIn.Pads.Controls
}
}
- private void console_LostFocus(object sender, RoutedEventArgs e)
+ void console_LostFocus(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(CommandText) || !this.CheckSyntax())
return;
@@ -115,15 +115,15 @@ namespace Debugger.AddIn.Pads.Controls
CommandEntered(this, EventArgs.Empty);
}
- private bool CheckSyntax()
+ bool CheckSyntax()
{
string command = CommandText;
// FIXME workaround the NRefactory issue that needs a ; at the end
if (language == "C#" || language == "CSharp") {
- if(!command.EndsWith(";"))
+ if (!command.EndsWith(";"))
command += ";";
- // FIXME only one string should be available; highlighting expects C#, supproted language, CSharp
+ // FIXME only one string should be available; highlighting expects C#, supported language, CSharp
language = "CSharp";
}
@@ -139,7 +139,7 @@ namespace Debugger.AddIn.Pads.Controls
return true;
}
- private void consoleControl_TextAreaTextEntered(object sender, TextCompositionEventArgs e)
+ void consoleControl_TextAreaTextEntered(object sender, TextCompositionEventArgs e)
{
foreach (char ch in e.Text) {
if (ch == '.') {
@@ -148,21 +148,15 @@ namespace Debugger.AddIn.Pads.Controls
}
}
- private void ShowDotCompletion(string currentText)
+ void ShowDotCompletion(string currentText)
{
var seg = Process.SelectedStackFrame.NextStatement;
-
var expressionFinder = ParserService.GetExpressionFinder(seg.Filename);
var info = ParserService.GetParseInformation(seg.Filename);
-
string text = ParserService.GetParseableFileContent(seg.Filename).Text;
-
int currentOffset = TextEditor.Caret.Offset - console.CommandOffset - 1;
-
var expr = expressionFinder.FindExpression(currentText, currentOffset);
-
expr.Region = new DomRegion(seg.StartLine, seg.StartColumn, seg.EndLine, seg.EndColumn);
-
var rr = resolver.Resolve(expr, info, text);
if (rr != null) {
@@ -170,9 +164,12 @@ namespace Debugger.AddIn.Pads.Controls
}
}
- private static void OnCommandTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
+ static void OnCommandTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
var cell = d as WatchListAutoCompleteCell;
- cell.CommandText = e.NewValue.ToString();
+ if (cell != null && e.NewValue != null) {
+ cell.CommandText = e.NewValue.ToString();
+ }
}
}
}
\ No newline at end of file
diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/WatchInputBox.xaml.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/WatchInputBox.xaml.cs
index e2cb564716..5e0ea97792 100644
--- a/src/AddIns/Debugger/Debugger.AddIn/Pads/WatchInputBox.xaml.cs
+++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/WatchInputBox.xaml.cs
@@ -13,7 +13,9 @@ using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Dom.NRefactoryResolver;
+using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
+using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Gui.Pads;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Services;
@@ -25,8 +27,12 @@ namespace Debugger.AddIn.Pads
///
public partial class WatchInputBox : BaseWatchBox
{
- private NRefactoryResolver resolver;
- private string language;
+ NRefactoryResolver resolver;
+ SupportedLanguage language;
+
+ public SupportedLanguage ScriptLanguage {
+ get { return language; }
+ }
public WatchInputBox(string text, string caption) : base()
{
@@ -37,18 +43,20 @@ namespace Debugger.AddIn.Pads
this.Title = StringParser.Parse(caption);
this.ConsolePanel.Content = console;
- if (ProjectService.CurrentProject == null) return;
-
- // get language
- language = ProjectService.CurrentProject.Language;
- resolver = new NRefactoryResolver(LanguageProperties.GetLanguage(language));
-
- // FIXME set language
- if (language == "VB" || language == "VBNet") {
- console.SetHighlighting("VBNET");
- } else {
- language = "C#";
- console.SetHighlighting("C#");
+ if (ProjectService.CurrentProject == null)
+ language = GetLanguageFromActiveViewContent();
+ else
+ language = GetLanguage(ProjectService.CurrentProject.Language);
+
+ resolver = new NRefactoryResolver(LanguageProperties.GetLanguage(language.ToString()));
+
+ switch (language) {
+ case SupportedLanguage.CSharp:
+ console.SetHighlighting("C#");
+ break;
+ case SupportedLanguage.VBNet:
+ console.SetHighlighting("VBNET");
+ break;
}
// get process
@@ -72,7 +80,7 @@ namespace Debugger.AddIn.Pads
}
}
- private void ShowDotCompletion(string currentText)
+ void ShowDotCompletion(string currentText)
{
var seg = Process.SelectedStackFrame.NextStatement;
@@ -94,20 +102,15 @@ namespace Debugger.AddIn.Pads
}
}
- private bool CheckSyntax()
+ bool CheckSyntax()
{
string command = console.CommandText.Trim();
// FIXME workaround the NRefactory issue that needs a ; at the end
- if (language == "C#") {
- if(!command.EndsWith(";"))
- command += ";";
- // FIXME only one string should be available; highlighting expects C#, supproted language, CSharp
- language = "CSharp";
- }
+ if (language == SupportedLanguage.CSharp && !command.EndsWith(";"))
+ command += ";";
- SupportedLanguage supportedLanguage = (SupportedLanguage)Enum.Parse(typeof(SupportedLanguage), language, true);
- using (var parser = ParserFactory.CreateParser(supportedLanguage, new StringReader(command))) {
+ using (var parser = ParserFactory.CreateParser(language, new StringReader(command))) {
parser.ParseExpression();
if (parser.Errors.Count > 0) {
MessageService.ShowError(parser.Errors.ErrorOutput);
@@ -118,7 +121,38 @@ namespace Debugger.AddIn.Pads
return true;
}
- private void AcceptButton_Click(object sender, RoutedEventArgs e)
+ SupportedLanguage GetLanguage(string language)
+ {
+ if ("VBNet".Equals(language, StringComparison.OrdinalIgnoreCase)
+ || "VB".Equals(language, StringComparison.OrdinalIgnoreCase)
+ || "VB.NET".Equals(language, StringComparison.OrdinalIgnoreCase))
+ return SupportedLanguage.VBNet;
+
+ return SupportedLanguage.CSharp;
+ }
+
+ ///
+ /// Gets the language used in the currently active view content. This is useful, when there is no project
+ /// opened and we still want to add watches (i.e. the debugger is attached to an existing process without a solution).
+ ///
+ SupportedLanguage GetLanguageFromActiveViewContent()
+ {
+ ITextEditorProvider provider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorProvider;
+
+ if (provider != null && provider.TextEditor != null) {
+ string extension = Path.GetExtension(provider.TextEditor.FileName).ToLowerInvariant();
+ switch (extension) {
+ case ".cs":
+ return SupportedLanguage.CSharp;
+ case ".vb":
+ return SupportedLanguage.VBNet;
+ }
+ }
+
+ return SupportedLanguage.CSharp;
+ }
+
+ void AcceptButton_Click(object sender, RoutedEventArgs e)
{
if (!this.CheckSyntax())
return;
@@ -127,7 +161,7 @@ namespace Debugger.AddIn.Pads
this.Close();
}
- private void CancelButton_Click(object sender, RoutedEventArgs e)
+ void CancelButton_Click(object sender, RoutedEventArgs e)
{
DialogResult = false;
this.Close();
diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs
index 77da1ed9f5..f4b9e6241f 100644
--- a/src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs
+++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs
@@ -55,12 +55,11 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
watchList = new WatchList(WatchListType.Watch);
watchList.ContextMenu = MenuService.CreateContextMenu(this, "/SharpDevelop/Pads/WatchPad/ContextMenu");
- watchList.MouseDoubleClick += watchList_DoubleClick;
- watchList.KeyUp += watchList_KeyUp;
+ watchList.MouseDoubleClick += WatchListDoubleClick;
watchList.WatchItems.CollectionChanged += OnWatchItemsCollectionChanged;
panel.Children.Add(watchList);
- panel.KeyUp += new KeyEventHandler(panel_KeyUp);
+ panel.KeyDown += PanelKeyDown;
// wire events that influence the items
LoadSavedNodes();
@@ -122,23 +121,15 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
#endregion
- void panel_KeyUp(object sender, KeyEventArgs e)
+ void PanelKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Insert) {
AddNewWatch();
e.Handled = true;
}
}
-
- void watchList_KeyUp(object sender, KeyEventArgs e)
- {
- if (e.Key == Key.Delete) {
- RemoveWatchCommand cmd = new RemoveWatchCommand { Owner = this };
- cmd.Run();
- }
- }
- void watchList_DoubleClick(object sender, MouseEventArgs e)
+ void WatchListDoubleClick(object sender, MouseEventArgs e)
{
if (watchList.SelectedNode == null)
{
diff --git a/src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs b/src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs
index 1ac7c330b5..7842aa06fa 100644
--- a/src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs
+++ b/src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs
@@ -74,7 +74,7 @@ namespace Debugger
void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread)
{
EnterCallback(pausedReason, name, pThread.GetProcess());
- process.SelectedThread = process.Threads[pThread];
+ process.SelectedThread = process.GetThread(pThread);
}
void ExitCallback()
@@ -128,7 +128,7 @@ namespace Debugger
{
EnterCallback(PausedReason.StepComplete, "StepComplete (" + reason.ToString() + ")", pThread);
- Thread thread = process.Threads[pThread];
+ Thread thread = process.GetThread(pThread);
Stepper stepper = process.GetStepper(pStepper);
StackFrame currentStackFrame = process.SelectedThread.MostRecentStackFrame;
@@ -378,7 +378,7 @@ namespace Debugger
EnterCallback(PausedReason.Other, "NameChange: pThread", pThread);
- Thread thread = process.Threads[pThread];
+ Thread thread = process.GetThread(pThread);
thread.NotifyNameChanged();
ExitCallback();
@@ -445,7 +445,7 @@ namespace Debugger
if (process.Threads.Contains(pThread)) {
EnterCallback(PausedReason.Other, "ExitThread " + pThread.GetID(), pThread);
- process.Threads[pThread].NotifyExited();
+ process.GetThread(pThread).NotifyExited();
} else {
EnterCallback(PausedReason.Other, "ExitThread " + pThread.GetID(), process.CorProcess);
diff --git a/src/AddIns/Debugger/Debugger.Core/Process.cs b/src/AddIns/Debugger/Debugger.Core/Process.cs
index 3ca68f7a06..268bd63f3f 100644
--- a/src/AddIns/Debugger/Debugger.Core/Process.cs
+++ b/src/AddIns/Debugger/Debugger.Core/Process.cs
@@ -233,6 +233,18 @@ namespace Debugger
return written;
}
+ internal Thread GetThread(ICorDebugThread corThread)
+ {
+ foreach(Thread thread in this.Threads) {
+ if (thread.CorThread == corThread) {
+ return thread;
+ }
+ }
+ Thread t = new Thread(this, corThread);
+ this.Threads.Add(t);
+ return t;
+ }
+
#region Exceptions
public event EventHandler ExceptionThrown;
diff --git a/src/AddIns/Debugger/Debugger.Core/ThreadCollection.cs b/src/AddIns/Debugger/Debugger.Core/ThreadCollection.cs
index 500b52aa46..b8bd30ef1c 100644
--- a/src/AddIns/Debugger/Debugger.Core/ThreadCollection.cs
+++ b/src/AddIns/Debugger/Debugger.Core/ThreadCollection.cs
@@ -38,16 +38,5 @@ namespace Debugger
}
return false;
}
-
- internal Thread this[ICorDebugThread corThread] {
- get {
- foreach(Thread thread in this) {
- if (thread.CorThread == corThread) {
- return thread;
- }
- }
- throw new DebuggerException("Thread is not in collection");
- }
- }
}
}
diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs
index 25b4989d99..c5be104c46 100644
--- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs
+++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs
@@ -275,7 +275,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
{
if (trackedFeature != null)
trackedFeature.EndTracking();
- this.PrimaryFile.IsDirtyChanged -= PrimaryFile_IsDirtyChanged;
+ if (PrimaryFile != null)
+ this.PrimaryFile.IsDirtyChanged -= PrimaryFile_IsDirtyChanged;
base.Dispose();
BookmarksDetach();
codeEditor.Dispose();
diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs
index 600cba254f..cbe6842867 100644
--- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs
+++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs
@@ -39,7 +39,6 @@ namespace ICSharpCode.AvalonEdit.AddIn
{
if (!disposed) {
changeWatcher.ChangeOccurred -= ChangeOccurred;
- changeWatcher.Dispose();
disposed = true;
}
}
diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs
index c821cccfa5..bbe07412da 100644
--- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs
+++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs
@@ -610,6 +610,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
if (errorPainter != null)
errorPainter.Dispose();
+ if (changeWatcher != null)
+ changeWatcher.Dispose();
this.Document = null;
DisposeTextEditor(primaryTextEditor);
if (secondaryTextEditor != null)
diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/FoldingCommands.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/FoldingCommands.cs
index 6ee83c1c44..5d777028ac 100644
--- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/FoldingCommands.cs
+++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/FoldingCommands.cs
@@ -16,14 +16,14 @@ namespace ICSharpCode.AvalonEdit.AddIn.Commands
{
ITextEditorProvider provider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorProvider;
ITextEditor editor = provider.TextEditor;
- ParserFoldingStrategy strategy = editor.GetService(typeof(ParserFoldingStrategy)) as ParserFoldingStrategy;
+ FoldingManager foldingManager = editor.GetService(typeof(FoldingManager)) as FoldingManager;
- if (strategy != null) {
+ if (foldingManager != null) {
// look for folding on this line:
- FoldingSection folding = strategy.FoldingManager.GetNextFolding(editor.Document.PositionToOffset(editor.Caret.Line, 1));
+ FoldingSection folding = foldingManager.GetNextFolding(editor.Document.PositionToOffset(editor.Caret.Line, 1));
if (folding == null || editor.Document.GetLineForOffset(folding.StartOffset).LineNumber != editor.Caret.Line) {
// no folding found on current line: find innermost folding containing the caret
- folding = strategy.FoldingManager.GetFoldingsContaining(editor.Caret.Offset).LastOrDefault();
+ folding = foldingManager.GetFoldingsContaining(editor.Caret.Offset).LastOrDefault();
}
if (folding != null) {
folding.IsFolded = !folding.IsFolded;
@@ -38,17 +38,17 @@ namespace ICSharpCode.AvalonEdit.AddIn.Commands
{
ITextEditorProvider provider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorProvider;
ITextEditor editor = provider.TextEditor;
- ParserFoldingStrategy strategy = editor.GetService(typeof(ParserFoldingStrategy)) as ParserFoldingStrategy;
+ FoldingManager foldingManager = editor.GetService(typeof(FoldingManager)) as FoldingManager;
- if (strategy != null) {
+ if (foldingManager != null) {
bool doFold = true;
- foreach (FoldingSection fm in strategy.FoldingManager.AllFoldings) {
+ foreach (FoldingSection fm in foldingManager.AllFoldings) {
if (fm.IsFolded) {
doFold = false;
break;
}
}
- foreach (FoldingSection fm in strategy.FoldingManager.AllFoldings) {
+ foreach (FoldingSection fm in foldingManager.AllFoldings) {
fm.IsFolded = doFold;
}
}
@@ -61,10 +61,10 @@ namespace ICSharpCode.AvalonEdit.AddIn.Commands
{
ITextEditorProvider provider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorProvider;
ITextEditor editor = provider.TextEditor;
- ParserFoldingStrategy strategy = editor.GetService(typeof(ParserFoldingStrategy)) as ParserFoldingStrategy;
+ FoldingManager foldingManager = editor.GetService(typeof(FoldingManager)) as FoldingManager;
- if (strategy != null) {
- foreach (FoldingSection fm in strategy.FoldingManager.AllFoldings) {
+ if (foldingManager != null) {
+ foreach (FoldingSection fm in foldingManager.AllFoldings) {
fm.IsFolded = ParserFoldingStrategy.IsDefinition(fm);
}
}
diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DefaultChangeWatcher.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DefaultChangeWatcher.cs
index 8e139caac6..8529a90b53 100644
--- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DefaultChangeWatcher.cs
+++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DefaultChangeWatcher.cs
@@ -197,8 +197,10 @@ namespace ICSharpCode.AvalonEdit.AddIn
if (!disposed) {
if (watcher != null)
watcher.Dispose();
- this.textDocument.LineTrackers.Remove(this);
- this.textDocument.UndoStack.PropertyChanged -= UndoStackPropertyChanged;
+ if (this.textDocument != null) {
+ this.textDocument.LineTrackers.Remove(this);
+ this.textDocument.UndoStack.PropertyChanged -= UndoStackPropertyChanged;
+ }
disposed = true;
}
}
diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.xaml b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.xaml
index c17d8f8748..049069b662 100644
--- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.xaml
+++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.xaml
@@ -6,7 +6,7 @@
-
+
diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/AbstractDesignerGenerator.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/AbstractDesignerGenerator.cs
index c656b83996..9a9c4214f8 100644
--- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/AbstractDesignerGenerator.cs
+++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/AbstractDesignerGenerator.cs
@@ -337,15 +337,18 @@ namespace ICSharpCode.FormsDesigner
foreach (var stmt in initializeComponent.Statements.OfType().Where(ces => ces.Expression is CodeMethodInvokeExpression)) {
CodeMethodInvokeExpression invocation = (CodeMethodInvokeExpression)stmt.Expression;
- if (invocation.Method.TargetObject is CodeCastExpression) {
- CodeCastExpression expr = (CodeCastExpression)invocation.Method.TargetObject;
- CodeFieldReferenceExpression fieldRef = (CodeFieldReferenceExpression)expr.Expression;
- if (!(fieldRef.TargetObject is CodeThisReferenceExpression))
+ CodeCastExpression expr = invocation.Method.TargetObject as CodeCastExpression;
+ if (expr != null) {
+ CodeFieldReferenceExpression fieldRef = expr.Expression as CodeFieldReferenceExpression;
+ if (fieldRef == null || !(fieldRef.TargetObject is CodeThisReferenceExpression))
continue;
if (expr.TargetType.BaseType != "System.ComponentModel.ISupportInitialize")
continue;
- CodeMemberField field = formClass.Members.OfType().First(f => this.formClass.ProjectContent.Language.NameComparer.Equals(fieldRef.FieldName, f.Name));
- IClass fieldType = this.formClass.ProjectContent.GetClass(field.Type.BaseType, 0);
+ IField field = this.formClass.DefaultReturnType.GetFields()
+ .First(f => this.formClass.ProjectContent.Language.NameComparer.Equals(fieldRef.FieldName, f.Name));
+ if (field.ReturnType == null)
+ continue;
+ IClass fieldType = field.ReturnType.GetUnderlyingClass();
if (fieldType == null)
continue;
if (!fieldType.IsTypeInInheritanceTree(iSupportInitializeInterface))
diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/ResourceStore.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/ResourceStore.cs
index 4e34fd61b8..30de41c535 100644
--- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/ResourceStore.cs
+++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/ResourceStore.cs
@@ -37,7 +37,7 @@ namespace ICSharpCode.FormsDesigner.Services
{
ResourceStorage storage;
if (!resources.TryGetValue(culture.Name, out storage)) {
- storage = resources[culture.Name] = new ResourceStorage(culture.Name);
+ storage = resources[culture.Name] = new ResourceStorage(culture.Name, viewContent.PrimaryFileName);
string fileName = CalcResourceFileName(viewContent.PrimaryFileName, culture.Name);
CreateOpenedFileForStorage(storage, fileName, File.Exists(fileName));
}
@@ -108,12 +108,14 @@ namespace ICSharpCode.FormsDesigner.Services
IResourceWriter writer;
byte[] buffer;
readonly string cultureName;
+ string parentDesignerSourceFileName;
internal OpenedFile OpenedFile;
internal bool IsNewFile;
- public ResourceStorage(string cultureName)
+ public ResourceStorage(string cultureName, string parentDesignerSourceFileName)
{
this.cultureName = cultureName;
+ this.parentDesignerSourceFileName = parentDesignerSourceFileName;
}
public void Dispose()
@@ -204,7 +206,7 @@ namespace ICSharpCode.FormsDesigner.Services
public IResourceWriter GetWriter()
{
this.stream = new MemoryStream();
- this.writer = CreateResourceWriter(this.stream, GetResourceType(OpenedFile.FileName));
+ this.writer = CreateResourceWriter(this.stream, GetResourceType(OpenedFile.FileName), parentDesignerSourceFileName);
return this.writer;
}
@@ -335,12 +337,12 @@ namespace ICSharpCode.FormsDesigner.Services
return new ResXResourceReader(stream);
}
- internal static IResourceWriter CreateResourceWriter(Stream stream, ResourceType type)
+ internal static IResourceWriter CreateResourceWriter(Stream stream, ResourceType type, string parentDesignerSourceFileName)
{
if (type == ResourceType.Resources) {
return new ResourceWriter(stream);
}
- return new ResXResourceWriter(stream);
+ return new ResXResourceWriter(stream, t => ResXConverter.ConvertTypeName(t, parentDesignerSourceFileName));
}
internal static ResourceType GetResourceType(string fileName)
diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs
index 7862e938c0..3b484f99e6 100644
--- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs
+++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs
@@ -122,9 +122,13 @@ namespace ICSharpCode.FormsDesigner.Services
if (!projectContentsCurrentlyLoadingAssembly.Add(pc))
return null;
+ Assembly sdAssembly;
+ if (IsSharpDevelopAssembly(pc, out sdAssembly))
+ return sdAssembly;
+
try {
// load dependencies of current assembly
- foreach (IProjectContent rpc in pc.ReferencedContents) {
+ foreach (IProjectContent rpc in pc.ThreadSafeGetReferencedContents()) {
if (rpc is ParseProjectContent) {
LoadAssembly(rpc);
} else if (rpc is ReflectionProjectContent) {
@@ -151,6 +155,20 @@ namespace ICSharpCode.FormsDesigner.Services
}
}
+ readonly string sharpDevelopRoot = Directory.GetParent(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)).FullName;
+
+ bool IsSharpDevelopAssembly(IProjectContent pc, out Assembly assembly)
+ {
+ assembly = null;
+ foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) {
+ if (!asm.IsDynamic && asm.Location.StartsWith(sharpDevelopRoot, StringComparison.OrdinalIgnoreCase) && pc.AssemblyName == asm.GetName().Name) {
+ assembly = asm;
+ return true;
+ }
+ }
+ return false;
+ }
+
static string GetHash(string fileName)
{
return Path.GetFileName(fileName).ToLowerInvariant() + File.GetLastWriteTimeUtc(fileName).Ticks.ToString();
diff --git a/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/ResourceList.cs b/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/ResourceList.cs
index 738a5ebc85..7c6d199542 100644
--- a/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/ResourceList.cs
+++ b/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/ResourceList.cs
@@ -8,9 +8,9 @@ using System.Drawing.Printing;
using System.IO;
using System.Resources;
using System.Windows.Forms;
-
using ICSharpCode.Core;
using ICSharpCode.Core.WinForms;
+using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Widgets.ListViewSorting;
namespace ResourceEditor
@@ -174,7 +174,7 @@ namespace ResourceEditor
// write XML resource
case ".resx":
- ResXResourceWriter rxw = new ResXResourceWriter(stream);
+ ResXResourceWriter rxw = new ResXResourceWriter(stream, t => ResXConverter.ConvertTypeName(t, filename));
foreach (KeyValuePair entry in resources) {
if (entry.Value != null) {
ResourceItem item = entry.Value;
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/IdeChooseClassService.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/IdeChooseClassService.cs
index 7714a4b85b..1c575877da 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/IdeChooseClassService.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/IdeChooseClassService.cs
@@ -43,7 +43,7 @@ namespace ICSharpCode.WpfDesign.AddIn
var pc = ParserService.CurrentProjectContent;
var a = GetAssembly(pc);
if (a != null) yield return a;
- foreach (var r in pc.ReferencedContents) {
+ foreach (var r in pc.ThreadSafeGetReferencedContents()) {
a = GetAssembly(r);
if (a != null) yield return a;
}
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs
index 507b8215d6..82a6b0f8a8 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs
@@ -52,7 +52,7 @@ namespace ICSharpCode.WpfDesign.AddIn
Assembly FindAssemblyInProjectReferences(IProjectContent pc, string name)
{
- foreach (IProjectContent referencedProjectContent in pc.ReferencedContents) {
+ foreach (IProjectContent referencedProjectContent in pc.ThreadSafeGetReferencedContents()) {
if (name == referencedProjectContent.AssemblyName) {
return this.typeResolutionService.LoadAssembly(referencedProjectContent);
}
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlFormattingStrategy.cs b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlFormattingStrategy.cs
index 038ae9e753..af16946d5f 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlFormattingStrategy.cs
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlFormattingStrategy.cs
@@ -149,12 +149,7 @@ namespace ICSharpCode.XmlEditor
else
newText = currentIndentation + lineText.Trim();
- if (newText != lineText) {
- int extraCharsToBeAddedAtStartedOfLine = newText.Length - lineText.Length;
- document.Replace(line.Offset, line.Length, newText);
- Location caretPosition = document.OffsetToPosition(line.Offset + extraCharsToBeAddedAtStartedOfLine);
- editor.Caret.Position = caretPosition;
- }
+ document.SmartReplaceLine(line, newText);
nextLine++;
}
if (r.LineNumber > end)
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlTreeViewContainerControl.cs b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlTreeViewContainerControl.cs
index a9d5668e5d..80c563eb32 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlTreeViewContainerControl.cs
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlTreeViewContainerControl.cs
@@ -200,7 +200,7 @@ namespace ICSharpCode.XmlEditor
/// comment node currently on display.
///
public string TextContent {
- get { return textBox.Text; }
+ get { return textBox.Text.Replace("\n", "\r\n"); }
set { textBox.Text = value; }
}
@@ -740,6 +740,7 @@ namespace ICSharpCode.XmlEditor
//
this.textBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox.Location = new System.Drawing.Point(0, 0);
+ this.textBox.Multiline = true;
this.textBox.Name = "textBox";
this.textBox.Size = new System.Drawing.Size(375, 326);
this.textBox.TabIndex = 2;
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs
index 25babe21fc..ced4b57923 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs
@@ -141,8 +141,9 @@ namespace ICSharpCode.XmlEditor
{
if (editor == null) return false;
try {
- XmlDocument Document = new XmlDocument();
- Document.LoadXml(editor.Document.Text);
+ XmlDocument document = new XmlDocument();
+ document.XmlResolver = null;
+ document.LoadXml(editor.Document.Text);
return true;
} catch (XmlException ex) {
AddTask(editor.FileName, ex.Message, ex.LinePosition, ex.LineNumber, TaskType.Error);
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
index 16abeb4a3c..53572dfc49 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
@@ -24,7 +24,7 @@
@@ -55,7 +55,7 @@
+ extensions=".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs;.wxi;.wxl;.proj;.csproj;.vbproj;.ilproj;.build;.xfrm;.targets;.xpt;.xft;.map;.wsdl;.disco;.nuspec;.booproj;.fsproj;.pyproj;.rbproj;.vcxproj;.wixproj;.ps1xml" />
@@ -68,7 +68,7 @@
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Test/Editor/IndentChildElementEndTagAfterNewLineTypedTestFixture.cs b/src/AddIns/DisplayBindings/XmlEditor/Test/Editor/IndentChildElementEndTagAfterNewLineTypedTestFixture.cs
index ed03ffc9f4..88cdd2f33f 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Test/Editor/IndentChildElementEndTagAfterNewLineTypedTestFixture.cs
+++ b/src/AddIns/DisplayBindings/XmlEditor/Test/Editor/IndentChildElementEndTagAfterNewLineTypedTestFixture.cs
@@ -71,14 +71,5 @@ namespace XmlEditor.Tests.Editor
Assert.AreEqual(expectedText, textDocument.Text);
}
-
- [Test]
- public void CursorIsJustBeforeChildEndElementEndTagAfterIndent()
- {
- int line = 3;
- int column = 2;
- Location expectedLocation = new Location(column, line);
- Assert.AreEqual(expectedLocation, textEditor.Caret.Position);
- }
}
}
diff --git a/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit.Sample/AvalonEdit.Sample.4.1.0.8000.nupkg b/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit.Sample/AvalonEdit.Sample.4.1.0.8000.nupkg
deleted file mode 100644
index 6e29f74289..0000000000
Binary files a/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit.Sample/AvalonEdit.Sample.4.1.0.8000.nupkg and /dev/null differ
diff --git a/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit.Sample/AvalonEdit.Sample.nuspec b/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit.Sample/AvalonEdit.Sample.nuspec
index e000423510..71e2f88146 100644
--- a/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit.Sample/AvalonEdit.Sample.nuspec
+++ b/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit.Sample/AvalonEdit.Sample.nuspec
@@ -2,7 +2,7 @@
AvalonEdit.Sample
- 4.1.0.8000
+ 4.2.0.8783
Daniel Grunwald
SharpDevelop
http://www.opensource.org/licenses/mit-license.php
@@ -16,7 +16,7 @@ StartupUri="/Samples/AvalonEdit/Window1.xaml"
Sample code for AvalonEdit the WPF-based text editor used in SharpDevelop 4.0.
en-US
-
+
diff --git a/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.4.1.0.8000.nupkg b/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.4.1.0.8000.nupkg
deleted file mode 100644
index 2c307fee6c..0000000000
Binary files a/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.4.1.0.8000.nupkg and /dev/null differ
diff --git a/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.4.1.0.8000.symbols.nupkg b/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.4.1.0.8000.symbols.nupkg
deleted file mode 100644
index f753371459..0000000000
Binary files a/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.4.1.0.8000.symbols.nupkg and /dev/null differ
diff --git a/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.nuspec b/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.nuspec
index 933dab9b9d..ccd43f3278 100644
--- a/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.nuspec
+++ b/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.nuspec
@@ -2,7 +2,7 @@
AvalonEdit
- 4.1.0.8000
+ 4.2.0.8783
Daniel Grunwald
SharpDevelop
http://www.opensource.org/licenses/lgpl-2.1.php
diff --git a/src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj b/src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj
index ab37b7482a..467ef85879 100644
--- a/src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj
+++ b/src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj
@@ -70,6 +70,7 @@
+
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/AvailablePackagesViewModel.cs b/src/AddIns/Misc/PackageManagement/Project/Src/AvailablePackagesViewModel.cs
index d5be42c56c..86876e3a68 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/AvailablePackagesViewModel.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/AvailablePackagesViewModel.cs
@@ -43,13 +43,9 @@ namespace ICSharpCode.PackageManagement
protected override IEnumerable GetFilteredPackagesBeforePagingResults(IQueryable allPackages)
{
- IEnumerable filteredPackages = base.GetFilteredPackagesBeforePagingResults(allPackages);
- return GetDistinctPackagesById(filteredPackages);
- }
-
- IEnumerable GetDistinctPackagesById(IEnumerable allPackages)
- {
- return allPackages.DistinctLast(PackageEqualityComparer.Id);
+ return base.GetFilteredPackagesBeforePagingResults(allPackages)
+ .Where(package => package.IsReleaseVersion())
+ .DistinctLast(PackageEqualityComparer.Id);
}
}
}
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/ConfigSettingsFileSystem.cs b/src/AddIns/Misc/PackageManagement/Project/Src/ConfigSettingsFileSystem.cs
new file mode 100644
index 0000000000..daccf7b809
--- /dev/null
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/ConfigSettingsFileSystem.cs
@@ -0,0 +1,24 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.IO;
+using ICSharpCode.SharpDevelop.Project;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ConfigSettingsFileSystem : PhysicalFileSystem
+ {
+ ConfigSettingsFileSystem(string root)
+ : base(root)
+ {
+ }
+
+ public static ConfigSettingsFileSystem CreateConfigSettingsFileSystem(Solution solution)
+ {
+ string configSettingsFolder = Path.Combine(solution.Directory, ".nuget");
+ return new ConfigSettingsFileSystem(configSettingsFolder);
+ }
+ }
+}
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeProjectSystem.cs b/src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeProjectSystem.cs
index 72cd36e734..761a699bf9 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeProjectSystem.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeProjectSystem.cs
@@ -54,5 +54,7 @@ namespace ICSharpCode.PackageManagement.Design
{
throw new NotImplementedException();
}
+
+ public bool IsBindingRedirectSupported { get; set; }
}
}
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs b/src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs
index a480329bff..84afc7bf54 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs
@@ -118,5 +118,15 @@ namespace ICSharpCode.PackageManagement.Design
AddFakePackageSource(packageSource);
}
}
+
+ public IList> GetNestedValues(string section, string key)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void SetNestedValues(string section, string key, IList> values)
+ {
+ throw new NotImplementedException();
+ }
}
}
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/DTE.cs b/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/DTE.cs
index b190eb47e9..e2205ee818 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/DTE.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/DTE.cs
@@ -29,6 +29,10 @@ namespace ICSharpCode.PackageManagement.EnvDTE
ItemOperations = new ItemOperations(fileService);
}
+ public string Version {
+ get { return "10.0"; }
+ }
+
public Solution Solution {
get {
if (IsSolutionOpen) {
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/ISharpDevelopPackageRepositoryFactory.cs b/src/AddIns/Misc/PackageManagement/Project/Src/ISharpDevelopPackageRepositoryFactory.cs
index 58d6c938aa..19029c8030 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/ISharpDevelopPackageRepositoryFactory.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/ISharpDevelopPackageRepositoryFactory.cs
@@ -11,7 +11,8 @@ namespace ICSharpCode.PackageManagement
{
ISharedPackageRepository CreateSharedRepository(
IPackagePathResolver pathResolver,
- IFileSystem fileSystem);
+ IFileSystem fileSystem,
+ IFileSystem configSettingsFileSystem);
IRecentPackageRepository CreateRecentPackageRepository(
IList recentPackages,
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementOptions.cs b/src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementOptions.cs
index bd587c46f1..25772f88ab 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementOptions.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementOptions.cs
@@ -26,7 +26,7 @@ namespace ICSharpCode.PackageManagement
}
public PackageManagementOptions(Properties properties)
- : this(properties, Settings.DefaultSettings)
+ : this(properties, Settings.LoadDefaultSettings())
{
}
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/PackageReferenceFileNameForProject.cs b/src/AddIns/Misc/PackageManagement/Project/Src/PackageReferenceFileNameForProject.cs
index de26abddc7..84d7c3fe7b 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/PackageReferenceFileNameForProject.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/PackageReferenceFileNameForProject.cs
@@ -17,7 +17,7 @@ namespace ICSharpCode.PackageManagement
void GetFileNameForProject(IProject project)
{
- FileName = Path.Combine(project.Directory, PackageReferenceRepository.PackageReferenceFile);
+ FileName = Path.Combine(project.Directory, Constants.PackageReferenceFile);
}
public string FileName { get; private set; }
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/PackageRepositoryCache.cs b/src/AddIns/Misc/PackageManagement/Project/Src/PackageRepositoryCache.cs
index ed44642528..be95abfacb 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/PackageRepositoryCache.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/PackageRepositoryCache.cs
@@ -62,9 +62,9 @@ namespace ICSharpCode.PackageManagement
return repository;
}
- public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem)
+ public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem, IFileSystem configSettingsFileSystem)
{
- return factory.CreateSharedRepository(pathResolver, fileSystem);
+ return factory.CreateSharedRepository(pathResolver, fileSystem, configSettingsFileSystem);
}
public IPackageRepository CreateAggregateRepository()
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/ProjectTemplatePackageRepositoryCache.cs b/src/AddIns/Misc/PackageManagement/Project/Src/ProjectTemplatePackageRepositoryCache.cs
index 72c3aed9c1..cb827da187 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/ProjectTemplatePackageRepositoryCache.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/ProjectTemplatePackageRepositoryCache.cs
@@ -46,7 +46,7 @@ namespace ICSharpCode.PackageManagement
}
}
- public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem)
+ public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem, IFileSystem configSettingsFileSystem)
{
throw new NotImplementedException();
}
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopPackageManagerFactory.cs b/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopPackageManagerFactory.cs
index 736783326b..97b65f0366 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopPackageManagerFactory.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopPackageManagerFactory.cs
@@ -55,10 +55,5 @@ namespace ICSharpCode.PackageManagement
{
return projectSystemFactory.CreateProjectSystem(project);
}
-
- ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem)
- {
- return packageRepositoryFactory.CreateSharedRepository(pathResolver, fileSystem);
- }
}
}
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopPackageRepositoryFactory.cs b/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopPackageRepositoryFactory.cs
index 7f41647dda..043e85e8c4 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopPackageRepositoryFactory.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopPackageRepositoryFactory.cs
@@ -23,9 +23,10 @@ namespace ICSharpCode.PackageManagement
public ISharedPackageRepository CreateSharedRepository(
IPackagePathResolver pathResolver,
- IFileSystem fileSystem)
+ IFileSystem fileSystem,
+ IFileSystem configSettingsFileSystem)
{
- return new SharedPackageRepository(pathResolver, fileSystem);
+ return new SharedPackageRepository(pathResolver, fileSystem, configSettingsFileSystem);
}
public IRecentPackageRepository CreateRecentPackageRepository(
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopProjectSystem.cs b/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopProjectSystem.cs
index b7e0047d20..e6a387c059 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopProjectSystem.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopProjectSystem.cs
@@ -40,6 +40,8 @@ namespace ICSharpCode.PackageManagement
return directory + @"\";
}
+ public bool IsBindingRedirectSupported { get; set; }
+
public FrameworkName TargetFramework {
get { return GetTargetFramework(); }
}
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/SolutionPackageRepository.cs b/src/AddIns/Misc/PackageManagement/Project/Src/SolutionPackageRepository.cs
index 9773d016a2..482f3d7887 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/SolutionPackageRepository.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/SolutionPackageRepository.cs
@@ -35,7 +35,7 @@ namespace ICSharpCode.PackageManagement
repositoryPath = new SolutionPackageRepositoryPath(solution, options);
CreatePackagePathResolver();
CreateFileSystem();
- CreateRepository();
+ CreateRepository(ConfigSettingsFileSystem.CreateConfigSettingsFileSystem(solution));
}
void CreatePackagePathResolver()
@@ -48,9 +48,9 @@ namespace ICSharpCode.PackageManagement
fileSystem = new PhysicalFileSystem(repositoryPath.PackageRepositoryPath);
}
- void CreateRepository()
+ void CreateRepository(ConfigSettingsFileSystem configSettingsFileSystem)
{
- repository = repositoryFactory.CreateSharedRepository(packagePathResolver, fileSystem);
+ repository = repositoryFactory.CreateSharedRepository(packagePathResolver, fileSystem, configSettingsFileSystem);
}
public ISharedPackageRepository Repository {
diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/UpdatedPackages.cs b/src/AddIns/Misc/PackageManagement/Project/Src/UpdatedPackages.cs
index 3f9c367266..c958019c84 100644
--- a/src/AddIns/Misc/PackageManagement/Project/Src/UpdatedPackages.cs
+++ b/src/AddIns/Misc/PackageManagement/Project/Src/UpdatedPackages.cs
@@ -53,7 +53,7 @@ namespace ICSharpCode.PackageManagement
IEnumerable GetUpdatedPackages(IPackageRepository sourceRepository, IQueryable localPackages)
{
- return sourceRepository.GetUpdates(localPackages, false);
+ return sourceRepository.GetUpdates(localPackages, false, false);
}
}
}
diff --git a/src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Cmdlets.dll-Help.xml b/src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Cmdlets.dll-Help.xml
index 9468c01b73..43b81a1a78 100644
--- a/src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Cmdlets.dll-Help.xml
+++ b/src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Cmdlets.dll-Help.xml
@@ -420,6 +420,10 @@ Returns a list of recently installed packages.
RemoveDependencies
+
+ ProjectName
+ string
+
Force
@@ -457,6 +461,12 @@ Returns a list of recently installed packages.
string
+
+ Force
+
+ Forces an uninstall of the package even if another package depends on it.
+
+
Version
@@ -707,124 +717,6 @@ available in the feed, the -Safe flag updates the package to 1.0.2.
-
-
-
-
-
- New-Package
-
-
- Creates a package.
-
- New
- Package
-
-
-
-
- Creates a new package when supplied with a Nuspec package specification file.
-
-
-
-
-
- New-Package
-
- ProjectName
- string
-
-
- SpecFileName
- string
-
-
- TargetFile
- string
-
-
- NoClobber
-
-
-
-
-
-
-
- ProjectName
-
- Specifies the project containing the NuSpec file to use when creating the package. If omitted, the current project selected in the console is used.
-
- string
-
-
- SpecFileName
-
- Specifies the NuSpec file used to create the package. If omitted, the NuSpec file within the current project is used if there is only one such file.
-
- string
-
-
- TargetFile
-
- Specifes the full name of the output NuPkg file.
-
- string
-
-
- NoClobber
-
- If specified, the target file is not overwritten.
-
-
-
-
-
-
- ---------- EXAMPLE 1 ----------
- PM> New-Package
-
-
-Description
-------------------------------------------------------------------
-Creates a new package based on the current project using a Nuspec file within the project if only one such file is found.
-
-
-
-
-
-
-
- ---------- EXAMPLE 2 ----------
- PM> New-Package -Project MyProjectName -SpecFileName MyPackage.nuspec
-
-
-Description
-------------------------------------------------------------------
-Creates a new package from the specified project, MyProjectName using the specified Nuspec file, MyPackage.nuspec.
-
-
-
-
-
-
-
-
-
-
- Online version:
- http://docs.nuget.org/
-
-
- New-Package
-
-
-
-
-
(() => CompleteReadPackagesTask());
Assert.AreEqual("Test", ex.Message);
}
+
+ [Test]
+ public void ReadPackages_RepositoryHasPrereleaseAndReleasePackage_HasReleasePackageOnly()
+ {
+ CreateViewModel();
+
+ var releasePackage = new FakePackage("Test", "1.0.0.0");
+ var prereleasePackage = new FakePackage("Test", "1.1.0-alpha");
+
+ var packages = new FakePackage[] {
+ releasePackage, prereleasePackage
+ };
+
+ registeredPackageRepositories.FakeActiveRepository.FakePackages.AddRange(packages);
+
+ viewModel.ReadPackages();
+ CompleteReadPackagesTask();
+
+ var expectedPackages = new FakePackage[] {
+ releasePackage
+ };
+
+ PackageCollectionAssert.AreEqual(expectedPackages, viewModel.PackageViewModels);
+ }
}
}
diff --git a/src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/DTETests.cs b/src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/DTETests.cs
index b93e25ef91..bf21b84213 100644
--- a/src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/DTETests.cs
+++ b/src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/DTETests.cs
@@ -137,5 +137,15 @@ namespace PackageManagement.Tests.EnvDTE
Assert.AreEqual("ProjectA", name);
}
+
+ [Test]
+ public void Version_CheckVersion_Returns10()
+ {
+ CreateDTE();
+
+ string version = dte.Version;
+
+ Assert.AreEqual("10.0", version);
+ }
}
}
diff --git a/src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageRepositoryFactory.cs b/src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageRepositoryFactory.cs
index f8b44f9a5e..150c963d83 100644
--- a/src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageRepositoryFactory.cs
+++ b/src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageRepositoryFactory.cs
@@ -37,12 +37,14 @@ namespace PackageManagement.Tests.Helpers
public IPackagePathResolver PathResolverPassedToCreateSharedRepository;
public IFileSystem FileSystemPassedToCreateSharedRepository;
+ public IFileSystem ConfigSettingsFileSystemPassedToCreateSharedRepository;
public FakeSharedPackageRepository FakeSharedRepository = new FakeSharedPackageRepository();
- public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem)
+ public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem, IFileSystem configSettingsFileSystem)
{
PathResolverPassedToCreateSharedRepository = pathResolver;
FileSystemPassedToCreateSharedRepository = fileSystem;
+ ConfigSettingsFileSystemPassedToCreateSharedRepository = configSettingsFileSystem;
return FakeSharedRepository;
}
diff --git a/src/AddIns/Misc/PackageManagement/Test/Src/PackageRepositoryCacheTests.cs b/src/AddIns/Misc/PackageManagement/Test/Src/PackageRepositoryCacheTests.cs
index 0614083b6a..f9044d8a61 100644
--- a/src/AddIns/Misc/PackageManagement/Test/Src/PackageRepositoryCacheTests.cs
+++ b/src/AddIns/Misc/PackageManagement/Test/Src/PackageRepositoryCacheTests.cs
@@ -112,7 +112,7 @@ namespace PackageManagement.Tests
public void CreateSharedRepository_MethodCalled_ReturnsSharedPackageRepository()
{
CreateCache();
- ISharedPackageRepository repository = cache.CreateSharedRepository(null, null);
+ ISharedPackageRepository repository = cache.CreateSharedRepository(null, null, null);
Assert.IsNotNull(repository);
}
@@ -121,7 +121,7 @@ namespace PackageManagement.Tests
{
CreateCache();
FakePackagePathResolver resolver = new FakePackagePathResolver();
- cache.CreateSharedRepository(resolver, null);
+ cache.CreateSharedRepository(resolver, null, null);
Assert.AreEqual(resolver, fakePackageRepositoryFactory.PathResolverPassedToCreateSharedRepository);
}
@@ -131,11 +131,21 @@ namespace PackageManagement.Tests
{
CreateCache();
FakeFileSystem fileSystem = new FakeFileSystem();
- cache.CreateSharedRepository(null, fileSystem);
+ cache.CreateSharedRepository(null, fileSystem, null);
Assert.AreEqual(fileSystem, fakePackageRepositoryFactory.FileSystemPassedToCreateSharedRepository);
}
+ [Test]
+ public void CreatedSharedRepository_ConfigSettingsFileSystemPassed_FileSystemUsedToCreatedSharedRepository()
+ {
+ CreateCache();
+ FakeFileSystem fileSystem = new FakeFileSystem();
+ cache.CreateSharedRepository(null, null, fileSystem);
+
+ Assert.AreEqual(fileSystem, fakePackageRepositoryFactory.ConfigSettingsFileSystemPassedToCreateSharedRepository);
+ }
+
[Test]
public void CreateAggregatePackageRepository_TwoRegisteredPackageRepositories_ReturnsAggregateRepositoryFromFactory()
{
diff --git a/src/AddIns/Misc/PackageManagement/Test/Src/Scripting/RunPackageScriptsActionTests.cs b/src/AddIns/Misc/PackageManagement/Test/Src/Scripting/RunPackageScriptsActionTests.cs
index b43a4da6e5..aa487146b3 100644
--- a/src/AddIns/Misc/PackageManagement/Test/Src/Scripting/RunPackageScriptsActionTests.cs
+++ b/src/AddIns/Misc/PackageManagement/Test/Src/Scripting/RunPackageScriptsActionTests.cs
@@ -46,8 +46,7 @@ namespace PackageManagement.Tests.Scripting
PackageOperationEventArgs CreatePackageOperationEventArgs(FakePackage package, string installPath)
{
- string targetPath = @"d:\projects\myproject\packages\target";
- return new PackageOperationEventArgs(package, null, targetPath, installPath);
+ return new PackageOperationEventArgs(package, null, installPath);
}
[Test]
diff --git a/src/AddIns/Misc/PackageManagement/Test/Src/SolutionPackageRepositoryTests.cs b/src/AddIns/Misc/PackageManagement/Test/Src/SolutionPackageRepositoryTests.cs
index e2b95f89d4..9f36efa3af 100644
--- a/src/AddIns/Misc/PackageManagement/Test/Src/SolutionPackageRepositoryTests.cs
+++ b/src/AddIns/Misc/PackageManagement/Test/Src/SolutionPackageRepositoryTests.cs
@@ -120,13 +120,10 @@ namespace PackageManagement.Tests
}
[Test]
- public void GetPackagesByDependencyOrder_OnePackageInSharedRepository_SharedRepositoryCreatedWithFileSystemForSolutionPackagesFolder()
+ public void Constructor_CreateInstance_SharedRepositoryCreatedWithFileSystemForSolutionPackagesFolder()
{
CreateSolution(@"d:\projects\myproject\myproject.sln");
CreateRepository(solution);
- FakePackage package = AddPackageToSharedRepository("Test");
-
- List actualPackages = repository.GetPackagesByDependencyOrder().ToList();
IFileSystem fileSystem = fakeRepositoryFactory.FileSystemPassedToCreateSharedRepository;
string rootPath = fileSystem.Root;
@@ -136,6 +133,20 @@ namespace PackageManagement.Tests
Assert.AreEqual(expectedRootPath, rootPath);
}
+ [Test]
+ public void Constructor_CreateInstance_SharedRepositoryCreatedWithConfigSettingsFileSystemForSolutionNuGetFolder()
+ {
+ CreateSolution(@"d:\projects\myproject\myproject.sln");
+ CreateRepository(solution);
+
+ IFileSystem fileSystem = fakeRepositoryFactory.ConfigSettingsFileSystemPassedToCreateSharedRepository;
+ string rootPath = fileSystem.Root;
+
+ string expectedRootPath = @"d:\projects\myproject\.nuget";
+
+ Assert.AreEqual(expectedRootPath, rootPath);
+ }
+
[Test]
public void GetPackagesByDependencyOrder_TwoPackagesInSharedRepositoryFirstPackageDependsOnSecond_ReturnsSecondPackageFirst()
{
diff --git a/src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchManager.cs b/src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchManager.cs
index c687a855e0..445f89693b 100644
--- a/src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchManager.cs
+++ b/src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchManager.cs
@@ -5,9 +5,9 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Text;
using System.Threading;
using System.Threading.Tasks;
-
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing;
using ICSharpCode.AvalonEdit.Highlighting;
@@ -31,21 +31,64 @@ namespace SearchAndReplace
public static IObservable FindAllParallel(ISearchStrategy strategy, SearchLocation location, IProgressMonitor progressMonitor)
{
currentSearchRegion = null;
- ParseableFileContentFinder fileFinder = new ParseableFileContentFinder();
+ SearchableFileContentFinder fileFinder = new SearchableFileContentFinder();
return new SearchRun(strategy, fileFinder, location.GenerateFileList(), progressMonitor) { Target = location.Target, Selection = location.Selection };
}
public static IEnumerable FindAll(ISearchStrategy strategy, SearchLocation location, IProgressMonitor progressMonitor)
{
currentSearchRegion = null;
- ParseableFileContentFinder fileFinder = new ParseableFileContentFinder();
+ SearchableFileContentFinder fileFinder = new SearchableFileContentFinder();
return new SearchRun(strategy, fileFinder, location.GenerateFileList(), progressMonitor) { Target = location.Target, Selection = location.Selection }.GetResults();
}
+ class SearchableFileContentFinder
+ {
+ FileName[] viewContentFileNamesCollection = WorkbenchSingleton.SafeThreadFunction(() => FileService.OpenedFiles.Select(f => f.FileName).ToArray());
+
+ static ITextBuffer ReadFile(FileName fileName)
+ {
+ OpenedFile openedFile = FileService.GetOpenedFile(fileName);
+ if (openedFile == null)
+ return null;
+ IFileDocumentProvider provider = FileService.GetOpenFile(fileName) as IFileDocumentProvider;
+ if (provider == null)
+ return null;
+ IDocument doc = provider.GetDocumentForFile(openedFile);
+ if (doc == null)
+ return null;
+ return doc.CreateSnapshot();
+ }
+
+ public ITextBuffer Create(FileName fileName)
+ {
+ try {
+ foreach (FileName name in viewContentFileNamesCollection) {
+ if (FileUtility.IsEqualFileName(name, fileName)) {
+ ITextBuffer buffer = WorkbenchSingleton.SafeThreadFunction(ReadFile, fileName);
+ if (buffer != null)
+ return buffer;
+ }
+ }
+ using (Stream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read)) {
+ if (MimeTypeDetection.FindMimeType(stream).StartsWith("text/")) {
+ stream.Position = 0;
+ return new StringTextBuffer(ICSharpCode.AvalonEdit.Utils.FileReader.ReadFileContent(stream, Encoding.Default));
+ }
+ }
+ return null;
+ } catch (IOException) {
+ return null;
+ } catch (UnauthorizedAccessException) {
+ return null;
+ }
+ }
+ }
+
class SearchRun : IObservable, IDisposable
{
ISearchStrategy strategy;
- ParseableFileContentFinder fileFinder;
+ SearchableFileContentFinder fileFinder;
IEnumerable fileList;
IProgressMonitor monitor;
CancellationTokenSource cts;
@@ -54,7 +97,7 @@ namespace SearchAndReplace
public ISegment Selection { get; set; }
- public SearchRun(ISearchStrategy strategy, ParseableFileContentFinder fileFinder, IEnumerable fileList, IProgressMonitor monitor)
+ public SearchRun(ISearchStrategy strategy, SearchableFileContentFinder fileFinder, IEnumerable fileList, IProgressMonitor monitor)
{
this.strategy = strategy;
this.fileFinder = fileFinder;
@@ -151,8 +194,6 @@ namespace SearchAndReplace
ThrowIfCancellationRequested();
- if (!MimeTypeDetection.FindMimeType(buffer).StartsWith("text/", StringComparison.Ordinal))
- return null;
var source = DocumentUtilitites.GetTextSource(buffer);
TextDocument document = null;
DocumentHighlighter highlighter = null;
@@ -213,7 +254,7 @@ namespace SearchAndReplace
public SearchResultMatch FindNext()
{
// Setup search inside current or first file.
- ParseableFileContentFinder finder = new ParseableFileContentFinder();
+ SearchableFileContentFinder finder = new SearchableFileContentFinder();
int index = GetCurrentFileIndex();
int i = 0;
int searchOffset = 0;
diff --git a/src/AddIns/Misc/SharpRefactoring/Project/Src/ContextActions/AddUsing.cs b/src/AddIns/Misc/SharpRefactoring/Project/Src/ContextActions/AddUsing.cs
index 7c4a1dd317..b119c4b4f6 100644
--- a/src/AddIns/Misc/SharpRefactoring/Project/Src/ContextActions/AddUsing.cs
+++ b/src/AddIns/Misc/SharpRefactoring/Project/Src/ContextActions/AddUsing.cs
@@ -48,7 +48,7 @@ namespace SharpRefactoring.ContextActions
IProjectContent pc = context.ProjectContent;
SearchAllExtensionMethodsWithName(results, pc, rr.CallName);
- foreach (IProjectContent content in pc.ReferencedContents)
+ foreach (IProjectContent content in pc.ThreadSafeGetReferencedContents())
SearchAllExtensionMethodsWithName(results, content, rr.CallName);
foreach (IClass c in results) {
@@ -99,7 +99,7 @@ namespace SharpRefactoring.ContextActions
public string Search(UnknownMethodResolveResult rr, IProjectContent pc, List results)
{
SearchAttributesWithName(results, pc, rr.CallName);
- foreach (IProjectContent content in pc.ReferencedContents)
+ foreach (IProjectContent content in pc.ThreadSafeGetReferencedContents())
SearchAttributesWithName(results, content, rr.CallName);
return rr.CallName;
}
@@ -107,7 +107,7 @@ namespace SharpRefactoring.ContextActions
public string Search(UnknownIdentifierResolveResult rr, IProjectContent pc, List results)
{
SearchAttributesWithName(results, pc, rr.Identifier);
- foreach (IProjectContent content in pc.ReferencedContents)
+ foreach (IProjectContent content in pc.ThreadSafeGetReferencedContents())
SearchAttributesWithName(results, content, rr.Identifier);
return rr.Identifier;
}
diff --git a/src/AddIns/Misc/SharpRefactoring/Project/Src/MenuItemFactories/ResolveAttribute.cs b/src/AddIns/Misc/SharpRefactoring/Project/Src/MenuItemFactories/ResolveAttribute.cs
index 9c1e6aa7f3..2578f994b5 100644
--- a/src/AddIns/Misc/SharpRefactoring/Project/Src/MenuItemFactories/ResolveAttribute.cs
+++ b/src/AddIns/Misc/SharpRefactoring/Project/Src/MenuItemFactories/ResolveAttribute.cs
@@ -42,7 +42,7 @@ namespace SharpRefactoring
var rr = context.ResolveResult as UnknownMethodResolveResult;
SearchAttributesWithName(results, pc, rr.CallName);
- foreach (IProjectContent content in pc.ReferencedContents)
+ foreach (IProjectContent content in pc.ThreadSafeGetReferencedContents())
SearchAttributesWithName(results, content, rr.CallName);
name = rr.CallName;
@@ -52,7 +52,7 @@ namespace SharpRefactoring
var rr = context.ResolveResult as UnknownIdentifierResolveResult;
SearchAttributesWithName(results, pc, rr.Identifier);
- foreach (IProjectContent content in pc.ReferencedContents)
+ foreach (IProjectContent content in pc.ThreadSafeGetReferencedContents())
SearchAttributesWithName(results, content, rr.Identifier);
name = rr.Identifier;
diff --git a/src/AddIns/Misc/SharpRefactoring/Project/Src/MenuItemFactories/ResolveExtensionMethod.cs b/src/AddIns/Misc/SharpRefactoring/Project/Src/MenuItemFactories/ResolveExtensionMethod.cs
index 24cdadfdf2..c37a3afe72 100644
--- a/src/AddIns/Misc/SharpRefactoring/Project/Src/MenuItemFactories/ResolveExtensionMethod.cs
+++ b/src/AddIns/Misc/SharpRefactoring/Project/Src/MenuItemFactories/ResolveExtensionMethod.cs
@@ -38,7 +38,7 @@ namespace SharpRefactoring
SearchAllExtensionMethodsWithName(results, context.ProjectContent, rr.CallName);
- foreach (IProjectContent content in context.ProjectContent.ReferencedContents)
+ foreach (IProjectContent content in context.ProjectContent.ThreadSafeGetReferencedContents())
SearchAllExtensionMethodsWithName(results, content, rr.CallName);
if (!results.Any())
diff --git a/src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/AnalyticsMonitor.cs b/src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/AnalyticsMonitor.cs
index dcd0637930..0d47ff46e0 100644
--- a/src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/AnalyticsMonitor.cs
+++ b/src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/AnalyticsMonitor.cs
@@ -50,6 +50,8 @@ namespace ICSharpCode.UsageDataCollector
static void AsyncEnableDisable()
{
+ if (System.Diagnostics.Debugger.IsAttached)
+ return;
if (Enabled) {
Instance.OpenSession();
} else {
@@ -242,6 +244,8 @@ namespace ICSharpCode.UsageDataCollector
{
public override void Run()
{
+ if (System.Diagnostics.Debugger.IsAttached)
+ return;
if (AnalyticsMonitor.Enabled)
AnalyticsMonitor.Instance.OpenSession();
}
diff --git a/src/Libraries/AvalonDock/AvalonDock/DockingManager.cs b/src/Libraries/AvalonDock/AvalonDock/DockingManager.cs
index 45a393e3fa..b65cdc147d 100644
--- a/src/Libraries/AvalonDock/AvalonDock/DockingManager.cs
+++ b/src/Libraries/AvalonDock/AvalonDock/DockingManager.cs
@@ -2636,6 +2636,15 @@ namespace AvalonDock
//_flyoutWindow.KeepWindowOpen();
return;
}
+
+ // David: This sometimes seems to be null when hovering over auto-hide pad.
+ // It only seems to occur in specific circumstances - whether the pad is the
+ // "selected" one in the set seems important. Having no open document might have effect?
+ // I have only managed to reliablely reproduce it in stand-alone application.
+ if (content.ContainerPane == null)
+ {
+ return;
+ }
//hide previous window
HideFlyoutWindow();
diff --git a/src/Libraries/AvalonDock/AvalonDock/DocumentTabPanel.cs b/src/Libraries/AvalonDock/AvalonDock/DocumentTabPanel.cs
index b4ed1cf282..86c963cc92 100644
--- a/src/Libraries/AvalonDock/AvalonDock/DocumentTabPanel.cs
+++ b/src/Libraries/AvalonDock/AvalonDock/DocumentTabPanel.cs
@@ -65,6 +65,10 @@ namespace AvalonDock
foreach (ManagedContent child in Children)
{
+ // David: Sometimes happened when closing document tab by middle clicking. Really difficult to reproduce.
+ if (child == null)
+ continue;
+
Panel.SetZIndex(child, Selector.GetIsSelected(child) ? 1 : -i);
i++;
child.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
@@ -81,6 +85,10 @@ namespace AvalonDock
bool skipAllOthers = false;
foreach (ManagedContent doc in Children)
{
+ // David: Sometimes happened when closing document tab by middle clicking. Really difficult to reproduce.
+ if (doc == null)
+ continue;
+
if (skipAllOthers || offset + doc.DesiredSize.Width > finalSize.Width)
{
SetIsHeaderVisible(doc, false);
diff --git a/src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.shfbproj b/src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.shfbproj
index ad51dbd9a2..88c48fea83 100644
--- a/src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.shfbproj
+++ b/src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.shfbproj
@@ -33,26 +33,26 @@
.NET 4.0.30319
AvalonEdit
- Copyright 2008-2011, Daniel Grunwald
+ Copyright 2008-2012, Daniel Grunwald
Prototype
- 4.1.0.0
+ 4.2.0.0
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
{@HelpFormatOutputPaths}
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Libraries/AvalonEdit/Documentation/Welcome.aml b/src/Libraries/AvalonEdit/Documentation/Welcome.aml
index a384c467d6..243e435bb0 100644
--- a/src/Libraries/AvalonEdit/Documentation/Welcome.aml
+++ b/src/Libraries/AvalonEdit/Documentation/Welcome.aml
@@ -41,13 +41,13 @@
System requirements
- AvalonEdit requires the
+ There are two versions of AvalonEdit - the normal one requires
- .NET Framework 3.5 SP1
- http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&DisplayLang=en
+ .NET Framework 4.0
+ http://msdn.microsoft.com/en-us/library/w0x726c2.aspx
_blank
- .
- For compiling AvalonEdit inside Visual Studio 2008, VS08 SP1 is required.
+ or higher; but we also offer a modified version for .NET 3.5 SP1.
+ For compiling AvalonEdit, you will need a C# 4.0 compiler (SharpDevelop 4.x or Visual Studio 2010).
AvalonEdit requires FullTrust and will not run as XBAP.
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Caret.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Caret.cs
index 5c6999c1fd..c82f906040 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Caret.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Caret.cs
@@ -22,6 +22,7 @@ namespace ICSharpCode.AvalonEdit.Editing
{
readonly TextArea textArea;
readonly TextView textView;
+ readonly ImeSupport ime;
readonly CaretLayer caretAdorner;
bool visible;
@@ -30,6 +31,7 @@ namespace ICSharpCode.AvalonEdit.Editing
this.textArea = textArea;
this.textView = textArea.TextView;
position = new TextViewPosition(1, 1, 0);
+ ime = new ImeSupport(textArea);
caretAdorner = new CaretLayer(textView);
textView.InsertLayer(caretAdorner, KnownLayer.Caret, LayerInsertionPosition.Replace);
@@ -434,6 +436,7 @@ namespace ICSharpCode.AvalonEdit.Editing
} else {
caretAdorner.Hide();
}
+ ime.UpdateCompositionWindow();
}
}
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/CaretNavigationCommandHandler.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/CaretNavigationCommandHandler.cs
index 036e57f59d..210878a229 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/CaretNavigationCommandHandler.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/CaretNavigationCommandHandler.cs
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
+using System.Linq;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Input;
@@ -41,21 +42,28 @@ namespace ICSharpCode.AvalonEdit.Editing
const ModifierKeys None = ModifierKeys.None;
const ModifierKeys Ctrl = ModifierKeys.Control;
const ModifierKeys Shift = ModifierKeys.Shift;
+ const ModifierKeys Alt = ModifierKeys.Alt;
AddBinding(EditingCommands.MoveLeftByCharacter, None, Key.Left, OnMoveCaret(CaretMovementType.CharLeft));
AddBinding(EditingCommands.SelectLeftByCharacter, Shift, Key.Left, OnMoveCaretExtendSelection(CaretMovementType.CharLeft));
+ AddBinding(RectangleSelection.BoxSelectLeftByCharacter, Alt | Shift, Key.Left, OnMoveCaretBoxSelection(CaretMovementType.CharLeft));
AddBinding(EditingCommands.MoveRightByCharacter, None, Key.Right, OnMoveCaret(CaretMovementType.CharRight));
AddBinding(EditingCommands.SelectRightByCharacter, Shift, Key.Right, OnMoveCaretExtendSelection(CaretMovementType.CharRight));
+ AddBinding(RectangleSelection.BoxSelectRightByCharacter, Alt | Shift, Key.Right, OnMoveCaretBoxSelection(CaretMovementType.CharRight));
AddBinding(EditingCommands.MoveLeftByWord, Ctrl, Key.Left, OnMoveCaret(CaretMovementType.WordLeft));
AddBinding(EditingCommands.SelectLeftByWord, Ctrl | Shift, Key.Left, OnMoveCaretExtendSelection(CaretMovementType.WordLeft));
+ AddBinding(RectangleSelection.BoxSelectLeftByWord, Ctrl | Alt | Shift, Key.Left, OnMoveCaretBoxSelection(CaretMovementType.WordLeft));
AddBinding(EditingCommands.MoveRightByWord, Ctrl, Key.Right, OnMoveCaret(CaretMovementType.WordRight));
AddBinding(EditingCommands.SelectRightByWord, Ctrl | Shift, Key.Right, OnMoveCaretExtendSelection(CaretMovementType.WordRight));
+ AddBinding(RectangleSelection.BoxSelectRightByWord, Ctrl | Alt | Shift, Key.Right, OnMoveCaretBoxSelection(CaretMovementType.WordRight));
AddBinding(EditingCommands.MoveUpByLine, None, Key.Up, OnMoveCaret(CaretMovementType.LineUp));
AddBinding(EditingCommands.SelectUpByLine, Shift, Key.Up, OnMoveCaretExtendSelection(CaretMovementType.LineUp));
+ AddBinding(RectangleSelection.BoxSelectUpByLine, Alt | Shift, Key.Up, OnMoveCaretBoxSelection(CaretMovementType.LineUp));
AddBinding(EditingCommands.MoveDownByLine, None, Key.Down, OnMoveCaret(CaretMovementType.LineDown));
AddBinding(EditingCommands.SelectDownByLine, Shift, Key.Down, OnMoveCaretExtendSelection(CaretMovementType.LineDown));
+ AddBinding(RectangleSelection.BoxSelectDownByLine, Alt | Shift, Key.Down, OnMoveCaretBoxSelection(CaretMovementType.LineDown));
AddBinding(EditingCommands.MoveDownByPage, None, Key.PageDown, OnMoveCaret(CaretMovementType.PageDown));
AddBinding(EditingCommands.SelectDownByPage, Shift, Key.PageDown, OnMoveCaretExtendSelection(CaretMovementType.PageDown));
@@ -64,8 +72,10 @@ namespace ICSharpCode.AvalonEdit.Editing
AddBinding(EditingCommands.MoveToLineStart, None, Key.Home, OnMoveCaret(CaretMovementType.LineStart));
AddBinding(EditingCommands.SelectToLineStart, Shift, Key.Home, OnMoveCaretExtendSelection(CaretMovementType.LineStart));
+ AddBinding(RectangleSelection.BoxSelectToLineStart, Alt | Shift, Key.Home, OnMoveCaretBoxSelection(CaretMovementType.LineStart));
AddBinding(EditingCommands.MoveToLineEnd, None, Key.End, OnMoveCaret(CaretMovementType.LineEnd));
AddBinding(EditingCommands.SelectToLineEnd, Shift, Key.End, OnMoveCaretExtendSelection(CaretMovementType.LineEnd));
+ AddBinding(RectangleSelection.BoxSelectToLineEnd, Alt | Shift, Key.End, OnMoveCaretBoxSelection(CaretMovementType.LineEnd));
AddBinding(EditingCommands.MoveToDocumentStart, Ctrl, Key.Home, OnMoveCaret(CaretMovementType.DocumentStart));
AddBinding(EditingCommands.SelectToDocumentStart, Ctrl | Shift, Key.Home, OnMoveCaretExtendSelection(CaretMovementType.DocumentStart));
@@ -135,6 +145,31 @@ namespace ICSharpCode.AvalonEdit.Editing
};
}
+ static ExecutedRoutedEventHandler OnMoveCaretBoxSelection(CaretMovementType direction)
+ {
+ return (target, args) => {
+ TextArea textArea = GetTextArea(target);
+ if (textArea != null && textArea.Document != null) {
+ args.Handled = true;
+ // First, convert the selection into a rectangle selection
+ // (this is required so that virtual space gets enabled for the caret movement)
+ if (textArea.Options.EnableRectangularSelection && !(textArea.Selection is RectangleSelection)) {
+ if (textArea.Selection.IsEmpty) {
+ textArea.Selection = new RectangleSelection(textArea, textArea.Caret.Position, textArea.Caret.Position);
+ } else {
+ // Convert normal selection to rectangle selection
+ textArea.Selection = new RectangleSelection(textArea, textArea.Selection.StartPosition, textArea.Caret.Position);
+ }
+ }
+ // Now move the caret and extend the selection
+ TextViewPosition oldPosition = textArea.Caret.Position;
+ MoveCaret(textArea, direction);
+ textArea.Selection = textArea.Selection.StartSelectionOrSetEndpoint(oldPosition, textArea.Caret.Position);
+ textArea.Caret.BringCaretToView();
+ }
+ };
+ }
+
#region Caret movement
static void MoveCaret(TextArea textArea, CaretMovementType direction)
{
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EmptySelection.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EmptySelection.cs
index 15b17252e4..989be43469 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EmptySelection.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EmptySelection.cs
@@ -20,6 +20,14 @@ namespace ICSharpCode.AvalonEdit.Editing
return this;
}
+ public override TextViewPosition StartPosition {
+ get { return new TextViewPosition(TextLocation.Empty); }
+ }
+
+ public override TextViewPosition EndPosition {
+ get { return new TextViewPosition(TextLocation.Empty); }
+ }
+
public override ISegment SurroundingSegment {
get { return null; }
}
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs
new file mode 100644
index 0000000000..1e81993239
--- /dev/null
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs
@@ -0,0 +1,178 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Windows;
+using System.Windows.Input;
+using System.Windows.Interop;
+using System.Windows.Media;
+using System.Windows.Media.TextFormatting;
+
+using ICSharpCode.AvalonEdit;
+using ICSharpCode.AvalonEdit.Document;
+using ICSharpCode.AvalonEdit.Rendering;
+using ICSharpCode.AvalonEdit.Utils;
+using Draw = System.Drawing;
+
+namespace ICSharpCode.AvalonEdit.Editing
+{
+ ///
+ /// Native API required for IME support.
+ ///
+ static class ImeNativeWrapper
+ {
+ [StructLayout(LayoutKind.Sequential)]
+ struct CompositionForm
+ {
+ public int dwStyle;
+ public POINT ptCurrentPos;
+ public RECT rcArea;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ struct POINT
+ {
+ public int x;
+ public int y;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ struct RECT
+ {
+ public int left;
+ public int top;
+ public int right;
+ public int bottom;
+ }
+
+ [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
+ class LOGFONT
+ {
+ public int lfHeight = 0;
+ public int lfWidth = 0;
+ public int lfEscapement = 0;
+ public int lfOrientation = 0;
+ public int lfWeight = 0;
+ public byte lfItalic = 0;
+ public byte lfUnderline = 0;
+ public byte lfStrikeOut = 0;
+ public byte lfCharSet = 0;
+ public byte lfOutPrecision = 0;
+ public byte lfClipPrecision = 0;
+ public byte lfQuality = 0;
+ public byte lfPitchAndFamily = 0;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst=32)] public string lfFaceName = null;
+ }
+
+ const int CPS_CANCEL = 0x4;
+ const int NI_COMPOSITIONSTR = 0x15;
+ const int GCS_COMPSTR = 0x0008;
+
+ public const int WM_IME_COMPOSITION = 0x10F;
+ public const int WM_INPUTLANGCHANGE = 0x51;
+
+ [DllImport("imm32.dll")]
+ static extern IntPtr ImmAssociateContext(IntPtr hWnd, IntPtr hIMC);
+ [DllImport("imm32.dll")]
+ static extern IntPtr ImmGetContext(IntPtr hWnd);
+ [DllImport("imm32.dll")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ static extern bool ImmNotifyIME(IntPtr hIMC, int dwAction, int dwIndex, int dwValue = 0);
+ [DllImport("imm32.dll")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ static extern bool ImmReleaseContext(IntPtr hWnd, IntPtr hIMC);
+ [DllImport("imm32.dll")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ static extern bool ImmSetCompositionWindow(IntPtr hIMC, ref CompositionForm form);
+ [DllImport("imm32.dll")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ static extern bool ImmSetCompositionFont(IntPtr hIMC, ref LOGFONT font);
+ [DllImport("imm32.dll")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ static extern bool ImmGetCompositionFont(IntPtr hIMC, out LOGFONT font);
+
+ public static IntPtr AssociateContext(HwndSource source, IntPtr hIMC)
+ {
+ if (source == null)
+ throw new ArgumentNullException("source");
+ return ImmAssociateContext(source.Handle, hIMC);
+ }
+
+ public static bool NotifyIme(IntPtr hIMC)
+ {
+ return ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_CANCEL);
+ }
+
+ public static IntPtr GetContext(HwndSource source)
+ {
+ if (source == null)
+ return IntPtr.Zero;
+ return ImmGetContext(source.Handle);
+ }
+
+ public static bool ReleaseContext(HwndSource source, IntPtr hIMC)
+ {
+ return source != null && hIMC != IntPtr.Zero && ImmReleaseContext(source.Handle, hIMC);
+ }
+
+ public static bool SetCompositionWindow(HwndSource source, IntPtr hIMC, TextArea textArea)
+ {
+ if (textArea == null)
+ throw new ArgumentNullException("textArea");
+ Rect textViewBounds = textArea.TextView.GetBounds();
+ Rect characterBounds = textArea.TextView.GetCharacterBounds(textArea.Caret.Position, source);
+ if (source != null) {
+ Matrix transformToDevice = source.CompositionTarget.TransformToDevice;
+ textViewBounds.Transform(transformToDevice);
+ characterBounds.Transform(transformToDevice);
+ }
+ CompositionForm form = new CompositionForm();
+ form.dwStyle = 0x0020;
+ form.ptCurrentPos.x = (int)Math.Max(characterBounds.Left, textViewBounds.Left);
+ form.ptCurrentPos.y = (int)Math.Max(characterBounds.Top, textViewBounds.Top);
+ form.rcArea.left = (int)textViewBounds.Left;
+ form.rcArea.top = (int)textViewBounds.Top;
+ form.rcArea.right = (int)textViewBounds.Right;
+ form.rcArea.bottom = (int)textViewBounds.Bottom;
+ return ImmSetCompositionWindow(hIMC, ref form);
+ }
+
+ public static bool SetCompositionFont(HwndSource source, IntPtr hIMC, TextArea textArea)
+ {
+ if (textArea == null)
+ throw new ArgumentNullException("textArea");
+// LOGFONT font = new LOGFONT();
+// ImmGetCompositionFont(hIMC, out font);
+ return false;
+ }
+
+ static Rect GetBounds(this TextView textView)
+ {
+ Point location = textView.TranslatePoint(new Point(0,0), textView);
+ return new Rect(location, new Size(textView.ActualWidth, textView.ActualHeight));
+ }
+
+ static readonly Rect EMPTY_RECT = new Rect(0, 0, 0, 0);
+
+ static Rect GetCharacterBounds(this TextView textView, TextViewPosition pos, HwndSource source)
+ {
+ VisualLine vl = textView.GetVisualLine(pos.Line);
+ if (vl == null) return EMPTY_RECT;
+ TextLine line = vl.GetTextLine(pos.VisualColumn);
+ double offset = vl.GetTextLineVisualYPosition(line, VisualYPosition.LineTop) - textView.ScrollOffset.Y;
+ Rect r = line.GetTextBounds(pos.VisualColumn, 1).First().Rectangle;
+ r.Offset(-textView.ScrollOffset.X, offset);
+ // this may happen during layout changes in AvalonDock, so we just return an empty rectangle
+ // in those cases. It should be refreshed immediately.
+ if (!source.RootVisual.IsAncestorOf(textView)) return EMPTY_RECT;
+ Point pointOnRootVisual = textView.TransformToAncestor(source.RootVisual).Transform(r.Location);
+ Point pointOnHwnd = pointOnRootVisual.TransformToDevice(source.RootVisual);
+ r.Location = pointOnHwnd;
+ return r;
+ }
+ }
+}
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/ImeSupport.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/ImeSupport.cs
new file mode 100644
index 0000000000..934c546210
--- /dev/null
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/ImeSupport.cs
@@ -0,0 +1,125 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using System.ComponentModel;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Windows.Interop;
+using System.Windows.Media;
+using System.Windows.Media.TextFormatting;
+using ICSharpCode.AvalonEdit;
+using ICSharpCode.AvalonEdit.Document;
+using ICSharpCode.AvalonEdit.Rendering;
+
+namespace ICSharpCode.AvalonEdit.Editing
+{
+ class ImeSupport : IDisposable
+ {
+ TextArea textArea;
+ IntPtr currentContext;
+ IntPtr previousContext;
+ HwndSource hwndSource;
+
+ public ImeSupport(TextArea textArea)
+ {
+ if (textArea == null)
+ throw new ArgumentNullException("textArea");
+ this.textArea = textArea;
+ InputMethod.SetIsInputMethodSuspended(this.textArea, true);
+ textArea.GotKeyboardFocus += TextAreaGotKeyboardFocus;
+ textArea.LostKeyboardFocus += TextAreaLostKeyboardFocus;
+ textArea.OptionChanged += TextAreaOptionChanged;
+ currentContext = IntPtr.Zero;
+ previousContext = IntPtr.Zero;
+ }
+
+ void TextAreaOptionChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName == "EnableImeSupport" && textArea.IsKeyboardFocusWithin) {
+ CreateContext();
+ }
+ }
+
+ public void Dispose()
+ {
+ if (textArea != null) {
+ textArea.GotKeyboardFocus -= TextAreaGotKeyboardFocus;
+ textArea.LostKeyboardFocus -= TextAreaLostKeyboardFocus;
+ textArea = null;
+ }
+ ClearContext();
+ }
+
+ void ClearContext()
+ {
+ if (hwndSource != null) {
+ hwndSource.RemoveHook(WndProc);
+ ImeNativeWrapper.AssociateContext(hwndSource, previousContext);
+ previousContext = IntPtr.Zero;
+ ImeNativeWrapper.ReleaseContext(hwndSource, currentContext);
+ hwndSource = null;
+ currentContext = IntPtr.Zero;
+ }
+ }
+
+ void TextAreaGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
+ {
+ if (this.textArea == null)
+ return;
+ if (e.OriginalSource != this.textArea)
+ return;
+ CreateContext();
+ }
+
+ void CreateContext()
+ {
+ if (this.textArea == null)
+ return;
+ if (!textArea.Options.EnableImeSupport)
+ return;
+ hwndSource = (HwndSource)PresentationSource.FromVisual(this.textArea);
+ if (hwndSource != null) {
+ currentContext = ImeNativeWrapper.GetContext(hwndSource);
+ previousContext = ImeNativeWrapper.AssociateContext(hwndSource, currentContext);
+// ImeNativeWrapper.SetCompositionFont(hwndSource, currentContext, textArea);
+ hwndSource.AddHook(WndProc);
+ }
+ }
+
+ void TextAreaLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
+ {
+ if (e.OriginalSource != this.textArea)
+ return;
+ if (currentContext != IntPtr.Zero)
+ ImeNativeWrapper.NotifyIme(currentContext);
+ ClearContext();
+ }
+
+ IntPtr WndProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
+ {
+ switch (msg) {
+ case ImeNativeWrapper.WM_INPUTLANGCHANGE:
+ ClearContext();
+ CreateContext();
+ break;
+ case ImeNativeWrapper.WM_IME_COMPOSITION:
+ UpdateCompositionWindow();
+ break;
+ }
+ return IntPtr.Zero;
+ }
+
+ public void UpdateCompositionWindow()
+ {
+ if (currentContext != IntPtr.Zero && textArea != null) {
+ ImeNativeWrapper.SetCompositionWindow(hwndSource, currentContext, textArea);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/RectangleSelection.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/RectangleSelection.cs
index 733b178e34..9851b11b13 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/RectangleSelection.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/RectangleSelection.cs
@@ -7,8 +7,9 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
+using System.Windows.Documents;
+using System.Windows.Input;
using System.Windows.Media.TextFormatting;
-
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Rendering;
using ICSharpCode.AvalonEdit.Utils;
@@ -20,20 +21,70 @@ namespace ICSharpCode.AvalonEdit.Editing
///
public sealed class RectangleSelection : Selection
{
+ #region Commands
+ ///
+ /// Expands the selection left by one character, creating a rectangular selection.
+ /// Key gesture: Alt+Shift+Left
+ ///
+ public static readonly RoutedUICommand BoxSelectLeftByCharacter = Command("BoxSelectLeftByCharacter");
+
+ ///
+ /// Expands the selection right by one character, creating a rectangular selection.
+ /// Key gesture: Alt+Shift+Right
+ ///
+ public static readonly RoutedUICommand BoxSelectRightByCharacter = Command("BoxSelectRightByCharacter");
+
+ ///
+ /// Expands the selection left by one word, creating a rectangular selection.
+ /// Key gesture: Ctrl+Alt+Shift+Left
+ ///
+ public static readonly RoutedUICommand BoxSelectLeftByWord = Command("BoxSelectLeftByWord");
+
+ ///
+ /// Expands the selection left by one word, creating a rectangular selection.
+ /// Key gesture: Ctrl+Alt+Shift+Right
+ ///
+ public static readonly RoutedUICommand BoxSelectRightByWord = Command("BoxSelectRightByWord");
+
+ ///
+ /// Expands the selection up by one line, creating a rectangular selection.
+ /// Key gesture: Alt+Shift+Up
+ ///
+ public static readonly RoutedUICommand BoxSelectUpByLine = Command("BoxSelectUpByLine");
+
+ ///
+ /// Expands the selection up by one line, creating a rectangular selection.
+ /// Key gesture: Alt+Shift+Down
+ ///
+ public static readonly RoutedUICommand BoxSelectDownByLine = Command("BoxSelectDownByLine");
+
+ ///
+ /// Expands the selection to the start of the line, creating a rectangular selection.
+ /// Key gesture: Alt+Shift+Home
+ ///
+ public static readonly RoutedUICommand BoxSelectToLineStart = Command("BoxSelectToLineStart");
+
+ ///
+ /// Expands the selection to the end of the line, creating a rectangular selection.
+ /// Key gesture: Alt+Shift+End
+ ///
+ public static readonly RoutedUICommand BoxSelectToLineEnd = Command("BoxSelectToLineEnd");
+
+ static RoutedUICommand Command(string name)
+ {
+ return new RoutedUICommand(name, name, typeof(RectangleSelection));
+ }
+ #endregion
+
TextDocument document;
readonly int startLine, endLine;
readonly double startXPos, endXPos;
readonly int topLeftOffset, bottomRightOffset;
+ readonly TextViewPosition start, end;
readonly List segments = new List();
- void InitDocument()
- {
- document = textArea.Document;
- if (document == null)
- throw ThrowUtil.NoDocumentAssigned();
- }
-
+ #region Constructors
///
/// Creates a new rectangular selection.
///
@@ -48,6 +99,9 @@ namespace ICSharpCode.AvalonEdit.Editing
CalculateSegments();
this.topLeftOffset = this.segments.First().StartOffset;
this.bottomRightOffset = this.segments.Last().EndOffset;
+
+ this.start = start;
+ this.end = end;
}
private RectangleSelection(TextArea textArea, int startLine, double startXPos, TextViewPosition end)
@@ -61,6 +115,9 @@ namespace ICSharpCode.AvalonEdit.Editing
CalculateSegments();
this.topLeftOffset = this.segments.First().StartOffset;
this.bottomRightOffset = this.segments.Last().EndOffset;
+
+ this.start = GetStart();
+ this.end = end;
}
private RectangleSelection(TextArea textArea, TextViewPosition start, int endLine, double endXPos)
@@ -74,6 +131,16 @@ namespace ICSharpCode.AvalonEdit.Editing
CalculateSegments();
this.topLeftOffset = this.segments.First().StartOffset;
this.bottomRightOffset = this.segments.Last().EndOffset;
+
+ this.start = start;
+ this.end = GetEnd();
+ }
+
+ void InitDocument()
+ {
+ document = textArea.Document;
+ if (document == null)
+ throw ThrowUtil.NoDocumentAssigned();
}
static double GetXPos(TextArea textArea, TextViewPosition pos)
@@ -85,11 +152,43 @@ namespace ICSharpCode.AvalonEdit.Editing
return visualLine.GetTextLineVisualXPosition(textLine, vc);
}
- int GetVisualColumnFromXPos(int line, double xPos)
+ void CalculateSegments()
{
- var vl = textArea.TextView.GetOrConstructVisualLine(textArea.Document.GetLineByNumber(line));
- return vl.GetVisualColumn(new Point(xPos, 0), true);
+ DocumentLine nextLine = document.GetLineByNumber(Math.Min(startLine, endLine));
+ do {
+ VisualLine vl = textArea.TextView.GetOrConstructVisualLine(nextLine);
+ int startVC = vl.GetVisualColumn(new Point(startXPos, 0), true);
+ int endVC = vl.GetVisualColumn(new Point(endXPos, 0), true);
+
+ int baseOffset = vl.FirstDocumentLine.Offset;
+ int startOffset = baseOffset + vl.GetRelativeOffset(startVC);
+ int endOffset = baseOffset + vl.GetRelativeOffset(endVC);
+ segments.Add(new SelectionSegment(startOffset, startVC, endOffset, endVC));
+
+ nextLine = vl.LastDocumentLine.NextLine;
+ } while (nextLine != null && nextLine.LineNumber <= Math.Max(startLine, endLine));
+ }
+
+ TextViewPosition GetStart()
+ {
+ SelectionSegment segment = (startLine < endLine ? segments.First() : segments.Last());
+ if (startXPos < endXPos) {
+ return new TextViewPosition(document.GetLocation(segment.StartOffset), segment.StartVisualColumn);
+ } else {
+ return new TextViewPosition(document.GetLocation(segment.EndOffset), segment.EndVisualColumn);
+ }
+ }
+
+ TextViewPosition GetEnd()
+ {
+ SelectionSegment segment = (startLine < endLine ? segments.Last() : segments.First());
+ if (startXPos < endXPos) {
+ return new TextViewPosition(document.GetLocation(segment.EndOffset), segment.EndVisualColumn);
+ } else {
+ return new TextViewPosition(document.GetLocation(segment.StartOffset), segment.StartVisualColumn);
+ }
}
+ #endregion
///
public override string GetText()
@@ -133,22 +232,14 @@ namespace ICSharpCode.AvalonEdit.Editing
get { return segments; }
}
+ ///
+ public override TextViewPosition StartPosition {
+ get { return start; }
+ }
- void CalculateSegments()
- {
- DocumentLine nextLine = document.GetLineByNumber(Math.Min(startLine, endLine));
- do {
- VisualLine vl = textArea.TextView.GetOrConstructVisualLine(nextLine);
- int startVC = vl.GetVisualColumn(new Point(startXPos, 0), true);
- int endVC = vl.GetVisualColumn(new Point(endXPos, 0), true);
-
- int baseOffset = vl.FirstDocumentLine.Offset;
- int startOffset = baseOffset + vl.GetRelativeOffset(startVC);
- int endOffset = baseOffset + vl.GetRelativeOffset(endVC);
- segments.Add(new SelectionSegment(startOffset, startVC, endOffset, endVC));
-
- nextLine = vl.LastDocumentLine.NextLine;
- } while (nextLine != null && nextLine.LineNumber <= Math.Max(startLine, endLine));
+ ///
+ public override TextViewPosition EndPosition {
+ get { return end; }
}
///
@@ -173,6 +264,12 @@ namespace ICSharpCode.AvalonEdit.Editing
return new RectangleSelection(textArea, startLine, startXPos, endPosition);
}
+ int GetVisualColumnFromXPos(int line, double xPos)
+ {
+ var vl = textArea.TextView.GetOrConstructVisualLine(textArea.Document.GetLineByNumber(line));
+ return vl.GetVisualColumn(new Point(xPos, 0), true);
+ }
+
///
public override Selection UpdateOnDocumentChange(DocumentChangeEventArgs e)
{
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Selection.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Selection.cs
index ed30ab1ddd..005d8e5237 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Selection.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Selection.cs
@@ -63,6 +63,16 @@ namespace ICSharpCode.AvalonEdit.Editing
this.textArea = textArea;
}
+ ///
+ /// Gets the start position of the selection.
+ ///
+ public abstract TextViewPosition StartPosition { get; }
+
+ ///
+ /// Gets the end position of the selection.
+ ///
+ public abstract TextViewPosition EndPosition { get; }
+
///
/// Gets the selected text segments.
///
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs
index 879445dc05..5e8db07024 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs
@@ -71,18 +71,12 @@ namespace ICSharpCode.AvalonEdit.Editing
}
}
- ///
- /// Gets the start offset.
- ///
- public int StartOffset {
- get { return startOffset; }
+ public override TextViewPosition StartPosition {
+ get { return start; }
}
- ///
- /// Gets the end offset.
- ///
- public int EndOffset {
- get { return endOffset; }
+ public override TextViewPosition EndPosition {
+ get { return end; }
}
///
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs
index 3f5b4448d4..c74cebb683 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs
@@ -806,11 +806,13 @@ namespace ICSharpCode.AvalonEdit.Editing
//Debug.WriteLine("TextInput: Text='" + e.Text + "' SystemText='" + e.SystemText + "' ControlText='" + e.ControlText + "'");
base.OnTextInput(e);
if (!e.Handled && this.Document != null) {
- if (string.IsNullOrEmpty(e.Text) || e.Text == "\x1b") {
+ if (string.IsNullOrEmpty(e.Text) || e.Text == "\x1b" || e.Text == "\b") {
// ASCII 0x1b = ESC.
// WPF produces a TextInput event with that old ASCII control char
// when Escape is pressed. We'll just ignore it.
+ // A deadkey followed by backspace causes a textinput event for the BS character.
+
// Similarly, some shortcuts like Alt+Space produce an empty TextInput event.
// We have to ignore those (not handle them) to keep the shortcut working.
return;
@@ -846,7 +848,7 @@ namespace ICSharpCode.AvalonEdit.Editing
throw ThrowUtil.NoDocumentAssigned();
OnTextEntering(e);
if (!e.Handled) {
- if (e.Text == "\n" || e.Text == "\r\n")
+ if (e.Text == "\n" || e.Text == "\r" || e.Text == "\r\n")
ReplaceSelectionWithNewLine();
else
ReplaceSelectionWithText(e.Text);
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/DocumentHighlighter.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/DocumentHighlighter.cs
index 8a201fad36..34025e59b9 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/DocumentHighlighter.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/DocumentHighlighter.cs
@@ -282,11 +282,14 @@ namespace ICSharpCode.AvalonEdit.Highlighting
Debug.Assert(position == firstMatch.Index);
if (firstMatch == endSpanMatch) {
- PopColor(); // pop SpanColor
HighlightingSpan poppedSpan = spanStack.Peek();
+ if (!poppedSpan.SpanColorIncludesEnd)
+ PopColor(); // pop SpanColor
PushColor(poppedSpan.EndColor);
position = firstMatch.Index + firstMatch.Length;
PopColor(); // pop EndColor
+ if (poppedSpan.SpanColorIncludesEnd)
+ PopColor(); // pop SpanColor
spanStack = spanStack.Pop();
currentRuleSet = this.CurrentRuleSet;
//FreeMatchArray(matches);
@@ -312,10 +315,13 @@ namespace ICSharpCode.AvalonEdit.Highlighting
currentRuleSet = this.CurrentRuleSet;
storedMatchArrays.Push(matches);
matches = AllocateMatchArray(currentRuleSet.Spans.Count);
+ if (newSpan.SpanColorIncludesStart)
+ PushColor(newSpan.SpanColor);
PushColor(newSpan.StartColor);
position = firstMatch.Index + firstMatch.Length;
PopColor();
- PushColor(newSpan.SpanColor);
+ if (!newSpan.SpanColorIncludesStart)
+ PushColor(newSpan.SpanColor);
}
endSpanMatch = null;
}
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingSpan.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingSpan.cs
index 4b2f71322b..b9552e5bbb 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingSpan.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingSpan.cs
@@ -43,6 +43,18 @@ namespace ICSharpCode.AvalonEdit.Highlighting
///
public HighlightingColor EndColor { get; set; }
+ ///
+ /// Gets/Sets whether the span color includes the start.
+ /// The default is false.
+ ///
+ public bool SpanColorIncludesStart { get; set; }
+
+ ///
+ /// Gets/Sets whether the span color includes the end.
+ /// The default is false.
+ ///
+ public bool SpanColorIncludesEnd { get; set; }
+
///
public override string ToString()
{
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/PowerShell.xshd b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/PowerShell.xshd
new file mode 100644
index 0000000000..ee6fec4c8d
--- /dev/null
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/PowerShell.xshd
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ \#
+
+
+
+ <\#
+ \#>
+
+
+
+ "
+ "
+
+
+
+
+
+
+
+ '
+ '
+
+
+
+
+
+
+
+ @"
+ "@
+
+
+
+
+
+
+
+ while
+ param
+ end
+ define
+ else
+ from
+ foreach
+ var
+ dynamicparam
+ filter
+ dp
+ until
+ for
+ exit
+ switch
+ process
+ begin
+ elseif
+ if
+ in
+ data
+ class
+ using
+ function
+
+
+
+ catch
+ finally
+ throw
+ trap
+ try
+
+
+
+ break
+ continue
+ return
+
+
+
+ class
+
+
+
+ -not
+ -band
+ -bor
+ -replace
+ -ireplace
+ -creplace
+ -and
+ -or
+ -is
+ -isnot
+ -as
+ -lt
+ -le
+ -gt
+ -ge
+ -eq
+ -ne
+ -contains
+ -notcontains
+ -like
+ -notlike
+ -match
+ -notmatch
+
+
+
+ \$[\d\w_]+
+
+
+
+ [\w]+-[\w]+
+
+
+
+
+ \b0[xX][0-9a-fA-F]+ # hex number
+ |
+ ( \b\d+(\.[0-9]+)? #number with optional floating point
+ | \.[0-9]+ #or just starting with floating point
+ )
+ ([eE][+-]?[0-9]+)? # optional exponent
+
+
+
+ [?,.;()\[\]{}+\-/%*<>^+~!|&]+
+
+
+
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Resources.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Resources.cs
index 594417e04b..07827576cb 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Resources.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Resources.cs
@@ -33,13 +33,14 @@ namespace ICSharpCode.AvalonEdit.Highlighting
hlm.RegisterHighlighting("C++", new[] { ".c", ".h", ".cc", ".cpp" , ".hpp" }, "CPP-Mode.xshd");
hlm.RegisterHighlighting("Java", new[] { ".java" }, "Java-Mode.xshd");
hlm.RegisterHighlighting("Patch", new[] { ".patch", ".diff" }, "Patch-Mode.xshd");
+ hlm.RegisterHighlighting("PowerShell", new[] { ".ps1", ".psm1", ".psd1" }, "PowerShell.xshd");
hlm.RegisterHighlighting("PHP", new[] { ".php" }, "PHP-Mode.xshd");
hlm.RegisterHighlighting("TeX", new[] { ".tex" }, "Tex-Mode.xshd");
hlm.RegisterHighlighting("VBNET", new[] { ".vb" }, "VBNET-Mode.xshd");
hlm.RegisterHighlighting("XML", (".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;" +
".xshd;.wxs;.wxi;.wxl;.proj;.csproj;.vbproj;.ilproj;" +
".booproj;.build;.xfrm;.targets;.xaml;.xpt;" +
- ".xft;.map;.wsdl;.disco").Split(';'),
+ ".xft;.map;.wsdl;.disco;.ps1xml;.nuspec").Split(';'),
"XML-Mode.xshd");
}
}
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/XML-Mode.xshd b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/XML-Mode.xshd
index f77b72d8ed..8f0bdef769 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/XML-Mode.xshd
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/XML-Mode.xshd
@@ -1,4 +1,4 @@
-
+
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/XmlHighlightingDefinition.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/XmlHighlightingDefinition.cs
index a0525cc1e7..d8bae25056 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/XmlHighlightingDefinition.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/XmlHighlightingDefinition.cs
@@ -317,22 +317,11 @@ namespace ICSharpCode.AvalonEdit.Highlighting.Xshd
StartExpression = CreateRegex(span, span.BeginRegex, span.BeginRegexType),
EndExpression = CreateRegex(span, endRegex, span.EndRegexType),
RuleSet = GetRuleSet(span, span.RuleSetReference),
- StartColor = MergeColor(wholeSpanColor, GetColor(span, span.BeginColorReference)),
+ StartColor = GetColor(span, span.BeginColorReference),
SpanColor = wholeSpanColor,
- EndColor = MergeColor(wholeSpanColor, GetColor(span, span.EndColorReference)),
- };
- }
-
- static HighlightingColor MergeColor(HighlightingColor baseColor, HighlightingColor newColor)
- {
- if (baseColor == null)
- return newColor;
- if (newColor == null)
- return baseColor;
- return new HighlightingColor {
- Foreground = newColor.Foreground ?? baseColor.Foreground,
- FontWeight = newColor.FontWeight ?? baseColor.FontWeight,
- FontStyle = newColor.FontStyle ?? baseColor.FontStyle,
+ EndColor = GetColor(span, span.EndColorReference),
+ SpanColorIncludesStart = true,
+ SpanColorIncludesEnd = true
};
}
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj
index 3d644e2710..2f2414acf4 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj
@@ -147,7 +147,9 @@
Selection.cs
+
+
@@ -440,4 +442,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/SearchPanel.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/SearchPanel.cs
index cb4c9970e4..586c8c9b18 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/SearchPanel.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/SearchPanel.cs
@@ -198,8 +198,10 @@ namespace ICSharpCode.AvalonEdit.Search
if (currentDocument != null)
currentDocument.TextChanged -= textArea_Document_TextChanged;
currentDocument = textArea.Document;
- if (currentDocument != null)
+ if (currentDocument != null) {
currentDocument.TextChanged += textArea_Document_TextChanged;
+ DoSearch(false);
+ }
}
void textArea_Document_TextChanged(object sender, EventArgs e)
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditorOptions.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditorOptions.cs
index df95a8d488..897fcbcf45 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditorOptions.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditorOptions.cs
@@ -381,5 +381,22 @@ namespace ICSharpCode.AvalonEdit
}
}
}
+
+ bool enableImeSupport = true;
+
+ ///
+ /// Gets/Sets whether the support for Input Method Editors (IME)
+ /// for non-alphanumeric scripts (Chinese, Japanese, Korean, ...) is enabled.
+ ///
+ [DefaultValue(true)]
+ public virtual bool EnableImeSupport {
+ get { return enableImeSupport; }
+ set {
+ if (enableImeSupport != value) {
+ enableImeSupport = value;
+ OnPropertyChanged("EnableImeSupport");
+ }
+ }
+ }
}
}
diff --git a/src/Libraries/ICSharpCode.Decompiler/Ast/AstBuilder.cs b/src/Libraries/ICSharpCode.Decompiler/Ast/AstBuilder.cs
index bf647b379d..fc288d80fd 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Ast/AstBuilder.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Ast/AstBuilder.cs
@@ -157,15 +157,10 @@ namespace ICSharpCode.Decompiler.Ast
if (!transformationsHaveRun)
RunTransformations();
- astCompileUnit.AcceptVisitor(new InsertParenthesesVisitor { InsertParenthesesForReadability = true }, null);
+ astCompileUnit.AcceptVisitor(new InsertParenthesesVisitor { InsertParenthesesForReadability = true });
var outputFormatter = new TextOutputFormatter(output);
- var formattingPolicy = new CSharpFormattingOptions();
- // disable whitespace in front of parentheses:
- formattingPolicy.SpaceBeforeMethodCallParentheses = false;
- formattingPolicy.SpaceBeforeMethodDeclarationParentheses = false;
- formattingPolicy.SpaceBeforeConstructorDeclarationParentheses = false;
- formattingPolicy.SpaceBeforeDelegateDeclarationParentheses = false;
- astCompileUnit.AcceptVisitor(new CSharpOutputVisitor(outputFormatter, formattingPolicy), null);
+ var formattingPolicy = context.Settings.CSharpFormattingOptions;
+ astCompileUnit.AcceptVisitor(new CSharpOutputVisitor(outputFormatter, formattingPolicy));
}
public void AddAssembly(AssemblyDefinition assemblyDefinition, bool onlyAssemblyLevel = false)
@@ -185,7 +180,7 @@ namespace ICSharpCode.Decompiler.Ast
}
}
}
- }, AttributedNode.AttributeRole);
+ }, EntityDeclaration.AttributeRole);
}
ConvertCustomAttributes(astCompileUnit, assemblyDefinition, "assembly");
@@ -225,7 +220,7 @@ namespace ICSharpCode.Decompiler.Ast
Arguments = { forwardedType }
}
}
- }, AttributedNode.AttributeRole);
+ }, EntityDeclaration.AttributeRole);
}
}
}
@@ -283,7 +278,7 @@ namespace ICSharpCode.Decompiler.Ast
///
///
/// TypeDeclaration or DelegateDeclaration.
- public AttributedNode CreateType(TypeDefinition typeDef)
+ public EntityDeclaration CreateType(TypeDefinition typeDef)
{
// create type
TypeDefinition oldCurrentType = context.CurrentType;
@@ -313,7 +308,7 @@ namespace ICSharpCode.Decompiler.Ast
astType.TypeParameters.AddRange(MakeTypeParameters(genericParameters));
astType.Constraints.AddRange(MakeConstraints(genericParameters));
- AttributedNode result = astType;
+ EntityDeclaration result = astType;
if (typeDef.IsEnum) {
long expectedEnumMemberValue = 0;
bool forcePrintingInitializers = IsFlagsEnum(typeDef);
@@ -321,7 +316,7 @@ namespace ICSharpCode.Decompiler.Ast
if (!field.IsStatic) {
// the value__ field
if (field.FieldType != typeDef.Module.TypeSystem.Int32) {
- astType.AddChild(ConvertType(field.FieldType), TypeDeclaration.BaseTypeRole);
+ astType.AddChild(ConvertType(field.FieldType), Roles.BaseType);
}
} else {
EnumMemberDeclaration enumMember = new EnumMemberDeclaration();
@@ -332,7 +327,7 @@ namespace ICSharpCode.Decompiler.Ast
enumMember.AddChild(new PrimitiveExpression(field.Constant), EnumMemberDeclaration.InitializerRole);
}
expectedEnumMemberValue = memberValue + 1;
- astType.AddChild(enumMember, TypeDeclaration.MemberRole);
+ astType.AddChild(enumMember, Roles.TypeMemberRole);
}
}
} else if (typeDef.BaseType != null && typeDef.BaseType.FullName == "System.MulticastDelegate") {
@@ -354,10 +349,10 @@ namespace ICSharpCode.Decompiler.Ast
} else {
// Base type
if (typeDef.BaseType != null && !typeDef.IsValueType && typeDef.BaseType.FullName != "System.Object") {
- astType.AddChild(ConvertType(typeDef.BaseType), TypeDeclaration.BaseTypeRole);
+ astType.AddChild(ConvertType(typeDef.BaseType), Roles.BaseType);
}
foreach (var i in typeDef.Interfaces)
- astType.AddChild(ConvertType(i), TypeDeclaration.BaseTypeRole);
+ astType.AddChild(ConvertType(i), Roles.BaseType);
AddTypeMembers(astType, typeDef);
@@ -726,18 +721,18 @@ namespace ICSharpCode.Decompiler.Ast
continue;
var nestedType = CreateType(nestedTypeDef);
SetNewModifier(nestedType);
- astType.AddChild(nestedType, TypeDeclaration.MemberRole);
+ astType.AddChild(nestedType, Roles.TypeMemberRole);
}
// Add fields
foreach(FieldDefinition fieldDef in typeDef.Fields) {
if (MemberIsHidden(fieldDef, context.Settings)) continue;
- astType.AddChild(CreateField(fieldDef), TypeDeclaration.MemberRole);
+ astType.AddChild(CreateField(fieldDef), Roles.TypeMemberRole);
}
// Add events
foreach(EventDefinition eventDef in typeDef.Events) {
- astType.AddChild(CreateEvent(eventDef), TypeDeclaration.MemberRole);
+ astType.AddChild(CreateEvent(eventDef), Roles.TypeMemberRole);
}
// Add properties
@@ -756,7 +751,7 @@ namespace ICSharpCode.Decompiler.Ast
}
}
- AttributedNode CreateMethod(MethodDefinition methodDef)
+ EntityDeclaration CreateMethod(MethodDefinition methodDef)
{
MethodDeclaration astMethod = new MethodDeclaration();
astMethod.AddAnnotation(methodDef);
@@ -860,7 +855,7 @@ namespace ICSharpCode.Decompiler.Ast
astMethod.Body = CreateMethodBody(methodDef, astMethod.Parameters);
ConvertAttributes(astMethod, methodDef);
if (methodDef.IsStatic && methodDef.DeclaringType.IsBeforeFieldInit && !astMethod.Body.IsNull) {
- astMethod.Body.InsertChildAfter(null, new Comment(" Note: this type is marked as 'beforefieldinit'."), AstNode.Roles.Comment);
+ astMethod.Body.InsertChildAfter(null, new Comment(" Note: this type is marked as 'beforefieldinit'."), Roles.Comment);
}
return astMethod;
}
@@ -878,7 +873,7 @@ namespace ICSharpCode.Decompiler.Ast
return m & ~Modifiers.Private;
}
- MemberDeclaration CreateProperty(PropertyDefinition propDef)
+ EntityDeclaration CreateProperty(PropertyDefinition propDef)
{
PropertyDeclaration astProp = new PropertyDeclaration();
astProp.AddAnnotation(propDef);
@@ -937,7 +932,7 @@ namespace ICSharpCode.Decompiler.Ast
}
ConvertCustomAttributes(astProp, propDef);
- MemberDeclaration member = astProp;
+ EntityDeclaration member = astProp;
if(propDef.IsIndexer())
member = ConvertPropertyToIndexer(astProp, propDef);
if(!accessor.HasOverrides && !accessor.DeclaringType.IsInterface)
@@ -960,7 +955,7 @@ namespace ICSharpCode.Decompiler.Ast
return astIndexer;
}
- AttributedNode CreateEvent(EventDefinition eventDef)
+ EntityDeclaration CreateEvent(EventDefinition eventDef)
{
if (eventDef.AddMethod != null && eventDef.AddMethod.IsAbstract) {
// An abstract event cannot be custom
@@ -1018,7 +1013,7 @@ namespace ICSharpCode.Decompiler.Ast
FieldDeclaration astField = new FieldDeclaration();
astField.AddAnnotation(fieldDef);
VariableInitializer initializer = new VariableInitializer(CleanName(fieldDef.Name));
- astField.AddChild(initializer, FieldDeclaration.Roles.Variable);
+ astField.AddChild(initializer, Roles.Variable);
astField.ReturnType = ConvertType(fieldDef.FieldType, fieldDef);
astField.Modifiers = ConvertModifiers(fieldDef);
if (fieldDef.HasConstant) {
@@ -1098,7 +1093,7 @@ namespace ICSharpCode.Decompiler.Ast
}
#region ConvertAttributes
- void ConvertAttributes(AttributedNode attributedNode, TypeDefinition typeDefinition)
+ void ConvertAttributes(EntityDeclaration attributedNode, TypeDefinition typeDefinition)
{
ConvertCustomAttributes(attributedNode, typeDefinition);
ConvertSecurityAttributes(attributedNode, typeDefinition);
@@ -1154,7 +1149,7 @@ namespace ICSharpCode.Decompiler.Ast
#endregion
}
- void ConvertAttributes(AttributedNode attributedNode, MethodDefinition methodDefinition)
+ void ConvertAttributes(EntityDeclaration attributedNode, MethodDefinition methodDefinition)
{
ConvertCustomAttributes(attributedNode, methodDefinition);
ConvertSecurityAttributes(attributedNode, methodDefinition);
@@ -1254,7 +1249,7 @@ namespace ICSharpCode.Decompiler.Ast
ConvertAttributes(attributedNode, methodDefinition.MethodReturnType, methodDefinition.Module);
}
- void ConvertAttributes(AttributedNode attributedNode, MethodReturnType methodReturnType, ModuleDefinition module)
+ void ConvertAttributes(EntityDeclaration attributedNode, MethodReturnType methodReturnType, ModuleDefinition module)
{
ConvertCustomAttributes(attributedNode, methodReturnType, "return");
if (methodReturnType.HasMarshalInfo) {
@@ -1263,7 +1258,7 @@ namespace ICSharpCode.Decompiler.Ast
}
}
- internal static void ConvertAttributes(AttributedNode attributedNode, FieldDefinition fieldDefinition, string attributeTarget = null)
+ internal static void ConvertAttributes(EntityDeclaration attributedNode, FieldDefinition fieldDefinition, string attributeTarget = null)
{
ConvertCustomAttributes(attributedNode, fieldDefinition);
@@ -1402,14 +1397,14 @@ namespace ICSharpCode.Decompiler.Ast
var section = new AttributeSection();
section.AttributeTarget = attributeTarget;
section.Attributes.Add(attribute);
- attributedNode.AddChild(section, AttributedNode.AttributeRole);
+ attributedNode.AddChild(section, EntityDeclaration.AttributeRole);
}
} else if (attributes.Count > 0) {
// use single section for all attributes
var section = new AttributeSection();
section.AttributeTarget = attributeTarget;
section.Attributes.AddRange(attributes);
- attributedNode.AddChild(section, AttributedNode.AttributeRole);
+ attributedNode.AddChild(section, EntityDeclaration.AttributeRole);
}
}
}
@@ -1462,14 +1457,14 @@ namespace ICSharpCode.Decompiler.Ast
var section = new AttributeSection();
section.AttributeTarget = attributeTarget;
section.Attributes.Add(attribute);
- attributedNode.AddChild(section, AttributedNode.AttributeRole);
+ attributedNode.AddChild(section, EntityDeclaration.AttributeRole);
}
} else if (attributes.Count > 0) {
// use single section for all attributes
var section = new AttributeSection();
section.AttributeTarget = attributeTarget;
section.Attributes.AddRange(attributes);
- attributedNode.AddChild(section, AttributedNode.AttributeRole);
+ attributedNode.AddChild(section, EntityDeclaration.AttributeRole);
}
}
@@ -1594,7 +1589,7 @@ namespace ICSharpCode.Decompiler.Ast
/// Sets new modifier if the member hides some other member from a base type.
///
/// The node of the member which new modifier state should be determined.
- static void SetNewModifier(AttributedNode member)
+ static void SetNewModifier(EntityDeclaration member)
{
try {
bool addNewModifier = false;
@@ -1614,7 +1609,7 @@ namespace ICSharpCode.Decompiler.Ast
}
}
- private static bool HidesBaseMember(AttributedNode member)
+ private static bool HidesBaseMember(EntityDeclaration member)
{
var memberDefinition = member.Annotation();
bool addNewModifier = false;
diff --git a/src/Libraries/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs b/src/Libraries/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs
index 7b051c50df..5de5b0ba5a 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs
@@ -543,12 +543,15 @@ namespace ICSharpCode.Decompiler.Ast
}
return arg1;
}
- case ILCode.Castclass:
- return arg1.CastTo(operandAsTypeRef);
case ILCode.Unbox_Any:
// unboxing does not require a cast if the argument was an isinst instruction
if (arg1 is AsExpression && byteCode.Arguments[0].Code == ILCode.Isinst && TypeAnalysis.IsSameType(operand as TypeReference, byteCode.Arguments[0].Operand as TypeReference))
return arg1;
+ else
+ goto case ILCode.Castclass;
+ case ILCode.Castclass:
+ if ((byteCode.Arguments[0].InferredType != null && byteCode.Arguments[0].InferredType.IsGenericParameter) || ((Cecil.TypeReference)operand).IsGenericParameter)
+ return arg1.CastTo(new PrimitiveType("object")).CastTo(operandAsTypeRef);
else
return arg1.CastTo(operandAsTypeRef);
case ILCode.Isinst:
diff --git a/src/Libraries/ICSharpCode.Decompiler/Ast/CommentStatement.cs b/src/Libraries/ICSharpCode.Decompiler/Ast/CommentStatement.cs
index 0940c6c5c7..6837b2418f 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Ast/CommentStatement.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Ast/CommentStatement.cs
@@ -38,6 +38,15 @@ namespace ICSharpCode.Decompiler.Ast
this.comment = comment;
}
+ public override void AcceptVisitor(IAstVisitor visitor)
+ {
+ }
+
+ public override T AcceptVisitor(IAstVisitor visitor)
+ {
+ return default(T);
+ }
+
public override S AcceptVisitor(IAstVisitor visitor, T data)
{
return default(S);
diff --git a/src/Libraries/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs b/src/Libraries/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs
index 26bd784e2f..85fef513ee 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs
@@ -82,7 +82,7 @@ namespace ICSharpCode.Decompiler.Ast
{
AstNode node = nodeStack.Peek();
MemberReference memberRef = node.Annotation();
- if (memberRef == null && node.Role == AstNode.Roles.TargetExpression && (node.Parent is InvocationExpression || node.Parent is ObjectCreateExpression)) {
+ if (memberRef == null && node.Role == Roles.TargetExpression && (node.Parent is InvocationExpression || node.Parent is ObjectCreateExpression)) {
memberRef = node.Parent.Annotation();
}
return memberRef;
@@ -168,7 +168,7 @@ namespace ICSharpCode.Decompiler.Ast
// Attach member reference to token only if there's no identifier in the current node.
MemberReference memberRef = GetCurrentMemberReference();
var node = nodeStack.Peek();
- if (memberRef != null && node.GetChildByRole(AstNode.Roles.Identifier).IsNull)
+ if (memberRef != null && node.GetChildByRole(Roles.Identifier).IsNull)
output.WriteReference(token, memberRef);
else
output.Write(token);
@@ -282,7 +282,7 @@ namespace ICSharpCode.Decompiler.Ast
nodeStack.Push(node);
startLocations.Push(output.Location);
- if (node is AttributedNode && node.GetChildByRole(AstNode.Roles.Identifier).IsNull)
+ if (node is EntityDeclaration && node.Annotation() != null && node.GetChildByRole(Roles.Identifier).IsNull)
output.WriteDefinition("", node.Annotation(), false);
MemberMapping mapping = node.Annotation();
@@ -330,15 +330,7 @@ namespace ICSharpCode.Decompiler.Ast
private static bool IsDefinition(AstNode node)
{
- return
- node is FieldDeclaration ||
- node is ConstructorDeclaration ||
- node is DestructorDeclaration ||
- node is EventDeclaration ||
- node is DelegateDeclaration ||
- node is OperatorDeclaration||
- node is MemberDeclaration ||
- node is TypeDeclaration;
+ return node is EntityDeclaration;
}
}
}
diff --git a/src/Libraries/ICSharpCode.Decompiler/Ast/Transforms/ConvertConstructorCallIntoInitializer.cs b/src/Libraries/ICSharpCode.Decompiler/Ast/Transforms/ConvertConstructorCallIntoInitializer.cs
index 4976a759bb..36811c1852 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Ast/Transforms/ConvertConstructorCallIntoInitializer.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Ast/Transforms/ConvertConstructorCallIntoInitializer.cs
@@ -123,7 +123,7 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
if (allSame) {
foreach (var ctor in instanceCtorsNotChainingWithThis)
ctor.Body.First().Remove();
- fieldOrEventDecl.GetChildrenByRole(AstNode.Roles.Variable).Single().Initializer = initializer.Detach();
+ fieldOrEventDecl.GetChildrenByRole(Roles.Variable).Single().Initializer = initializer.Detach();
}
} while (allSame);
}
diff --git a/src/Libraries/ICSharpCode.Decompiler/Ast/Transforms/IntroduceUnsafeModifier.cs b/src/Libraries/ICSharpCode.Decompiler/Ast/Transforms/IntroduceUnsafeModifier.cs
index dc7e7f1a5a..43548e38d4 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Ast/Transforms/IntroduceUnsafeModifier.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Ast/Transforms/IntroduceUnsafeModifier.cs
@@ -38,8 +38,8 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
for (AstNode child = node.FirstChild; child != null; child = child.NextSibling) {
result |= child.AcceptVisitor(this, data);
}
- if (result && node is AttributedNode && !(node is Accessor)) {
- ((AttributedNode)node).Modifiers |= Modifiers.Unsafe;
+ if (result && node is EntityDeclaration && !(node is Accessor)) {
+ ((EntityDeclaration)node).Modifiers |= Modifiers.Unsafe;
return false;
}
return result;
diff --git a/src/Libraries/ICSharpCode.Decompiler/Ast/Transforms/ReplaceMethodCallsWithOperators.cs b/src/Libraries/ICSharpCode.Decompiler/Ast/Transforms/ReplaceMethodCallsWithOperators.cs
index 4561da8176..6a3f8f9743 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Ast/Transforms/ReplaceMethodCallsWithOperators.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Ast/Transforms/ReplaceMethodCallsWithOperators.cs
@@ -140,7 +140,7 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
invocationExpression.ReplaceWith(arguments[0]);
return;
}
- if (methodRef.Name == "op_True" && arguments.Length == 1 && invocationExpression.Role == AstNode.Roles.Condition) {
+ if (methodRef.Name == "op_True" && arguments.Length == 1 && invocationExpression.Role == Roles.Condition) {
invocationExpression.ReplaceWith(arguments[0]);
return;
}
diff --git a/src/Libraries/ICSharpCode.Decompiler/CecilExtensions.cs b/src/Libraries/ICSharpCode.Decompiler/CecilExtensions.cs
index 82b67a07f4..cc047e09cd 100644
--- a/src/Libraries/ICSharpCode.Decompiler/CecilExtensions.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/CecilExtensions.cs
@@ -133,6 +133,8 @@ namespace ICSharpCode.Decompiler
///
public static int GetEndOffset(this Instruction inst)
{
+ if (inst == null)
+ throw new ArgumentNullException("inst");
return inst.Offset + inst.GetSize();
}
diff --git a/src/Libraries/ICSharpCode.Decompiler/DecompilerSettings.cs b/src/Libraries/ICSharpCode.Decompiler/DecompilerSettings.cs
index 05a598520e..435124491c 100644
--- a/src/Libraries/ICSharpCode.Decompiler/DecompilerSettings.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/DecompilerSettings.cs
@@ -18,6 +18,7 @@
using System;
using System.ComponentModel;
+using ICSharpCode.NRefactory.CSharp;
namespace ICSharpCode.Decompiler
{
@@ -271,6 +272,26 @@ namespace ICSharpCode.Decompiler
}
#endregion
+ CSharpFormattingOptions csharpFormattingOptions;
+
+ public CSharpFormattingOptions CSharpFormattingOptions {
+ get {
+ if (csharpFormattingOptions == null) {
+ csharpFormattingOptions = FormattingOptionsFactory.CreateAllman();
+ csharpFormattingOptions.IndentSwitchBody = false;
+ }
+ return csharpFormattingOptions;
+ }
+ set {
+ if (value == null)
+ throw new ArgumentNullException();
+ if (csharpFormattingOptions != value) {
+ csharpFormattingOptions = value;
+ OnPropertyChanged("CSharpFormattingOptions");
+ }
+ }
+ }
+
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
@@ -283,6 +304,8 @@ namespace ICSharpCode.Decompiler
public DecompilerSettings Clone()
{
DecompilerSettings settings = (DecompilerSettings)MemberwiseClone();
+ if (csharpFormattingOptions != null)
+ settings.csharpFormattingOptions = csharpFormattingOptions.Clone();
settings.PropertyChanged = null;
return settings;
}
diff --git a/src/Libraries/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs b/src/Libraries/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs
index 413234e77f..675d9e28a0 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs
@@ -809,6 +809,7 @@ namespace ICSharpCode.Decompiler.Disassembler
{ TypeAttributes.SpecialName, "specialname" },
{ TypeAttributes.Import, "import" },
{ TypeAttributes.Serializable, "serializable" },
+ { TypeAttributes.WindowsRuntime, "windowsruntime" },
{ TypeAttributes.BeforeFieldInit, "beforefieldinit" },
{ TypeAttributes.HasSecurity, null },
};
@@ -1075,7 +1076,10 @@ namespace ICSharpCode.Decompiler.Disassembler
public void WriteAssemblyHeader(AssemblyDefinition asm)
{
- output.Write(".assembly " + DisassemblerHelpers.Escape(asm.Name.Name));
+ output.Write(".assembly ");
+ if (asm.Name.IsWindowsRuntime)
+ output.Write("windowsruntime ");
+ output.Write(DisassemblerHelpers.Escape(asm.Name.Name));
OpenBlock(false);
WriteAttributes(asm.CustomAttributes);
WriteSecurityDeclarations(asm);
@@ -1103,7 +1107,10 @@ namespace ICSharpCode.Decompiler.Disassembler
output.WriteLine(".module extern {0}", DisassemblerHelpers.Escape(mref.Name));
}
foreach (var aref in module.AssemblyReferences) {
- output.Write(".assembly extern {0}", DisassemblerHelpers.Escape(aref.Name));
+ output.Write(".assembly extern ");
+ if (aref.IsWindowsRuntime)
+ output.Write("windowsruntime ");
+ output.Write(DisassemblerHelpers.Escape(aref.Name));
OpenBlock(false);
if (aref.PublicKeyToken != null) {
output.Write(".publickeytoken = ");
diff --git a/src/Libraries/ICSharpCode.Decompiler/FlowAnalysis/ControlFlowNode.cs b/src/Libraries/ICSharpCode.Decompiler/FlowAnalysis/ControlFlowNode.cs
index 606b43286b..cab507bc95 100644
--- a/src/Libraries/ICSharpCode.Decompiler/FlowAnalysis/ControlFlowNode.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/FlowAnalysis/ControlFlowNode.cs
@@ -253,8 +253,11 @@ namespace ICSharpCode.Decompiler.FlowAnalysis
StringWriter writer = new StringWriter();
switch (NodeType) {
case ControlFlowNodeType.Normal:
- int endOffset = End.GetEndOffset();
- writer.Write("Block #{0}: IL_{1:x4} to IL_{2:x4}", BlockIndex, Start.Offset, endOffset);
+ writer.Write("Block #{0}", BlockIndex);
+ if (Start != null)
+ writer.Write(": IL_{0:x4}", Start.Offset);
+ if (End != null)
+ writer.Write(" to IL_{0:x4}", End.GetEndOffset());
break;
case ControlFlowNodeType.CatchHandler:
case ControlFlowNodeType.FinallyOrFaultHandler:
@@ -277,6 +280,10 @@ namespace ICSharpCode.Decompiler.FlowAnalysis
writer.WriteLine();
Disassembler.DisassemblerHelpers.WriteTo(inst, new PlainTextOutput(writer));
}
+ if (UserData != null) {
+ writer.WriteLine();
+ writer.Write(UserData.ToString());
+ }
return writer.ToString();
}
diff --git a/src/Libraries/ICSharpCode.Decompiler/ILAst/LoopsAndConditions.cs b/src/Libraries/ICSharpCode.Decompiler/ILAst/LoopsAndConditions.cs
index e5409a2e58..32095b03eb 100644
--- a/src/Libraries/ICSharpCode.Decompiler/ILAst/LoopsAndConditions.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/ILAst/LoopsAndConditions.cs
@@ -101,7 +101,7 @@ namespace ICSharpCode.Decompiler.ILAst
// Find all branches
foreach(ILLabel target in node.GetSelfAndChildrenRecursive(e => e.IsBranch()).SelectMany(e => e.GetBranchTargets())) {
ControlFlowNode destination;
- // Labels which are out of out scope will not be int the collection
+ // Labels which are out of out scope will not be in the collection
// Insert self edge only if we are sure we are a loop
if (labelToCfNode.TryGetValue(target, out destination) && (destination != source || target == node.Body.FirstOrDefault())) {
ControlFlowEdge edge = new ControlFlowEdge(source, destination, JumpType.Normal);
@@ -228,15 +228,10 @@ namespace ICSharpCode.Decompiler.ILAst
// Do not modify entry data
scope = new HashSet(scope);
- HashSet agenda = new HashSet();
- agenda.Add(entryNode);
- while(agenda.Any()) {
- ControlFlowNode node = agenda.First();
- // Attempt for a good order
- while(agenda.Contains(node.ImmediateDominator)) {
- node = node.ImmediateDominator;
- }
- agenda.Remove(node);
+ Stack agenda = new Stack();
+ agenda.Push(entryNode);
+ while(agenda.Count > 0) {
+ ControlFlowNode node = agenda.Pop();
// Find a block that represents a simple condition
if (scope.Contains(node)) {
@@ -364,18 +359,12 @@ namespace ICSharpCode.Decompiler.ILAst
labelToCfNode.TryGetValue(falseLabel, out falseTarget);
// Pull in the conditional code
- HashSet frontiers = new HashSet();
- if (trueTarget != null)
- frontiers.UnionWith(trueTarget.DominanceFrontier.Except(new [] { trueTarget }));
- if (falseTarget != null)
- frontiers.UnionWith(falseTarget.DominanceFrontier.Except(new [] { falseTarget }));
-
- if (trueTarget != null && !frontiers.Contains(trueTarget)) {
+ if (trueTarget != null && HasSingleEdgeEnteringBlock(trueTarget)) {
HashSet content = FindDominatedNodes(scope, trueTarget);
scope.ExceptWith(content);
ilCond.TrueBlock.Body.AddRange(FindConditions(content, trueTarget));
}
- if (falseTarget != null && !frontiers.Contains(falseTarget)) {
+ if (falseTarget != null && HasSingleEdgeEnteringBlock(falseTarget)) {
HashSet content = FindDominatedNodes(scope, falseTarget);
scope.ExceptWith(content);
ilCond.FalseBlock.Body.AddRange(FindConditions(content, falseTarget));
@@ -390,9 +379,9 @@ namespace ICSharpCode.Decompiler.ILAst
}
}
- // Using the dominator tree should ensure we find the the widest loop first
- foreach(var child in node.DominatorTreeChildren) {
- agenda.Add(child);
+ // depth-first traversal of dominator tree
+ for (int i = node.DominatorTreeChildren.Count - 1; i >= 0; i--) {
+ agenda.Push(node.DominatorTreeChildren[i]);
}
}
@@ -404,6 +393,11 @@ namespace ICSharpCode.Decompiler.ILAst
return result;
}
+ static bool HasSingleEdgeEnteringBlock(ControlFlowNode node)
+ {
+ return node.Incoming.Count(edge => !node.Dominates(edge.Source)) == 1;
+ }
+
static HashSet FindDominatedNodes(HashSet scope, ControlFlowNode head)
{
HashSet agenda = new HashSet();
diff --git a/src/Libraries/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs b/src/Libraries/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs
index b2af46d975..6e8444a1ca 100644
--- a/src/Libraries/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs
@@ -985,12 +985,24 @@ namespace ICSharpCode.Decompiler.ILAst
InferTypeForExpression(right, typeSystem.IntPtr);
return leftPreferred;
}
+ if (IsEnum(leftPreferred)) {
+ //E+U=E
+ left.InferredType = left.ExpectedType = leftPreferred;
+ InferTypeForExpression(right, GetEnumUnderlyingType(leftPreferred));
+ return leftPreferred;
+ }
TypeReference rightPreferred = DoInferTypeForExpression(right, expectedType);
if (rightPreferred is PointerType) {
InferTypeForExpression(left, typeSystem.IntPtr);
right.InferredType = right.ExpectedType = rightPreferred;
return rightPreferred;
}
+ if (IsEnum(rightPreferred)) {
+ //U+E=E
+ right.InferredType = right.ExpectedType = rightPreferred;
+ InferTypeForExpression(left, GetEnumUnderlyingType(rightPreferred));
+ return rightPreferred;
+ }
return InferBinaryArguments(left, right, expectedType, leftPreferred: leftPreferred, rightPreferred: rightPreferred);
}
@@ -1004,6 +1016,19 @@ namespace ICSharpCode.Decompiler.ILAst
InferTypeForExpression(right, typeSystem.IntPtr);
return leftPreferred;
}
+ if (IsEnum(leftPreferred)) {
+ if (expectedType != null && IsEnum(expectedType)) {
+ // E-U=E
+ left.InferredType = left.ExpectedType = leftPreferred;
+ InferTypeForExpression(right, GetEnumUnderlyingType(leftPreferred));
+ return leftPreferred;
+ } else {
+ // E-E=U
+ left.InferredType = left.ExpectedType = leftPreferred;
+ InferTypeForExpression(right, leftPreferred);
+ return GetEnumUnderlyingType(leftPreferred);
+ }
+ }
return InferBinaryArguments(left, right, expectedType, leftPreferred: leftPreferred);
}
diff --git a/src/Libraries/ICSharpCode.Decompiler/Properties/AssemblyInfo.cs b/src/Libraries/ICSharpCode.Decompiler/Properties/AssemblyInfo.cs
index 0deae79817..9260b6ba55 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Properties/AssemblyInfo.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Properties/AssemblyInfo.cs
@@ -19,8 +19,8 @@ using System.Runtime.InteropServices;
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
-[assembly: AssemblyVersion("2.0.0.1489")]
-[assembly: AssemblyInformationalVersion("2.0.0.1489-774e3cd8")]
+[assembly: AssemblyVersion("2.0.0.1595")]
+[assembly: AssemblyInformationalVersion("2.0.0.1595-5773d3d2")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly",
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/ControlFlow.cs b/src/Libraries/ICSharpCode.Decompiler/Tests/ControlFlow.cs
new file mode 100644
index 0000000000..76038f1254
--- /dev/null
+++ b/src/Libraries/ICSharpCode.Decompiler/Tests/ControlFlow.cs
@@ -0,0 +1,81 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this
+// software and associated documentation files (the "Software"), to deal in the Software
+// without restriction, including without limitation the rights to use, copy, modify, merge,
+// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+// to whom the Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or
+// substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+
+public static class ControlFlow
+{
+ public static void EmptyIf(string input, List value, Dictionary _headers)
+ {
+ if (value.Contains("test"))
+ {
+ }
+ _headers.Add(2, "result");
+ }
+
+ public static void NormalIf(string input, List value, Dictionary _headers)
+ {
+ if (value.Contains("test"))
+ {
+ _headers.Add(1, "result");
+ }
+ else
+ {
+ _headers.Add(1, "else");
+ }
+ _headers.Add(2, "end");
+ }
+
+ public static void NormalIf2(string input, List value, Dictionary _headers)
+ {
+ if (value.Contains("test"))
+ {
+ _headers.Add(1, "result");
+ }
+ _headers.Add(2, "end");
+ }
+
+ public static void NormalIf3(string input, List value, Dictionary _headers)
+ {
+ if (value.Contains("test"))
+ {
+ _headers.Add(1, "result");
+ }
+ else
+ {
+ _headers.Add(1, "else");
+ }
+ }
+
+ public static void Test(string input, List value, Dictionary _headers)
+ {
+ foreach (string current in value)
+ {
+ _headers.Add(0, current);
+ }
+ if (value.Contains("test"))
+ {
+ _headers.Add(1, "result");
+ }
+ else
+ {
+ _headers.Add(1, "else");
+ }
+ }
+}
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/Generics.cs b/src/Libraries/ICSharpCode.Decompiler/Tests/Generics.cs
index 5adb934c68..9776d42f34 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Tests/Generics.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Tests/Generics.cs
@@ -107,4 +107,59 @@ public static class Generics
// Tests references to inner classes in generic classes
return d.Keys.GetEnumerator();
}
+
+ public static bool IsString(T input)
+ {
+ return input is string;
+ }
+
+ public static string AsString(T input)
+ {
+ return input as string;
+ }
+
+ public static string CastToString(T input)
+ {
+ return (string)((object)input);
+ }
+
+ public static T CastFromString(string input)
+ {
+ return (T)((object)input);
+ }
+
+ public static bool IsInt(T input)
+ {
+ return input is int;
+ }
+
+ public static int CastToInt(T input)
+ {
+ return (int)((object)input);
+ }
+
+ public static T CastFromInt(int input)
+ {
+ return (T)((object)input);
+ }
+
+ public static bool IsNullableInt(T input)
+ {
+ return input is int?;
+ }
+
+ public static int? AsNullableInt(T input)
+ {
+ return input as int?;
+ }
+
+ public static int? CastToNullableInt(T input)
+ {
+ return (int?)((object)input);
+ }
+
+ public static T CastFromNullableInt(int? input)
+ {
+ return (T)((object)input);
+ }
}
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/Helpers/RemoveCompilerAttribute.cs b/src/Libraries/ICSharpCode.Decompiler/Tests/Helpers/RemoveCompilerAttribute.cs
index 2519165578..cb65620242 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Tests/Helpers/RemoveCompilerAttribute.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Tests/Helpers/RemoveCompilerAttribute.cs
@@ -15,7 +15,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
var section = (AttributeSection)attribute.Parent;
SimpleType type = attribute.Type as SimpleType;
if (section.AttributeTarget == "assembly" &&
- (type.Identifier == "CompilationRelaxations" || type.Identifier == "RuntimeCompatibility" || type.Identifier == "SecurityPermission" || type.Identifier == "AssemblyVersion"))
+ (type.Identifier == "CompilationRelaxations" || type.Identifier == "RuntimeCompatibility" || type.Identifier == "SecurityPermission" || type.Identifier == "AssemblyVersion" || type.Identifier == "Debuggable"))
{
attribute.Remove();
if (section.Attributes.Count == 0)
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj b/src/Libraries/ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj
index c42f043393..52a4f950da 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj
+++ b/src/Libraries/ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj
@@ -64,7 +64,10 @@
+
+
+
@@ -77,6 +80,10 @@
+
+
+
+
@@ -117,10 +124,11 @@
ICSharpCode.Decompiler
-
+
+
+
-
\ No newline at end of file
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/IL/ILTests.cs b/src/Libraries/ICSharpCode.Decompiler/Tests/IL/ILTests.cs
new file mode 100644
index 0000000000..3cfed30f22
--- /dev/null
+++ b/src/Libraries/ICSharpCode.Decompiler/Tests/IL/ILTests.cs
@@ -0,0 +1,51 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this
+// software and associated documentation files (the "Software"), to deal in the Software
+// without restriction, including without limitation the rights to use, copy, modify, merge,
+// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+// to whom the Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or
+// substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.IO;
+using ICSharpCode.Decompiler.Ast;
+using ICSharpCode.Decompiler.Tests.Helpers;
+using Mono.Cecil;
+using NUnit.Framework;
+
+namespace ICSharpCode.Decompiler.Tests
+{
+ [TestFixture]
+ public class ILTests
+ {
+ const string path = "../../Tests/IL";
+
+ [Test]
+ public void SequenceOfNestedIfs()
+ {
+ Run("SequenceOfNestedIfs.dll", "SequenceOfNestedIfs.Output.cs");
+ }
+
+ void Run(string compiledFile, string expectedOutputFile)
+ {
+ string expectedOutput = File.ReadAllText(Path.Combine(path, expectedOutputFile));
+ var assembly = AssemblyDefinition.ReadAssembly(Path.Combine(path, compiledFile));
+ AstBuilder decompiler = new AstBuilder(new DecompilerContext(assembly.MainModule));
+ decompiler.AddAssembly(assembly);
+ new Helpers.RemoveCompilerAttribute().Run(decompiler.CompilationUnit);
+ StringWriter output = new StringWriter();
+ decompiler.GenerateCode(new PlainTextOutput(output));
+ CodeAssert.AreEqual(expectedOutput, output.ToString());
+ }
+ }
+}
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/IL/SequenceOfNestedIfs.Output.cs b/src/Libraries/ICSharpCode.Decompiler/Tests/IL/SequenceOfNestedIfs.Output.cs
new file mode 100644
index 0000000000..754d7dafdc
--- /dev/null
+++ b/src/Libraries/ICSharpCode.Decompiler/Tests/IL/SequenceOfNestedIfs.Output.cs
@@ -0,0 +1,53 @@
+using System;
+[Serializable]
+public class Material
+{
+ public static implicit operator bool(Material m)
+ {
+ return m == null;
+ }
+}
+[Serializable]
+public class SequenceOfNestedIfs
+{
+ public bool _clear;
+ public Material _material;
+ public override bool CheckShader()
+ {
+ return false;
+ }
+ public override void CreateMaterials()
+ {
+ if (!this._clear)
+ {
+ if (!this.CheckShader())
+ {
+ return;
+ }
+ this._material = new Material();
+ }
+ if (!this._material)
+ {
+ if (!this.CheckShader())
+ {
+ return;
+ }
+ this._material = new Material();
+ }
+ if (!this._material)
+ {
+ if (!this.CheckShader())
+ {
+ return;
+ }
+ this._material = new Material();
+ }
+ if (!this._material)
+ {
+ if (this.CheckShader())
+ {
+ this._material = new Material();
+ }
+ }
+ }
+}
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/IL/SequenceOfNestedIfs.dll b/src/Libraries/ICSharpCode.Decompiler/Tests/IL/SequenceOfNestedIfs.dll
new file mode 100644
index 0000000000..f517d4546d
Binary files /dev/null and b/src/Libraries/ICSharpCode.Decompiler/Tests/IL/SequenceOfNestedIfs.dll differ
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/IL/SequenceOfNestedIfs.il b/src/Libraries/ICSharpCode.Decompiler/Tests/IL/SequenceOfNestedIfs.il
new file mode 100644
index 0000000000..9c9b749ce4
--- /dev/null
+++ b/src/Libraries/ICSharpCode.Decompiler/Tests/IL/SequenceOfNestedIfs.il
@@ -0,0 +1,140 @@
+// Metadata version: v2.0.50727
+.assembly extern mscorlib
+{
+ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
+ .ver 2:0:0:0
+}
+
+.assembly SequenceOfNestedIfs
+{
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
+ 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+.module SequenceOfNestedIfs
+// MVID: {DCEC8A87-5679-4EBE-89A3-51274D8B5446}
+.imagebase 0x00400000
+.file alignment 0x00000200
+.stackreserve 0x00100000
+.subsystem 0x0003 // WINDOWS_CUI
+.corflags 0x00000001 // ILONLY
+// Image base: 0x01D60000
+
+
+// =============== CLASS MEMBERS DECLARATION ===================
+
+.class public auto ansi serializable beforefieldinit Material
+ extends [mscorlib]System.Object
+{
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ret
+ } // end of method Material::.ctor
+
+ .method public hidebysig specialname static
+ bool op_Implicit(class Material m) cil managed
+ {
+ // Code size 11 (0xb)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: ldnull
+ IL_0008: ceq
+ IL_000a: ret
+ } // end of method Material::op_Implicit
+
+} // end of class Material
+
+.class public auto ansi serializable beforefieldinit SequenceOfNestedIfs
+ extends [mscorlib]System.Object
+{
+ .field public bool _clear
+ .field public class Material _material
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ret
+ } // end of method SequenceOfNestedIfs::.ctor
+
+ .method public hidebysig virtual instance bool
+ CheckShader() cil managed
+ {
+ // Code size 2 (0x2)
+ .maxstack 8
+ IL_0000: ldc.i4.0
+ IL_0001: ret
+ } // end of method SequenceOfNestedIfs::CheckShader
+
+ .method public hidebysig virtual instance void
+ CreateMaterials() cil managed
+ {
+ // Code size 168 (0xa8)
+ .maxstack 13
+ IL_0000: ldarg.0
+ IL_0001: ldfld bool SequenceOfNestedIfs::_clear
+ IL_0006: brtrue IL_0026
+
+ IL_000b: ldarg.0
+ IL_000c: callvirt instance bool SequenceOfNestedIfs::CheckShader()
+ IL_0011: brtrue IL_001b
+
+ IL_0016: br IL_00a7
+
+ IL_001b: ldarg.0
+ IL_001c: newobj instance void Material::.ctor()
+ IL_0021: stfld class Material SequenceOfNestedIfs::_material
+ IL_0026: ldarg.0
+ IL_0027: ldfld class Material SequenceOfNestedIfs::_material
+ IL_002c: call bool Material::op_Implicit(class Material)
+ IL_0031: brtrue IL_0051
+
+ IL_0036: ldarg.0
+ IL_0037: callvirt instance bool SequenceOfNestedIfs::CheckShader()
+ IL_003c: brtrue IL_0046
+
+ IL_0041: br IL_00a7
+
+ IL_0046: ldarg.0
+ IL_0047: newobj instance void Material::.ctor()
+ IL_004c: stfld class Material SequenceOfNestedIfs::_material
+ IL_0051: ldarg.0
+ IL_0052: ldfld class Material SequenceOfNestedIfs::_material
+ IL_0057: call bool Material::op_Implicit(class Material)
+ IL_005c: brtrue IL_007c
+
+ IL_0061: ldarg.0
+ IL_0062: callvirt instance bool SequenceOfNestedIfs::CheckShader()
+ IL_0067: brtrue IL_0071
+
+ IL_006c: br IL_00a7
+
+ IL_0071: ldarg.0
+ IL_0072: newobj instance void Material::.ctor()
+ IL_0077: stfld class Material SequenceOfNestedIfs::_material
+ IL_007c: ldarg.0
+ IL_007d: ldfld class Material SequenceOfNestedIfs::_material
+ IL_0082: call bool Material::op_Implicit(class Material)
+ IL_0087: brtrue IL_00a7
+
+ IL_008c: ldarg.0
+ IL_008d: callvirt instance bool SequenceOfNestedIfs::CheckShader()
+ IL_0092: brtrue IL_009c
+
+ IL_0097: br IL_00a7
+
+ IL_009c: ldarg.0
+ IL_009d: newobj instance void Material::.ctor()
+ IL_00a2: stfld class Material SequenceOfNestedIfs::_material
+ IL_00a7: ret
+ } // end of method SequenceOfNestedIfs::CreateMaterials
+
+} // end of class SequenceOfNestedIfs
\ No newline at end of file
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/StackTests/StackTests.exe b/src/Libraries/ICSharpCode.Decompiler/Tests/IL/StackTests.exe
similarity index 100%
rename from src/Libraries/ICSharpCode.Decompiler/Tests/StackTests/StackTests.exe
rename to src/Libraries/ICSharpCode.Decompiler/Tests/IL/StackTests.exe
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/StackTests/StackTests.il b/src/Libraries/ICSharpCode.Decompiler/Tests/IL/StackTests.il
similarity index 100%
rename from src/Libraries/ICSharpCode.Decompiler/Tests/StackTests/StackTests.il
rename to src/Libraries/ICSharpCode.Decompiler/Tests/IL/StackTests.il
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/PropertiesAndEvents.cs b/src/Libraries/ICSharpCode.Decompiler/Tests/PropertiesAndEvents.cs
index 4bacc06e3e..bdc4f7dd1f 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Tests/PropertiesAndEvents.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Tests/PropertiesAndEvents.cs
@@ -26,8 +26,7 @@ public class PropertiesAndEvents
[field: NonSerialized]
public event EventHandler AutomaticEventWithInitializer = delegate
{
- }
- ;
+ };
public event EventHandler CustomEvent
{
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/TestRunner.cs b/src/Libraries/ICSharpCode.Decompiler/Tests/TestRunner.cs
index a4feebca09..8160a7376d 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Tests/TestRunner.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Tests/TestRunner.cs
@@ -61,7 +61,7 @@ namespace ICSharpCode.Decompiler.Tests
[Test]
public void ExceptionHandling()
{
- TestFile(@"..\..\Tests\ExceptionHandling.cs", false);
+ TestFile(@"..\..\Tests\ExceptionHandling.cs", optimize: false);
}
[Test]
@@ -76,6 +76,12 @@ namespace ICSharpCode.Decompiler.Tests
TestFile(@"..\..\Tests\CustomShortCircuitOperators.cs");
}
+ [Test]
+ public void ControlFlowWithDebug()
+ {
+ TestFile(@"..\..\Tests\ControlFlow.cs", optimize: false, useDebug: true);
+ }
+
[Test]
public void IncrementDecrement()
{
@@ -160,16 +166,16 @@ namespace ICSharpCode.Decompiler.Tests
TestFile(@"..\..\Tests\TypeAnalysisTests.cs");
}
- static void TestFile(string fileName)
+ static void TestFile(string fileName, bool useDebug = false)
{
- TestFile(fileName, false);
- TestFile(fileName, true);
+ TestFile(fileName, false, useDebug);
+ TestFile(fileName, true, useDebug);
}
- static void TestFile(string fileName, bool optimize)
+ static void TestFile(string fileName, bool optimize, bool useDebug = false)
{
string code = File.ReadAllText(fileName);
- AssemblyDefinition assembly = Compile(code, optimize);
+ AssemblyDefinition assembly = Compile(code, optimize, useDebug);
AstBuilder decompiler = new AstBuilder(new DecompilerContext(assembly.MainModule));
decompiler.AddAssembly(assembly);
new Helpers.RemoveCompilerAttribute().Run(decompiler.CompilationUnit);
@@ -178,11 +184,11 @@ namespace ICSharpCode.Decompiler.Tests
CodeAssert.AreEqual(code, output.ToString());
}
- static AssemblyDefinition Compile(string code, bool optimize)
+ static AssemblyDefinition Compile(string code, bool optimize, bool useDebug)
{
CSharpCodeProvider provider = new CSharpCodeProvider(new Dictionary { { "CompilerVersion", "v4.0" } });
CompilerParameters options = new CompilerParameters();
- options.CompilerOptions = "/unsafe /o" + (optimize ? "+" : "-");
+ options.CompilerOptions = "/unsafe /o" + (optimize ? "+" : "-") + (useDebug ? " /debug": "");
options.ReferencedAssemblies.Add("System.Core.dll");
CompilerResults results = provider.CompileAssemblyFromSource(options, code);
try {
diff --git a/src/Libraries/ICSharpCode.Decompiler/Tests/TypeAnalysisTests.cs b/src/Libraries/ICSharpCode.Decompiler/Tests/TypeAnalysisTests.cs
index 3c0ffc4b97..760bb862d3 100644
--- a/src/Libraries/ICSharpCode.Decompiler/Tests/TypeAnalysisTests.cs
+++ b/src/Libraries/ICSharpCode.Decompiler/Tests/TypeAnalysisTests.cs
@@ -140,4 +140,14 @@ public class TypeAnalysisTests
{
return new byte[length];
}
+
+ public StringComparison EnumDiffNumber(StringComparison data)
+ {
+ return data - 1;
+ }
+
+ public int EnumDiff(StringComparison a, StringComparison b)
+ {
+ return Math.Abs(a - b);
+ }
}
diff --git a/src/Libraries/Mono.Cecil/.gitignore b/src/Libraries/Mono.Cecil/.gitignore
new file mode 100644
index 0000000000..8dcb32b7f6
--- /dev/null
+++ b/src/Libraries/Mono.Cecil/.gitignore
@@ -0,0 +1,10 @@
+bin
+obj
+*.suo
+*.user
+*.pidb
+*.userprefs
+*.xml
+*.nupkg
+**/test-results/*
+*Resharper*
diff --git a/src/Libraries/Mono.Cecil/Mono.Cecil.PE/Image.cs b/src/Libraries/Mono.Cecil/Mono.Cecil.PE/Image.cs
index 9a04494f01..e5d8075251 100644
--- a/src/Libraries/Mono.Cecil/Mono.Cecil.PE/Image.cs
+++ b/src/Libraries/Mono.Cecil/Mono.Cecil.PE/Image.cs
@@ -52,6 +52,7 @@ namespace Mono.Cecil.PE {
public DataDirectory Debug;
public DataDirectory Resources;
+ public DataDirectory StrongName;
public StringHeap StringHeap;
public BlobHeap BlobHeap;
diff --git a/src/Libraries/Mono.Cecil/Mono.Cecil.PE/ImageReader.cs b/src/Libraries/Mono.Cecil/Mono.Cecil.PE/ImageReader.cs
index 9baeca5eef..b320169192 100644
--- a/src/Libraries/Mono.Cecil/Mono.Cecil.PE/ImageReader.cs
+++ b/src/Libraries/Mono.Cecil/Mono.Cecil.PE/ImageReader.cs
@@ -322,6 +322,7 @@ namespace Mono.Cecil.PE {
// Resources 8
image.Resources = ReadDataDirectory ();
// StrongNameSignature 8
+ image.StrongName = ReadDataDirectory ();
// CodeManagerTable 8
// VTableFixups 8
// ExportAddressTableJumps 8
diff --git a/src/Libraries/Mono.Cecil/Mono.Cecil.PE/ImageWriter.cs b/src/Libraries/Mono.Cecil/Mono.Cecil.PE/ImageWriter.cs
index af6aa7a359..bea308c919 100644
--- a/src/Libraries/Mono.Cecil/Mono.Cecil.PE/ImageWriter.cs
+++ b/src/Libraries/Mono.Cecil/Mono.Cecil.PE/ImageWriter.cs
@@ -75,7 +75,7 @@ namespace Mono.Cecil.PE {
this.GetDebugHeader ();
this.GetWin32Resources ();
this.text_map = BuildTextMap ();
- this.sections = 2; // text + reloc
+ this.sections = (ushort) (pe64 ? 1 : 2); // text + reloc
this.time_stamp = (uint) DateTime.UtcNow.Subtract (new DateTime (1970, 1, 1)).TotalSeconds;
}
@@ -133,7 +133,8 @@ namespace Mono.Cecil.PE {
previous = rsrc;
}
- reloc = CreateSection (".reloc", 12u, previous);
+ if (!pe64)
+ reloc = CreateSection (".reloc", 12u, previous);
}
Section CreateSection (string name, uint size, Section previous)
@@ -217,20 +218,29 @@ namespace Mono.Cecil.PE {
throw new NotSupportedException ();
}
+ Section LastSection ()
+ {
+ if (reloc != null)
+ return reloc;
+
+ if (rsrc != null)
+ return rsrc;
+
+ return text;
+ }
+
void WriteOptionalHeaders ()
{
WriteUInt16 ((ushort) (!pe64 ? 0x10b : 0x20b)); // Magic
WriteByte (8); // LMajor
WriteByte (0); // LMinor
WriteUInt32 (text.SizeOfRawData); // CodeSize
- WriteUInt32 (reloc.SizeOfRawData
+ WriteUInt32 (reloc != null ? reloc.SizeOfRawData : 0
+ (rsrc != null ? rsrc.SizeOfRawData : 0)); // InitializedDataSize
WriteUInt32 (0); // UninitializedDataSize
- var entry_point_rva = text_map.GetRVA (TextSegment.StartupStub);
- if (module.Architecture == TargetArchitecture.IA64)
- entry_point_rva += 0x20;
- WriteUInt32 (entry_point_rva); // EntryPointRVA
+ var startub_stub = text_map.GetRange (TextSegment.StartupStub);
+ WriteUInt32 (startub_stub.Length > 0 ? startub_stub.Start : 0); // EntryPointRVA
WriteUInt32 (text_rva); // BaseOfCode
if (!pe64) {
@@ -251,7 +261,8 @@ namespace Mono.Cecil.PE {
WriteUInt16 (0); // SubSysMinor
WriteUInt32 (0); // Reserved
- WriteUInt32 (reloc.VirtualAddress + Align (reloc.VirtualSize, section_alignment)); // ImageSize
+ var last_section = LastSection();
+ WriteUInt32 (last_section.VirtualAddress + Align (last_section.VirtualSize, section_alignment)); // ImageSize
WriteUInt32 (text.PointerToRawData); // HeaderSize
WriteUInt32 (0); // Checksum
@@ -288,8 +299,8 @@ namespace Mono.Cecil.PE {
WriteZeroDataDirectory (); // ExceptionTable
WriteZeroDataDirectory (); // CertificateTable
- WriteUInt32 (reloc.VirtualAddress); // BaseRelocationTable
- WriteUInt32 (reloc.VirtualSize);
+ WriteUInt32 (reloc != null ? reloc.VirtualAddress : 0); // BaseRelocationTable
+ WriteUInt32 (reloc != null ? reloc.VirtualSize : 0);
if (text_map.GetLength (TextSegment.DebugDirectory) > 0) {
WriteUInt32 (text_map.GetRVA (TextSegment.DebugDirectory));
@@ -335,7 +346,8 @@ namespace Mono.Cecil.PE {
if (rsrc != null)
WriteSection (rsrc, 0x40000040);
- WriteSection (reloc, 0x42000040);
+ if (reloc != null)
+ WriteSection (reloc, 0x42000040);
}
void WriteSection (Section section, uint characteristics)
@@ -386,8 +398,10 @@ namespace Mono.Cecil.PE {
// ImportAddressTable
- WriteRVA (text_map.GetRVA (TextSegment.ImportHintNameTable));
- WriteRVA (0);
+ if (!pe64) {
+ WriteRVA (text_map.GetRVA (TextSegment.ImportHintNameTable));
+ WriteRVA (0);
+ }
// CLIHeader
@@ -439,6 +453,9 @@ namespace Mono.Cecil.PE {
WriteDebugDirectory ();
}
+ if (pe64)
+ return;
+
// ImportDirectory
MoveToRVA (TextSegment.ImportDirectory);
WriteImportDirectory ();
@@ -605,19 +622,8 @@ namespace Mono.Cecil.PE {
WriteUInt16 (0x25ff);
WriteUInt32 ((uint) image_base + text_map.GetRVA (TextSegment.ImportAddressTable));
return;
- case TargetArchitecture.AMD64:
- WriteUInt16 (0xa148);
- WriteUInt32 ((uint) image_base + text_map.GetRVA (TextSegment.ImportAddressTable));
- WriteUInt16 (0xe0ff);
- return;
- case TargetArchitecture.IA64:
- WriteBytes (new byte [] {
- 0x0b, 0x48, 0x00, 0x02, 0x18, 0x10, 0xa0, 0x40, 0x24, 0x30, 0x28, 0x00, 0x00, 0x00, 0x04, 0x00,
- 0x10, 0x08, 0x00, 0x12, 0x18, 0x10, 0x60, 0x50, 0x04, 0x80, 0x03, 0x00, 0x60, 0x00, 0x80, 0x00
- });
- WriteUInt32 ((uint) image_base + text_map.GetRVA (TextSegment.StartupStub));
- WriteUInt32 ((uint) image_base + text_rva);
- return;
+ default:
+ throw new NotSupportedException ();
}
}
@@ -642,13 +648,8 @@ namespace Mono.Cecil.PE {
case TargetArchitecture.I386:
WriteUInt32 (0x3000 + reloc_rva - page_rva);
break;
- case TargetArchitecture.AMD64:
- WriteUInt32 (0xa000 + reloc_rva - page_rva);
- break;
- case TargetArchitecture.IA64:
- WriteUInt16 ((ushort) (0xa000 + reloc_rva - page_rva));
- WriteUInt16 ((ushort) (0xa000 + reloc_rva - page_rva + 8));
- break;
+ default:
+ throw new NotSupportedException();
}
WriteBytes (new byte [file_alignment - reloc.VirtualSize]);
@@ -663,7 +664,8 @@ namespace Mono.Cecil.PE {
WriteText ();
if (rsrc != null)
WriteRsrc ();
- WriteReloc ();
+ if (reloc != null)
+ WriteReloc ();
}
TextMap BuildTextMap ()
@@ -694,8 +696,16 @@ namespace Mono.Cecil.PE {
map.AddMap (TextSegment.DebugDirectory, debug_dir_len, 4);
+ if (pe64) {
+ var start = map.GetNextRVA (TextSegment.DebugDirectory);
+ map.AddMap (TextSegment.ImportDirectory, new Range (start, 0));
+ map.AddMap (TextSegment.ImportHintNameTable, new Range (start, 0));
+ map.AddMap (TextSegment.StartupStub, new Range (start, 0));
+ return map;
+ }
+
RVA import_dir_rva = map.GetNextRVA (TextSegment.DebugDirectory);
- RVA import_hnt_rva = import_dir_rva + (!pe64 ? 48u : 52u);
+ RVA import_hnt_rva = import_dir_rva + 48u;
import_hnt_rva = (import_hnt_rva + 15u) & ~15u;
uint import_dir_len = (import_hnt_rva - import_dir_rva) + 27u;
@@ -716,12 +726,8 @@ namespace Mono.Cecil.PE {
switch (module.Architecture) {
case TargetArchitecture.I386:
return 6;
- case TargetArchitecture.AMD64:
- return 12;
- case TargetArchitecture.IA64:
- return 48;
default:
- throw new InvalidOperationException ();
+ throw new NotSupportedException ();
}
}
@@ -744,11 +750,8 @@ namespace Mono.Cecil.PE {
int GetStrongNameLength ()
{
- if ((module.Attributes & ModuleAttributes.StrongNameSigned) == 0)
- return 0;
-
if (module.Assembly == null)
- throw new InvalidOperationException ();
+ return 0;
var public_key = module.Assembly.Name.PublicKey;
diff --git a/src/Libraries/Mono.Cecil/Mono.Cecil/AssemblyFlags.cs b/src/Libraries/Mono.Cecil/Mono.Cecil/AssemblyFlags.cs
index e466e78441..72a0eb06c2 100644
--- a/src/Libraries/Mono.Cecil/Mono.Cecil/AssemblyFlags.cs
+++ b/src/Libraries/Mono.Cecil/Mono.Cecil/AssemblyFlags.cs
@@ -35,6 +35,7 @@ namespace Mono.Cecil {
PublicKey = 0x0001,
SideBySideCompatible = 0x0000,
Retargetable = 0x0100,
+ WindowsRuntime = 0x0200,
DisableJITCompileOptimizer = 0x4000,
EnableJITCompileTracking = 0x8000,
}
diff --git a/src/Libraries/Mono.Cecil/Mono.Cecil/AssemblyNameReference.cs b/src/Libraries/Mono.Cecil/Mono.Cecil/AssemblyNameReference.cs
index 31b7a30b3a..3da978057b 100644
--- a/src/Libraries/Mono.Cecil/Mono.Cecil/AssemblyNameReference.cs
+++ b/src/Libraries/Mono.Cecil/Mono.Cecil/AssemblyNameReference.cs
@@ -92,6 +92,11 @@ namespace Mono.Cecil {
set { attributes = attributes.SetAttributes ((uint) AssemblyAttributes.Retargetable, value); }
}
+ public bool IsWindowsRuntime {
+ get { return attributes.GetAttributes ((uint) AssemblyAttributes.WindowsRuntime); }
+ set { attributes = attributes.SetAttributes ((uint) AssemblyAttributes.WindowsRuntime, value); }
+ }
+
public byte [] PublicKey {
get { return public_key; }
set {
diff --git a/src/Libraries/Mono.Cecil/Mono.Cecil/AssemblyWriter.cs b/src/Libraries/Mono.Cecil/Mono.Cecil/AssemblyWriter.cs
index 22c77ab7ac..bffa439c60 100644
--- a/src/Libraries/Mono.Cecil/Mono.Cecil/AssemblyWriter.cs
+++ b/src/Libraries/Mono.Cecil/Mono.Cecil/AssemblyWriter.cs
@@ -97,13 +97,11 @@ namespace Mono.Cecil {
var symbol_writer = GetSymbolWriter (module, fq_name, symbol_writer_provider);
#if !SILVERLIGHT && !CF
- if (parameters.StrongNameKeyPair != null && name != null)
+ if (parameters.StrongNameKeyPair != null && name != null) {
name.PublicKey = parameters.StrongNameKeyPair.PublicKey;
-#endif
-
- if (name != null && name.HasPublicKey)
module.Attributes |= ModuleAttributes.StrongNameSigned;
-
+ }
+#endif
var metadata = new MetadataBuilder (module, fq_name,
symbol_writer_provider, symbol_writer);
@@ -786,7 +784,7 @@ namespace Mono.Cecil {
TextMap CreateTextMap ()
{
var map = new TextMap ();
- map.AddMap (TextSegment.ImportAddressTable, module.Architecture == TargetArchitecture.I386 ? 8 : 16);
+ map.AddMap (TextSegment.ImportAddressTable, module.Architecture == TargetArchitecture.I386 ? 8 : 0);
map.AddMap (TextSegment.CLIHeader, 0x48, 8);
return map;
}
diff --git a/src/Libraries/Mono.Cecil/Mono.Cecil/Import.cs b/src/Libraries/Mono.Cecil/Mono.Cecil/Import.cs
index 4f3ff25c4e..38d0120412 100644
--- a/src/Libraries/Mono.Cecil/Mono.Cecil/Import.cs
+++ b/src/Libraries/Mono.Cecil/Mono.Cecil/Import.cs
@@ -92,7 +92,7 @@ namespace Mono.Cecil {
if (IsNestedType (type))
reference.DeclaringType = ImportType (type.DeclaringType, context, import_kind);
else
- reference.Namespace = type.Namespace;
+ reference.Namespace = type.Namespace ?? string.Empty;
if (type.IsGenericType)
ImportGenericParameters (reference, type.GetGenericArguments ());
diff --git a/src/Libraries/Mono.Cecil/Mono.Cecil/TypeAttributes.cs b/src/Libraries/Mono.Cecil/Mono.Cecil/TypeAttributes.cs
index bc4e18f336..86fbc4dba5 100644
--- a/src/Libraries/Mono.Cecil/Mono.Cecil/TypeAttributes.cs
+++ b/src/Libraries/Mono.Cecil/Mono.Cecil/TypeAttributes.cs
@@ -62,6 +62,7 @@ namespace Mono.Cecil {
// Implementation attributes
Import = 0x00001000, // Class/Interface is imported
Serializable = 0x00002000, // Class is serializable
+ WindowsRuntime = 0x00004000, // Windows Runtime type
// String formatting attributes
StringFormatMask = 0x00030000, // Use this mask to retrieve string information for native interop
diff --git a/src/Libraries/Mono.Cecil/Mono.Cecil/TypeDefinition.cs b/src/Libraries/Mono.Cecil/Mono.Cecil/TypeDefinition.cs
index a43e7e53ea..58c52af179 100644
--- a/src/Libraries/Mono.Cecil/Mono.Cecil/TypeDefinition.cs
+++ b/src/Libraries/Mono.Cecil/Mono.Cecil/TypeDefinition.cs
@@ -389,6 +389,11 @@ namespace Mono.Cecil {
set { attributes = attributes.SetAttributes ((uint) TypeAttributes.Serializable, value); }
}
+ public bool IsWindowsRuntime {
+ get { return attributes.GetAttributes ((uint) TypeAttributes.WindowsRuntime); }
+ set { attributes = attributes.SetAttributes ((uint) TypeAttributes.WindowsRuntime, value); }
+ }
+
public bool IsAnsiClass {
get { return attributes.GetMaskedAttributes ((uint) TypeAttributes.StringFormatMask, (uint) TypeAttributes.AnsiClass); }
set { attributes = attributes.SetMaskedAttributes ((uint) TypeAttributes.StringFormatMask, (uint) TypeAttributes.AnsiClass, value); }
diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/AbstractLexer.cs b/src/Libraries/NRefactory/Project/Src/Lexer/AbstractLexer.cs
index 2d332c4934..688c7e95f6 100644
--- a/src/Libraries/NRefactory/Project/Src/Lexer/AbstractLexer.cs
+++ b/src/Libraries/NRefactory/Project/Src/Lexer/AbstractLexer.cs
@@ -282,7 +282,7 @@ namespace ICSharpCode.NRefactory.Parser
if ('a' <= digit && digit <= 'f') {
return digit - 'a' + 0xA;
}
- errors.Error(line, col, String.Format("Invalid hex number '" + digit + "'"));
+ errors.Error(line, col, "Invalid hex number '" + digit + "'");
return 0;
}
protected Location lastLineEnd = new Location (1, 1);
diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinder.atg b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinder.atg
index f4c218cd3f..0f69a3e491 100644
--- a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinder.atg
+++ b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinder.atg
@@ -691,8 +691,9 @@ ConditionalExpression =
.
LambdaExpression =
- SubLambdaExpression |
- FunctionLambdaExpression
+ (. lambdaNestingDepth++; .)
+ ( SubLambdaExpression | FunctionLambdaExpression )
+ (. lambdaNestingDepth--; .)
.
SubLambdaExpression =
diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinder.cs b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinder.cs
index 1649eb2c50..4182966fdb 100644
--- a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinder.cs
+++ b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinder.cs
@@ -40,6 +40,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
nextTokenIsPotentialStartOfExpression = state.NextTokenIsPotentialStartOfExpression;
nextTokenIsStartOfImportsOrAccessExpression = state.NextTokenIsStartOfImportsOrAccessExpression;
readXmlIdentifier = state.ReadXmlIdentifier;
+ lambdaNestingDepth = state.LambdaNestingDepth;
identifierExpected = state.IdentifierExpected;
stateStack = new Stack(state.StateStack.Reverse());
stack = new Stack(state.BlockStack.Select(x => (Block)x.Clone()).Reverse());
@@ -49,7 +50,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
void Print(string text)
{
- //Console.WriteLine(text);
+// Console.WriteLine(text);
output.AppendLine(text);
}
@@ -107,6 +108,10 @@ namespace ICSharpCode.NRefactory.Parser.VB
.IsElement(fx => fx.context == expected);
}
+ public int LambdaNestingDepth {
+ get { return lambdaNestingDepth; }
+ }
+
public bool NextTokenIsPotentialStartOfExpression {
get { return nextTokenIsPotentialStartOfExpression; }
}
diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinderState.cs b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinderState.cs
index 6b72f9f3e5..f386b83974 100644
--- a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinderState.cs
+++ b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinderState.cs
@@ -15,6 +15,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
public bool ReadXmlIdentifier { get; set; }
public bool IdentifierExpected { get; set; }
public bool NextTokenIsStartOfImportsOrAccessExpression { get; set; }
+ public int LambdaNestingDepth { get; set; }
public Stack StateStack { get; set; }
public Stack BlockStack { get; set; }
public int CurrentState { get; set; }
diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs
index 71dbce54a9..68f5661460 100644
--- a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs
+++ b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs
@@ -1136,13 +1136,22 @@ namespace ICSharpCode.NRefactory.Parser.VB
public override void SkipCurrentBlock(int targetToken)
{
int lastKind = -1;
- int kind = base.lastToken.kind;
- while (kind != Tokens.EOF &&
- !(lastKind == Tokens.End && kind == targetToken))
- {
+ int kind = lastToken.kind;
+ int lambdaDepth = 0;
+
+ while (kind != Tokens.EOF) {
lastKind = kind;
+ StartPeek();
+ // lambda nesting depth is not correct at end of lambda,
+ // so we have to check right before the end
+ if (Peek().kind == Tokens.End)
+ lambdaDepth = ef.LambdaNestingDepth;
NextToken();
kind = lastToken.kind;
+ // special handling for multi line lambdas
+ // once lambdaDepth <= 0 we've reached the end of the method (after the last End Sub/Function)
+ if (lastKind == Tokens.End && kind == targetToken && lambdaDepth <= 0)
+ break;
}
}
diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Parser.cs b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Parser.cs
index a4cf09d0cc..a77878718f 100644
--- a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Parser.cs
+++ b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Parser.cs
@@ -10,8 +10,8 @@ namespace ICSharpCode.NRefactory.Parser.VB {
partial class ExpressionFinder {
const int startOfExpression = 55;
- const int startOfBlock = 259;
- const int endOfStatementTerminatorAndBlock = 263;
+ const int startOfBlock = 261;
+ const int endOfStatementTerminatorAndBlock = 265;
static BitArray GetExpectedSet(int state)
{
switch (state) {
@@ -27,8 +27,8 @@ partial class ExpressionFinder {
return set[3];
case 6:
case 88:
- case 264:
- case 531:
+ case 266:
+ case 534:
{
BitArray a = new BitArray(239);
return a;
@@ -51,25 +51,25 @@ partial class ExpressionFinder {
case 205:
case 244:
case 248:
- case 295:
- case 399:
- case 405:
- case 475:
- case 521:
- case 528:
- case 536:
- case 566:
- case 602:
- case 651:
- case 665:
- case 738:
+ case 297:
+ case 401:
+ case 407:
+ case 478:
+ case 524:
+ case 531:
+ case 539:
+ case 569:
+ case 605:
+ case 654:
+ case 668:
+ case 741:
return set[6];
case 12:
case 13:
- case 567:
- case 568:
- case 613:
- case 623:
+ case 570:
+ case 571:
+ case 616:
+ case 626:
{
BitArray a = new BitArray(239);
a.Set(1, true);
@@ -82,42 +82,42 @@ partial class ExpressionFinder {
case 23:
case 24:
case 36:
- case 256:
- case 259:
- case 260:
- case 296:
- case 300:
- case 322:
- case 337:
- case 348:
- case 351:
- case 357:
- case 362:
- case 372:
- case 373:
- case 396:
- case 423:
- case 527:
- case 533:
- case 539:
- case 543:
- case 551:
- case 559:
- case 569:
- case 578:
- case 595:
- case 600:
- case 608:
- case 614:
+ case 258:
+ case 261:
+ case 262:
+ case 298:
+ case 302:
+ case 324:
+ case 339:
+ case 350:
+ case 353:
+ case 359:
+ case 364:
+ case 374:
+ case 375:
+ case 398:
+ case 425:
+ case 530:
+ case 536:
+ case 542:
+ case 546:
+ case 554:
+ case 562:
+ case 572:
+ case 581:
+ case 598:
+ case 603:
+ case 611:
case 617:
- case 624:
+ case 620:
case 627:
- case 646:
+ case 630:
case 649:
- case 673:
- case 681:
- case 717:
- case 737:
+ case 652:
+ case 676:
+ case 684:
+ case 720:
+ case 740:
{
BitArray a = new BitArray(239);
a.Set(1, true);
@@ -131,27 +131,27 @@ partial class ExpressionFinder {
case 18:
return set[8];
case 19:
- case 257:
- case 271:
- case 298:
- case 352:
- case 397:
- case 455:
- case 576:
- case 596:
- case 615:
- case 619:
- case 625:
- case 647:
- case 682:
+ case 259:
+ case 273:
+ case 300:
+ case 354:
+ case 399:
+ case 458:
+ case 579:
+ case 599:
+ case 618:
+ case 622:
+ case 628:
+ case 650:
+ case 685:
{
BitArray a = new BitArray(239);
a.Set(113, true);
return a;
}
case 22:
- case 544:
- case 579:
+ case 547:
+ case 582:
return set[9];
case 25:
{
@@ -163,7 +163,7 @@ partial class ExpressionFinder {
case 27:
return set[10];
case 28:
- case 721:
+ case 724:
return set[11];
case 29:
return set[12];
@@ -174,31 +174,31 @@ partial class ExpressionFinder {
case 152:
case 217:
case 218:
- case 265:
- case 276:
- case 277:
- case 463:
- case 464:
- case 465:
+ case 267:
+ case 278:
+ case 279:
case 466:
- case 554:
- case 555:
- case 588:
- case 589:
- case 676:
- case 677:
- case 730:
- case 731:
+ case 467:
+ case 468:
+ case 469:
+ case 557:
+ case 558:
+ case 591:
+ case 592:
+ case 679:
+ case 680:
+ case 733:
+ case 734:
return set[14];
case 33:
case 34:
- case 522:
- case 523:
- case 529:
- case 530:
- case 556:
- case 557:
- case 670:
+ case 525:
+ case 526:
+ case 532:
+ case 533:
+ case 559:
+ case 560:
+ case 673:
return set[15];
case 35:
case 37:
@@ -208,29 +208,29 @@ partial class ExpressionFinder {
case 187:
case 203:
case 221:
- case 307:
- case 332:
- case 422:
- case 440:
- case 451:
- case 478:
- case 532:
- case 550:
- case 558:
- case 630:
+ case 309:
+ case 334:
+ case 424:
+ case 442:
+ case 453:
+ case 481:
+ case 535:
+ case 553:
+ case 561:
case 633:
- case 655:
+ case 636:
case 658:
- case 660:
- case 672:
- case 685:
- case 687:
- case 710:
+ case 661:
+ case 663:
+ case 675:
+ case 688:
+ case 690:
case 713:
case 716:
- case 722:
+ case 719:
case 725:
- case 743:
+ case 728:
+ case 746:
return set[16];
case 38:
case 41:
@@ -241,8 +241,8 @@ partial class ExpressionFinder {
case 97:
case 101:
case 163:
- case 388:
- case 482:
+ case 390:
+ case 485:
return set[19];
case 42:
{
@@ -260,17 +260,17 @@ partial class ExpressionFinder {
case 46:
case 167:
case 188:
- case 392:
- case 427:
- case 476:
+ case 394:
+ case 429:
case 479:
- case 499:
- case 562:
- case 593:
- case 645:
- case 691:
- case 720:
- case 729:
+ case 482:
+ case 502:
+ case 565:
+ case 596:
+ case 648:
+ case 694:
+ case 723:
+ case 732:
{
BitArray a = new BitArray(239);
a.Set(38, true);
@@ -282,7 +282,7 @@ partial class ExpressionFinder {
case 49:
case 179:
case 186:
- case 394:
+ case 396:
{
BitArray a = new BitArray(239);
a.Set(22, true);
@@ -292,36 +292,36 @@ partial class ExpressionFinder {
case 51:
case 52:
case 54:
- case 390:
- case 391:
- case 412:
- case 413:
- case 419:
- case 420:
- case 490:
- case 491:
- case 704:
- case 705:
+ case 392:
+ case 393:
+ case 414:
+ case 415:
+ case 421:
+ case 422:
+ case 493:
+ case 494:
+ case 707:
+ case 708:
return set[22];
case 53:
case 169:
case 170:
case 172:
case 181:
- case 414:
- case 421:
- case 429:
- case 438:
- case 442:
- case 486:
+ case 416:
+ case 423:
+ case 431:
+ case 440:
+ case 444:
case 489:
- case 493:
- case 495:
+ case 492:
case 496:
- case 506:
- case 513:
- case 520:
- case 706:
+ case 498:
+ case 499:
+ case 509:
+ case 516:
+ case 523:
+ case 709:
{
BitArray a = new BitArray(239);
a.Set(22, true);
@@ -345,34 +345,34 @@ partial class ExpressionFinder {
case 197:
case 215:
case 239:
- case 274:
- case 284:
+ case 276:
case 286:
- case 287:
- case 304:
- case 321:
- case 326:
- case 335:
- case 341:
+ case 288:
+ case 289:
+ case 306:
+ case 323:
+ case 328:
+ case 337:
case 343:
- case 347:
- case 350:
- case 356:
- case 367:
+ case 345:
+ case 349:
+ case 352:
+ case 358:
case 369:
- case 370:
- case 376:
- case 393:
+ case 371:
+ case 372:
+ case 378:
case 395:
- case 415:
- case 439:
- case 468:
- case 484:
- case 485:
+ case 397:
+ case 417:
+ case 441:
+ case 471:
case 487:
case 488:
- case 549:
- case 629:
+ case 490:
+ case 491:
+ case 552:
+ case 632:
return set[23];
case 57:
case 78:
@@ -448,7 +448,7 @@ partial class ExpressionFinder {
return a;
}
case 71:
- case 443:
+ case 445:
{
BitArray a = new BitArray(239);
a.Set(40, true);
@@ -464,10 +464,10 @@ partial class ExpressionFinder {
case 98:
case 222:
case 223:
- case 282:
- case 283:
- case 334:
- case 739:
+ case 284:
+ case 285:
+ case 336:
+ case 742:
{
BitArray a = new BitArray(239);
a.Set(20, true);
@@ -499,7 +499,7 @@ partial class ExpressionFinder {
}
case 84:
case 100:
- case 516:
+ case 519:
{
BitArray a = new BitArray(239);
a.Set(22, true);
@@ -546,14 +546,14 @@ partial class ExpressionFinder {
return a;
}
case 96:
- case 686:
+ case 689:
{
BitArray a = new BitArray(239);
a.Set(26, true);
return a;
}
case 103:
- case 353:
+ case 355:
{
BitArray a = new BitArray(239);
a.Set(231, true);
@@ -578,7 +578,7 @@ partial class ExpressionFinder {
return a;
}
case 107:
- case 299:
+ case 301:
{
BitArray a = new BitArray(239);
a.Set(218, true);
@@ -603,7 +603,8 @@ partial class ExpressionFinder {
return a;
}
case 111:
- case 456:
+ case 454:
+ case 459:
{
BitArray a = new BitArray(239);
a.Set(210, true);
@@ -628,15 +629,15 @@ partial class ExpressionFinder {
return a;
}
case 115:
- case 359:
+ case 361:
{
BitArray a = new BitArray(239);
a.Set(197, true);
return a;
}
case 116:
- case 601:
- case 620:
+ case 604:
+ case 623:
{
BitArray a = new BitArray(239);
a.Set(186, true);
@@ -661,9 +662,9 @@ partial class ExpressionFinder {
return a;
}
case 120:
- case 316:
- case 323:
- case 338:
+ case 318:
+ case 325:
+ case 340:
{
BitArray a = new BitArray(239);
a.Set(163, true);
@@ -705,7 +706,8 @@ partial class ExpressionFinder {
return a;
}
case 127:
- case 258:
+ case 254:
+ case 260:
{
BitArray a = new BitArray(239);
a.Set(127, true);
@@ -757,7 +759,7 @@ partial class ExpressionFinder {
return a;
}
case 135:
- case 638:
+ case 641:
{
BitArray a = new BitArray(239);
a.Set(98, true);
@@ -836,21 +838,22 @@ partial class ExpressionFinder {
return set[32];
case 161:
case 162:
- case 480:
- case 481:
+ case 483:
+ case 484:
return set[33];
case 164:
return set[34];
case 173:
case 174:
- case 319:
- case 328:
+ case 321:
+ case 330:
return set[35];
case 175:
- case 458:
+ case 253:
+ case 461:
return set[36];
case 176:
- case 375:
+ case 377:
{
BitArray a = new BitArray(239);
a.Set(135, true);
@@ -859,14 +862,14 @@ partial class ExpressionFinder {
case 177:
case 184:
case 189:
- case 253:
- case 424:
- case 452:
- case 474:
+ case 255:
+ case 426:
+ case 455:
case 477:
- case 590:
- case 591:
- case 643:
+ case 480:
+ case 593:
+ case 594:
+ case 646:
{
BitArray a = new BitArray(239);
a.Set(37, true);
@@ -909,7 +912,7 @@ partial class ExpressionFinder {
}
case 202:
case 204:
- case 320:
+ case 322:
{
BitArray a = new BitArray(239);
a.Set(138, true);
@@ -926,8 +929,8 @@ partial class ExpressionFinder {
case 234:
case 242:
case 246:
- case 269:
- case 273:
+ case 271:
+ case 275:
return set[40];
case 210:
{
@@ -939,10 +942,10 @@ partial class ExpressionFinder {
case 216:
return set[41];
case 219:
- case 278:
+ case 280:
return set[42];
case 220:
- case 279:
+ case 281:
return set[43];
case 225:
{
@@ -972,43 +975,43 @@ partial class ExpressionFinder {
case 245:
return set[45];
case 252:
- case 553:
- case 664:
- case 675:
- case 683:
+ case 556:
+ case 667:
+ case 678:
+ case 686:
{
BitArray a = new BitArray(239);
a.Set(127, true);
a.Set(210, true);
return a;
}
- case 254:
- case 255:
+ case 256:
+ case 257:
return set[46];
- case 261:
- case 262:
- return set[47];
case 263:
+ case 264:
+ return set[47];
+ case 265:
return set[48];
- case 266:
- return set[49];
- case 267:
case 268:
- case 381:
- return set[50];
+ return set[49];
+ case 269:
case 270:
- case 275:
- case 365:
- case 656:
- case 657:
+ case 383:
+ return set[50];
+ case 272:
+ case 277:
+ case 367:
case 659:
- case 694:
- case 711:
- case 712:
+ case 660:
+ case 662:
+ case 697:
case 714:
- case 723:
- case 724:
+ case 715:
+ case 717:
case 726:
+ case 727:
+ case 729:
{
BitArray a = new BitArray(239);
a.Set(1, true);
@@ -1016,32 +1019,32 @@ partial class ExpressionFinder {
a.Set(22, true);
return a;
}
- case 272:
+ case 274:
{
BitArray a = new BitArray(239);
a.Set(226, true);
return a;
}
- case 280:
- case 281:
+ case 282:
+ case 283:
return set[51];
- case 285:
+ case 287:
+ case 329:
+ case 344:
+ case 406:
+ return set[52];
+ case 290:
+ case 291:
+ case 311:
+ case 312:
+ case 326:
case 327:
+ case 341:
case 342:
- case 404:
- return set[52];
- case 288:
- case 289:
- case 309:
- case 310:
- case 324:
- case 325:
- case 339:
- case 340:
return set[53];
- case 290:
- case 382:
- case 385:
+ case 292:
+ case 384:
+ case 387:
{
BitArray a = new BitArray(239);
a.Set(1, true);
@@ -1049,7 +1052,7 @@ partial class ExpressionFinder {
a.Set(111, true);
return a;
}
- case 291:
+ case 293:
{
BitArray a = new BitArray(239);
a.Set(108, true);
@@ -1057,18 +1060,18 @@ partial class ExpressionFinder {
a.Set(231, true);
return a;
}
- case 292:
+ case 294:
return set[54];
- case 293:
- case 312:
+ case 295:
+ case 314:
return set[55];
- case 294:
+ case 296:
{
BitArray a = new BitArray(239);
a.Set(5, true);
return a;
}
- case 297:
+ case 299:
{
BitArray a = new BitArray(239);
a.Set(75, true);
@@ -1076,11 +1079,11 @@ partial class ExpressionFinder {
a.Set(123, true);
return a;
}
- case 301:
- case 302:
- return set[56];
case 303:
- case 308:
+ case 304:
+ return set[56];
+ case 305:
+ case 310:
{
BitArray a = new BitArray(239);
a.Set(1, true);
@@ -1088,36 +1091,36 @@ partial class ExpressionFinder {
a.Set(229, true);
return a;
}
- case 305:
- case 306:
+ case 307:
+ case 308:
return set[57];
- case 311:
- return set[58];
case 313:
+ return set[58];
+ case 315:
{
BitArray a = new BitArray(239);
a.Set(118, true);
return a;
}
- case 314:
- case 315:
- return set[59];
+ case 316:
case 317:
- case 318:
+ return set[59];
+ case 319:
+ case 320:
return set[60];
- case 329:
- case 330:
- return set[61];
case 331:
- return set[62];
+ case 332:
+ return set[61];
case 333:
+ return set[62];
+ case 335:
{
BitArray a = new BitArray(239);
a.Set(20, true);
a.Set(138, true);
return a;
}
- case 336:
+ case 338:
{
BitArray a = new BitArray(239);
a.Set(1, true);
@@ -1125,38 +1128,38 @@ partial class ExpressionFinder {
a.Set(205, true);
return a;
}
- case 344:
+ case 346:
return set[63];
- case 345:
- case 349:
+ case 347:
+ case 351:
{
BitArray a = new BitArray(239);
a.Set(152, true);
return a;
}
- case 346:
+ case 348:
return set[64];
- case 354:
- case 355:
+ case 356:
+ case 357:
return set[65];
- case 358:
+ case 360:
{
BitArray a = new BitArray(239);
a.Set(74, true);
a.Set(113, true);
return a;
}
- case 360:
- case 361:
- return set[66];
+ case 362:
case 363:
- case 364:
- return set[67];
+ return set[66];
+ case 365:
case 366:
+ return set[67];
case 368:
+ case 370:
return set[68];
- case 371:
- case 377:
+ case 373:
+ case 379:
{
BitArray a = new BitArray(239);
a.Set(1, true);
@@ -1164,7 +1167,7 @@ partial class ExpressionFinder {
a.Set(214, true);
return a;
}
- case 374:
+ case 376:
{
BitArray a = new BitArray(239);
a.Set(111, true);
@@ -1172,7 +1175,7 @@ partial class ExpressionFinder {
a.Set(113, true);
return a;
}
- case 378:
+ case 380:
{
BitArray a = new BitArray(239);
a.Set(1, true);
@@ -1180,63 +1183,63 @@ partial class ExpressionFinder {
a.Set(135, true);
return a;
}
- case 379:
- case 380:
- case 453:
- case 454:
+ case 381:
+ case 382:
+ case 456:
+ case 457:
return set[69];
- case 383:
- case 384:
+ case 385:
case 386:
- case 387:
- return set[70];
+ case 388:
case 389:
+ return set[70];
+ case 391:
return set[71];
- case 398:
+ case 400:
{
BitArray a = new BitArray(239);
a.Set(211, true);
a.Set(233, true);
return a;
}
- case 400:
- case 401:
- case 406:
- case 407:
- return set[72];
case 402:
+ case 403:
case 408:
+ case 409:
+ return set[72];
+ case 404:
+ case 410:
return set[73];
- case 403:
+ case 405:
+ case 413:
+ case 420:
+ return set[74];
case 411:
+ case 412:
case 418:
- return set[74];
- case 409:
- case 410:
- case 416:
- case 417:
- case 701:
- case 702:
+ case 419:
+ case 704:
+ case 705:
return set[75];
- case 425:
- case 426:
- return set[76];
+ case 427:
case 428:
+ return set[76];
case 430:
- case 431:
- case 592:
- case 644:
- return set[77];
case 432:
case 433:
- return set[78];
+ case 595:
+ case 647:
+ return set[77];
case 434:
case 435:
- return set[79];
+ return set[78];
case 436:
- return set[80];
case 437:
- case 441:
+ return set[79];
+ case 438:
+ return set[80];
+ case 439:
+ case 443:
{
BitArray a = new BitArray(239);
a.Set(20, true);
@@ -1244,87 +1247,87 @@ partial class ExpressionFinder {
a.Set(38, true);
return a;
}
- case 444:
- case 445:
- case 449:
- return set[81];
case 446:
+ case 447:
+ case 451:
+ return set[81];
+ case 448:
{
BitArray a = new BitArray(239);
a.Set(22, true);
a.Set(39, true);
return a;
}
- case 447:
- case 448:
- return set[82];
+ case 449:
case 450:
+ return set[82];
+ case 452:
{
BitArray a = new BitArray(239);
a.Set(21, true);
return a;
}
- case 457:
+ case 460:
return set[83];
- case 459:
- case 472:
+ case 462:
+ case 475:
return set[84];
- case 460:
- case 473:
+ case 463:
+ case 476:
return set[85];
- case 461:
- case 462:
+ case 464:
+ case 465:
{
BitArray a = new BitArray(239);
a.Set(10, true);
return a;
}
- case 467:
+ case 470:
{
BitArray a = new BitArray(239);
a.Set(12, true);
return a;
}
- case 469:
+ case 472:
{
BitArray a = new BitArray(239);
a.Set(13, true);
return a;
}
- case 470:
+ case 473:
return set[86];
- case 471:
+ case 474:
return set[87];
- case 483:
+ case 486:
return set[88];
- case 492:
- case 494:
- return set[89];
+ case 495:
case 497:
- case 498:
- case 560:
- case 561:
- case 689:
- case 690:
- return set[90];
+ return set[89];
case 500:
case 501:
- case 502:
- case 507:
- case 508:
case 563:
+ case 564:
case 692:
- case 719:
- case 728:
- return set[91];
+ case 693:
+ return set[90];
case 503:
- case 509:
- case 518:
- return set[92];
case 504:
case 505:
case 510:
case 511:
+ case 566:
+ case 695:
+ case 722:
+ case 731:
+ return set[91];
+ case 506:
+ case 512:
+ case 521:
+ return set[92];
+ case 507:
+ case 508:
+ case 513:
+ case 514:
{
BitArray a = new BitArray(239);
a.Set(22, true);
@@ -1332,18 +1335,18 @@ partial class ExpressionFinder {
a.Set(63, true);
return a;
}
- case 512:
- case 514:
- case 519:
- return set[93];
case 515:
case 517:
+ case 522:
+ return set[93];
+ case 518:
+ case 520:
return set[94];
- case 524:
- case 537:
- case 538:
- case 594:
- case 671:
+ case 527:
+ case 540:
+ case 541:
+ case 597:
+ case 674:
{
BitArray a = new BitArray(239);
a.Set(1, true);
@@ -1351,28 +1354,28 @@ partial class ExpressionFinder {
a.Set(63, true);
return a;
}
- case 525:
- case 526:
- case 598:
- case 599:
+ case 528:
+ case 529:
+ case 601:
+ case 602:
return set[95];
- case 534:
- case 535:
- case 542:
+ case 537:
+ case 538:
+ case 545:
{
BitArray a = new BitArray(239);
a.Set(115, true);
return a;
}
- case 540:
- case 541:
+ case 543:
+ case 544:
return set[96];
- case 545:
- case 546:
- return set[97];
- case 547:
case 548:
- case 607:
+ case 549:
+ return set[97];
+ case 550:
+ case 551:
+ case 610:
{
BitArray a = new BitArray(239);
a.Set(1, true);
@@ -1380,15 +1383,15 @@ partial class ExpressionFinder {
a.Set(21, true);
return a;
}
- case 552:
+ case 555:
{
BitArray a = new BitArray(239);
a.Set(103, true);
return a;
}
- case 564:
- case 565:
- case 577:
+ case 567:
+ case 568:
+ case 580:
{
BitArray a = new BitArray(239);
a.Set(84, true);
@@ -1396,84 +1399,84 @@ partial class ExpressionFinder {
a.Set(209, true);
return a;
}
- case 570:
- case 571:
- return set[98];
- case 572:
case 573:
- return set[99];
case 574:
+ return set[98];
case 575:
- case 586:
+ case 576:
+ return set[99];
+ case 577:
+ case 578:
+ case 589:
return set[100];
- case 580:
- case 581:
- return set[101];
- case 582:
case 583:
- case 708:
- return set[102];
case 584:
- return set[103];
+ return set[101];
case 585:
- return set[104];
+ case 586:
+ case 711:
+ return set[102];
case 587:
- case 597:
+ return set[103];
+ case 588:
+ return set[104];
+ case 590:
+ case 600:
{
BitArray a = new BitArray(239);
a.Set(172, true);
return a;
}
- case 603:
- case 604:
+ case 606:
+ case 607:
return set[105];
- case 605:
+ case 608:
return set[106];
- case 606:
- case 637:
- return set[107];
case 609:
- case 610:
- case 611:
- case 628:
- return set[108];
+ case 640:
+ return set[107];
case 612:
- case 616:
- case 626:
+ case 613:
+ case 614:
+ case 631:
+ return set[108];
+ case 615:
+ case 619:
+ case 629:
{
BitArray a = new BitArray(239);
a.Set(128, true);
a.Set(198, true);
return a;
}
- case 618:
- return set[109];
case 621:
+ return set[109];
+ case 624:
return set[110];
- case 622:
+ case 625:
return set[111];
- case 631:
- case 632:
case 634:
- case 700:
+ case 635:
+ case 637:
case 703:
+ case 706:
return set[112];
- case 635:
- case 636:
- return set[113];
+ case 638:
case 639:
- case 641:
- case 650:
+ return set[113];
+ case 642:
+ case 644:
+ case 653:
{
BitArray a = new BitArray(239);
a.Set(119, true);
return a;
}
- case 640:
+ case 643:
return set[114];
- case 642:
+ case 645:
return set[115];
- case 648:
+ case 651:
{
BitArray a = new BitArray(239);
a.Set(56, true);
@@ -1481,11 +1484,11 @@ partial class ExpressionFinder {
a.Set(193, true);
return a;
}
- case 652:
- case 653:
+ case 655:
+ case 656:
return set[116];
- case 654:
- case 661:
+ case 657:
+ case 664:
{
BitArray a = new BitArray(239);
a.Set(1, true);
@@ -1493,110 +1496,110 @@ partial class ExpressionFinder {
a.Set(136, true);
return a;
}
- case 662:
+ case 665:
{
BitArray a = new BitArray(239);
a.Set(101, true);
return a;
}
- case 663:
- return set[117];
case 666:
- case 667:
+ return set[117];
+ case 669:
+ case 670:
{
BitArray a = new BitArray(239);
a.Set(149, true);
return a;
}
- case 668:
- case 674:
- case 740:
+ case 671:
+ case 677:
+ case 743:
{
BitArray a = new BitArray(239);
a.Set(3, true);
return a;
}
- case 669:
+ case 672:
return set[118];
- case 678:
- case 679:
+ case 681:
+ case 682:
return set[119];
- case 680:
- case 688:
+ case 683:
+ case 691:
return set[120];
- case 684:
+ case 687:
return set[121];
- case 693:
- case 695:
- return set[122];
case 696:
- case 707:
- return set[123];
- case 697:
case 698:
- return set[124];
+ return set[122];
case 699:
+ case 710:
+ return set[123];
+ case 700:
+ case 701:
+ return set[124];
+ case 702:
return set[125];
- case 709:
+ case 712:
{
BitArray a = new BitArray(239);
a.Set(136, true);
return a;
}
- case 715:
+ case 718:
{
BitArray a = new BitArray(239);
a.Set(140, true);
return a;
}
- case 718:
- case 727:
+ case 721:
+ case 730:
{
BitArray a = new BitArray(239);
a.Set(169, true);
return a;
}
- case 732:
+ case 735:
return set[126];
- case 733:
+ case 736:
{
BitArray a = new BitArray(239);
a.Set(160, true);
return a;
}
- case 734:
+ case 737:
{
BitArray a = new BitArray(239);
a.Set(137, true);
return a;
}
- case 735:
- case 736:
+ case 738:
+ case 739:
return set[127];
- case 741:
+ case 744:
{
BitArray a = new BitArray(239);
a.Set(11, true);
return a;
}
- case 742:
+ case 745:
return set[128];
- case 744:
+ case 747:
{
BitArray a = new BitArray(239);
a.Set(173, true);
return a;
}
- case 745:
+ case 748:
return set[129];
- case 746:
+ case 749:
{
BitArray a = new BitArray(239);
a.Set(67, true);
a.Set(213, true);
return a;
}
- case 747:
+ case 750:
return set[130];
default: throw new InvalidOperationException();
}
@@ -1616,6 +1619,7 @@ partial class ExpressionFinder {
bool isMissingModifier = false;
bool isAlreadyInExpr = false;
bool wasNormalAttribute = false;
+ int lambdaNestingDepth = 0;
int activeArgument = 0;
List errors = new List();
@@ -1653,7 +1657,7 @@ partial class ExpressionFinder {
if (la == null) { currentState = 1; break; }
if (la.kind == 173) {
stateStack.Push(1);
- goto case 744;
+ goto case 747;
} else {
goto case 2;
}
@@ -1662,7 +1666,7 @@ partial class ExpressionFinder {
if (la == null) { currentState = 2; break; }
if (la.kind == 137) {
stateStack.Push(2);
- goto case 734;
+ goto case 737;
} else {
goto case 3;
}
@@ -1671,7 +1675,7 @@ partial class ExpressionFinder {
if (la == null) { currentState = 3; break; }
if (la.kind == 40) {
stateStack.Push(3);
- goto case 443;
+ goto case 445;
} else {
goto case 4;
}
@@ -1690,7 +1694,7 @@ partial class ExpressionFinder {
case 5: {
if (la == null) { currentState = 5; break; }
if (la.kind == 160) {
- currentState = 730;
+ currentState = 733;
break;
} else {
if (set[4].Get(la.kind)) {
@@ -1709,7 +1713,7 @@ partial class ExpressionFinder {
if (la == null) { currentState = 7; break; }
if (la.kind == 40) {
stateStack.Push(7);
- goto case 443;
+ goto case 445;
} else {
goto case 8;
}
@@ -1721,14 +1725,14 @@ partial class ExpressionFinder {
break;
} else {
if (la.kind == 84 || la.kind == 155 || la.kind == 209) {
- goto case 564;
+ goto case 567;
} else {
if (la.kind == 103) {
- currentState = 553;
+ currentState = 556;
break;
} else {
if (la.kind == 115) {
- goto case 534;
+ goto case 537;
} else {
if (la.kind == 142) {
goto case 9;
@@ -1763,7 +1767,7 @@ partial class ExpressionFinder {
case 13: {
if (la == null) { currentState = 13; break; }
if (la.kind == 37) {
- currentState = 727;
+ currentState = 730;
break;
} else {
goto case 14;
@@ -1780,7 +1784,7 @@ partial class ExpressionFinder {
case 16: {
if (la == null) { currentState = 16; break; }
if (la.kind == 140) {
- currentState = 722;
+ currentState = 725;
break;
} else {
goto case 17;
@@ -1850,7 +1854,7 @@ partial class ExpressionFinder {
if (la == null) { currentState = 27; break; }
if (la.kind == 40) {
stateStack.Push(26);
- goto case 443;
+ goto case 445;
} else {
isMissingModifier = true;
goto case 28;
@@ -1859,7 +1863,7 @@ partial class ExpressionFinder {
case 28: {
if (la == null) { currentState = 28; break; }
if (set[132].Get(la.kind)) {
- currentState = 721;
+ currentState = 724;
break;
} else {
isMissingModifier = false;
@@ -1870,15 +1874,15 @@ partial class ExpressionFinder {
if (la == null) { currentState = 29; break; }
if (la.kind == 84 || la.kind == 155 || la.kind == 209) {
stateStack.Push(17);
- goto case 564;
+ goto case 567;
} else {
if (la.kind == 103) {
stateStack.Push(17);
- goto case 552;
+ goto case 555;
} else {
if (la.kind == 115) {
stateStack.Push(17);
- goto case 534;
+ goto case 537;
} else {
if (la.kind == 142) {
stateStack.Push(17);
@@ -1899,11 +1903,11 @@ partial class ExpressionFinder {
case 30: {
if (la == null) { currentState = 30; break; }
if (la.kind == 119) {
- currentState = 528;
+ currentState = 531;
break;
} else {
if (la.kind == 186) {
- currentState = 521;
+ currentState = 524;
break;
} else {
if (la.kind == 127 || la.kind == 210) {
@@ -1932,7 +1936,7 @@ partial class ExpressionFinder {
case 34: {
if (la == null) { currentState = 34; break; }
if (la.kind == 37) {
- currentState = 497;
+ currentState = 500;
break;
} else {
if (la.kind == 63) {
@@ -2031,7 +2035,7 @@ partial class ExpressionFinder {
case 44: {
if (la == null) { currentState = 44; break; }
if (la.kind == 169) {
- currentState = 492;
+ currentState = 495;
break;
} else {
if (set[22].Get(la.kind)) {
@@ -2065,7 +2069,7 @@ partial class ExpressionFinder {
if (la == null) { currentState = 48; break; }
if (set[23].Get(la.kind)) {
activeArgument = 0;
- goto case 488;
+ goto case 491;
} else {
if (la.kind == 22) {
activeArgument = 0;
@@ -3850,7 +3854,7 @@ partial class ExpressionFinder {
break;
} else {
if (la.kind == 37) {
- currentState = 484;
+ currentState = 487;
break;
} else {
if (set[137].Get(la.kind)) {
@@ -3862,25 +3866,26 @@ partial class ExpressionFinder {
break;
} else {
if (set[135].Get(la.kind)) {
- currentState = 480;
+ currentState = 483;
break;
} else {
if (la.kind == 129) {
- currentState = 477;
+ currentState = 480;
break;
} else {
if (la.kind == 237) {
- currentState = 474;
+ currentState = 477;
break;
} else {
if (set[83].Get(la.kind)) {
stateStack.Push(175);
nextTokenIsPotentialStartOfExpression = true;
PushContext(Context.Xml, la, t);
- goto case 457;
+ goto case 460;
} else {
if (la.kind == 127 || la.kind == 210) {
stateStack.Push(175);
+ lambdaNestingDepth++;
goto case 252;
} else {
if (la.kind == 58 || la.kind == 126) {
@@ -4506,105 +4511,117 @@ partial class ExpressionFinder {
case 252: {
if (la == null) { currentState = 252; break; }
if (la.kind == 210) {
- currentState = 452;
- break;
+ stateStack.Push(253);
+ goto case 454;
} else {
if (la.kind == 127) {
- currentState = 253;
- break;
+ stateStack.Push(253);
+ goto case 254;
} else {
- goto case 6;
+ Error(la);
+ goto case 253;
}
}
}
case 253: {
- stateStack.Push(254);
- goto case 424;
+ lambdaNestingDepth--;
+ currentState = stateStack.Pop();
+ goto switchlbl;
}
case 254: {
- nextTokenIsPotentialStartOfExpression = true;
- goto case 255;
+ if (la == null) { currentState = 254; break; }
+ Expect(127, la); // "Function"
+ currentState = 255;
+ break;
}
case 255: {
- if (la == null) { currentState = 255; break; }
+ stateStack.Push(256);
+ goto case 426;
+ }
+ case 256: {
+ nextTokenIsPotentialStartOfExpression = true;
+ goto case 257;
+ }
+ case 257: {
+ if (la == null) { currentState = 257; break; }
if (set[23].Get(la.kind)) {
goto case 55;
} else {
if (la.kind == 1 || la.kind == 21 || la.kind == 63) {
if (la.kind == 63) {
- currentState = 422;
+ currentState = 424;
break;
} else {
- goto case 256;
+ goto case 258;
}
} else {
goto case 6;
}
}
}
- case 256: {
- stateStack.Push(257);
- goto case 259;
+ case 258: {
+ stateStack.Push(259);
+ goto case 261;
}
- case 257: {
- if (la == null) { currentState = 257; break; }
+ case 259: {
+ if (la == null) { currentState = 259; break; }
Expect(113, la); // "End"
- currentState = 258;
+ currentState = 260;
break;
}
- case 258: {
- if (la == null) { currentState = 258; break; }
+ case 260: {
+ if (la == null) { currentState = 260; break; }
Expect(127, la); // "Function"
currentState = stateStack.Pop();
break;
}
- case 259: {
+ case 261: {
PushContext(Context.Body, la, t);
- goto case 260;
+ goto case 262;
}
- case 260: {
- stateStack.Push(261);
+ case 262: {
+ stateStack.Push(263);
goto case 23;
}
- case 261: {
+ case 263: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 262;
+ goto case 264;
}
- case 262: {
- if (la == null) { currentState = 262; break; }
+ case 264: {
+ if (la == null) { currentState = 264; break; }
if (set[139].Get(la.kind)) {
if (set[69].Get(la.kind)) {
if (set[50].Get(la.kind)) {
- stateStack.Push(260);
- goto case 267;
+ stateStack.Push(262);
+ goto case 269;
} else {
- goto case 260;
+ goto case 262;
}
} else {
if (la.kind == 113) {
- currentState = 265;
+ currentState = 267;
break;
} else {
- goto case 264;
+ goto case 266;
}
}
} else {
- goto case 263;
+ goto case 265;
}
}
- case 263: {
+ case 265: {
PopContext();
currentState = stateStack.Pop();
goto switchlbl;
}
- case 264: {
+ case 266: {
Error(la);
- goto case 261;
+ goto case 263;
}
- case 265: {
- if (la == null) { currentState = 265; break; }
+ case 267: {
+ if (la == null) { currentState = 267; break; }
if (la.kind == 1 || la.kind == 21) {
- goto case 260;
+ goto case 262;
} else {
if (set[49].Get(la.kind)) {
currentState = endOfStatementTerminatorAndBlock; /* leave this block */
@@ -4613,68 +4630,68 @@ partial class ExpressionFinder {
goto switchlbl;
} else {
- goto case 264;
+ goto case 266;
}
}
}
- case 266: {
- if (la == null) { currentState = 266; break; }
- currentState = 261;
+ case 268: {
+ if (la == null) { currentState = 268; break; }
+ currentState = 263;
break;
}
- case 267: {
+ case 269: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 268;
+ goto case 270;
}
- case 268: {
- if (la == null) { currentState = 268; break; }
+ case 270: {
+ if (la == null) { currentState = 270; break; }
if (la.kind == 88 || la.kind == 105 || la.kind == 204) {
- currentState = 399;
+ currentState = 401;
break;
} else {
if (la.kind == 211 || la.kind == 233) {
- currentState = 395;
+ currentState = 397;
break;
} else {
if (la.kind == 56 || la.kind == 193) {
- currentState = 393;
+ currentState = 395;
break;
} else {
if (la.kind == 189) {
- currentState = 388;
+ currentState = 390;
break;
} else {
if (la.kind == 135) {
- currentState = 370;
+ currentState = 372;
break;
} else {
if (la.kind == 197) {
- currentState = 354;
+ currentState = 356;
break;
} else {
if (la.kind == 231) {
- currentState = 350;
+ currentState = 352;
break;
} else {
if (la.kind == 108) {
- currentState = 344;
+ currentState = 346;
break;
} else {
if (la.kind == 124) {
- currentState = 317;
+ currentState = 319;
break;
} else {
if (la.kind == 118 || la.kind == 171 || la.kind == 194) {
if (la.kind == 118 || la.kind == 171) {
if (la.kind == 171) {
- currentState = 313;
+ currentState = 315;
break;
} else {
- goto case 313;
+ goto case 315;
}
} else {
if (la.kind == 194) {
- currentState = 311;
+ currentState = 313;
break;
} else {
goto case 6;
@@ -4682,31 +4699,31 @@ partial class ExpressionFinder {
}
} else {
if (la.kind == 215) {
- currentState = 309;
+ currentState = 311;
break;
} else {
if (la.kind == 218) {
- currentState = 296;
+ currentState = 298;
break;
} else {
if (set[140].Get(la.kind)) {
if (la.kind == 132) {
- currentState = 293;
+ currentState = 295;
break;
} else {
if (la.kind == 120) {
- currentState = 292;
+ currentState = 294;
break;
} else {
if (la.kind == 89) {
- currentState = 291;
+ currentState = 293;
break;
} else {
if (la.kind == 206) {
goto case 113;
} else {
if (la.kind == 195) {
- currentState = 288;
+ currentState = 290;
break;
} else {
goto case 6;
@@ -4717,15 +4734,15 @@ partial class ExpressionFinder {
}
} else {
if (la.kind == 191) {
- currentState = 286;
+ currentState = 288;
break;
} else {
if (la.kind == 117) {
- currentState = 284;
+ currentState = 286;
break;
} else {
if (la.kind == 226) {
- currentState = 269;
+ currentState = 271;
break;
} else {
if (set[141].Get(la.kind)) {
@@ -4755,75 +4772,75 @@ partial class ExpressionFinder {
}
}
}
- case 269: {
- stateStack.Push(270);
+ case 271: {
+ stateStack.Push(272);
SetIdentifierExpected(la);
nextTokenIsPotentialStartOfExpression = true;
- goto case 273;
+ goto case 275;
}
- case 270: {
- if (la == null) { currentState = 270; break; }
+ case 272: {
+ if (la == null) { currentState = 272; break; }
if (la.kind == 22) {
- currentState = 269;
+ currentState = 271;
break;
} else {
- stateStack.Push(271);
- goto case 259;
+ stateStack.Push(273);
+ goto case 261;
}
}
- case 271: {
- if (la == null) { currentState = 271; break; }
+ case 273: {
+ if (la == null) { currentState = 273; break; }
Expect(113, la); // "End"
- currentState = 272;
+ currentState = 274;
break;
}
- case 272: {
- if (la == null) { currentState = 272; break; }
+ case 274: {
+ if (la == null) { currentState = 274; break; }
Expect(226, la); // "Using"
currentState = stateStack.Pop();
break;
}
- case 273: {
- if (la == null) { currentState = 273; break; }
+ case 275: {
+ if (la == null) { currentState = 275; break; }
if (set[6].Get(la.kind)) {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(276);
+ stateStack.Push(278);
goto case 205;
} else {
- goto case 274;
+ goto case 276;
}
}
- case 274: {
- stateStack.Push(275);
+ case 276: {
+ stateStack.Push(277);
goto case 55;
}
- case 275: {
+ case 277: {
if (!isAlreadyInExpr) PopContext(); isAlreadyInExpr = false;
currentState = stateStack.Pop();
goto switchlbl;
}
- case 276: {
+ case 278: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 277;
+ goto case 279;
}
- case 277: {
- if (la == null) { currentState = 277; break; }
+ case 279: {
+ if (la == null) { currentState = 279; break; }
if (set[42].Get(la.kind)) {
PopContext(); isAlreadyInExpr = true;
- goto case 278;
+ goto case 280;
} else {
- goto case 274;
+ goto case 276;
}
}
- case 278: {
- if (la == null) { currentState = 278; break; }
+ case 280: {
+ if (la == null) { currentState = 280; break; }
if (la.kind == 63) {
- currentState = 280;
+ currentState = 282;
break;
} else {
if (la.kind == 20) {
- currentState = 274;
+ currentState = 276;
break;
} else {
if (set[43].Get(la.kind)) {
@@ -4834,60 +4851,60 @@ partial class ExpressionFinder {
} else {
Error(la);
- goto case 274;
+ goto case 276;
}
}
}
}
- case 279: {
- if (la == null) { currentState = 279; break; }
- currentState = 274;
+ case 281: {
+ if (la == null) { currentState = 281; break; }
+ currentState = 276;
break;
}
- case 280: {
+ case 282: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 281;
+ goto case 283;
}
- case 281: {
- if (la == null) { currentState = 281; break; }
+ case 283: {
+ if (la == null) { currentState = 283; break; }
if (set[16].Get(la.kind)) {
PushContext(Context.Type, la, t);
- stateStack.Push(282);
+ stateStack.Push(284);
goto case 37;
} else {
- goto case 274;
+ goto case 276;
}
}
- case 282: {
+ case 284: {
PopContext();
- goto case 283;
+ goto case 285;
}
- case 283: {
- if (la == null) { currentState = 283; break; }
+ case 285: {
+ if (la == null) { currentState = 285; break; }
Expect(20, la); // "="
- currentState = 274;
+ currentState = 276;
break;
}
- case 284: {
- stateStack.Push(285);
+ case 286: {
+ stateStack.Push(287);
goto case 55;
}
- case 285: {
- if (la == null) { currentState = 285; break; }
+ case 287: {
+ if (la == null) { currentState = 287; break; }
if (la.kind == 22) {
- currentState = 284;
+ currentState = 286;
break;
} else {
currentState = stateStack.Pop();
goto switchlbl;
}
}
- case 286: {
+ case 288: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 287;
+ goto case 289;
}
- case 287: {
- if (la == null) { currentState = 287; break; }
+ case 289: {
+ if (la == null) { currentState = 289; break; }
if (la.kind == 184) {
currentState = 55;
break;
@@ -4895,27 +4912,27 @@ partial class ExpressionFinder {
goto case 55;
}
}
- case 288: {
+ case 290: {
PushContext(Context.Expression, la, t);
nextTokenIsPotentialStartOfExpression = true;
- goto case 289;
+ goto case 291;
}
- case 289: {
- if (la == null) { currentState = 289; break; }
+ case 291: {
+ if (la == null) { currentState = 291; break; }
if (set[23].Get(la.kind)) {
- stateStack.Push(290);
+ stateStack.Push(292);
goto case 55;
} else {
- goto case 290;
+ goto case 292;
}
}
- case 290: {
+ case 292: {
PopContext();
currentState = stateStack.Pop();
goto switchlbl;
}
- case 291: {
- if (la == null) { currentState = 291; break; }
+ case 293: {
+ if (la == null) { currentState = 293; break; }
if (la.kind == 108) {
goto case 132;
} else {
@@ -4930,8 +4947,8 @@ partial class ExpressionFinder {
}
}
}
- case 292: {
- if (la == null) { currentState = 292; break; }
+ case 294: {
+ if (la == null) { currentState = 294; break; }
if (la.kind == 108) {
goto case 132;
} else {
@@ -4966,118 +4983,118 @@ partial class ExpressionFinder {
}
}
}
- case 293: {
- if (la == null) { currentState = 293; break; }
+ case 295: {
+ if (la == null) { currentState = 295; break; }
if (set[6].Get(la.kind)) {
- goto case 295;
+ goto case 297;
} else {
if (la.kind == 5) {
- goto case 294;
+ goto case 296;
} else {
goto case 6;
}
}
}
- case 294: {
- if (la == null) { currentState = 294; break; }
+ case 296: {
+ if (la == null) { currentState = 296; break; }
currentState = stateStack.Pop();
break;
}
- case 295: {
- if (la == null) { currentState = 295; break; }
+ case 297: {
+ if (la == null) { currentState = 297; break; }
currentState = stateStack.Pop();
break;
}
- case 296: {
- stateStack.Push(297);
- goto case 259;
+ case 298: {
+ stateStack.Push(299);
+ goto case 261;
}
- case 297: {
- if (la == null) { currentState = 297; break; }
+ case 299: {
+ if (la == null) { currentState = 299; break; }
if (la.kind == 75) {
- currentState = 301;
+ currentState = 303;
break;
} else {
if (la.kind == 123) {
- currentState = 300;
+ currentState = 302;
break;
} else {
- goto case 298;
+ goto case 300;
}
}
}
- case 298: {
- if (la == null) { currentState = 298; break; }
+ case 300: {
+ if (la == null) { currentState = 300; break; }
Expect(113, la); // "End"
- currentState = 299;
+ currentState = 301;
break;
}
- case 299: {
- if (la == null) { currentState = 299; break; }
+ case 301: {
+ if (la == null) { currentState = 301; break; }
Expect(218, la); // "Try"
currentState = stateStack.Pop();
break;
}
- case 300: {
- stateStack.Push(298);
- goto case 259;
+ case 302: {
+ stateStack.Push(300);
+ goto case 261;
}
- case 301: {
+ case 303: {
SetIdentifierExpected(la);
- goto case 302;
+ goto case 304;
}
- case 302: {
- if (la == null) { currentState = 302; break; }
+ case 304: {
+ if (la == null) { currentState = 304; break; }
if (set[6].Get(la.kind)) {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(305);
+ stateStack.Push(307);
goto case 205;
} else {
- goto case 303;
+ goto case 305;
}
}
- case 303: {
- if (la == null) { currentState = 303; break; }
+ case 305: {
+ if (la == null) { currentState = 305; break; }
if (la.kind == 229) {
- currentState = 304;
+ currentState = 306;
break;
} else {
- goto case 296;
+ goto case 298;
}
}
- case 304: {
- stateStack.Push(296);
+ case 306: {
+ stateStack.Push(298);
goto case 55;
}
- case 305: {
+ case 307: {
PopContext();
- goto case 306;
+ goto case 308;
}
- case 306: {
- if (la == null) { currentState = 306; break; }
+ case 308: {
+ if (la == null) { currentState = 308; break; }
if (la.kind == 63) {
- currentState = 307;
+ currentState = 309;
break;
} else {
- goto case 303;
+ goto case 305;
}
}
- case 307: {
+ case 309: {
PushContext(Context.Type, la, t);
- stateStack.Push(308);
+ stateStack.Push(310);
goto case 37;
}
- case 308: {
+ case 310: {
PopContext();
- goto case 303;
+ goto case 305;
}
- case 309: {
+ case 311: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 310;
+ goto case 312;
}
- case 310: {
- if (la == null) { currentState = 310; break; }
+ case 312: {
+ if (la == null) { currentState = 312; break; }
if (set[23].Get(la.kind)) {
goto case 55;
} else {
@@ -5085,47 +5102,47 @@ partial class ExpressionFinder {
goto switchlbl;
}
}
- case 311: {
- if (la == null) { currentState = 311; break; }
+ case 313: {
+ if (la == null) { currentState = 313; break; }
if (la.kind == 163) {
goto case 120;
} else {
- goto case 312;
+ goto case 314;
}
}
- case 312: {
- if (la == null) { currentState = 312; break; }
+ case 314: {
+ if (la == null) { currentState = 314; break; }
if (la.kind == 5) {
- goto case 294;
+ goto case 296;
} else {
if (set[6].Get(la.kind)) {
- goto case 295;
+ goto case 297;
} else {
goto case 6;
}
}
}
- case 313: {
- if (la == null) { currentState = 313; break; }
+ case 315: {
+ if (la == null) { currentState = 315; break; }
Expect(118, la); // "Error"
- currentState = 314;
+ currentState = 316;
break;
}
- case 314: {
+ case 316: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 315;
+ goto case 317;
}
- case 315: {
- if (la == null) { currentState = 315; break; }
+ case 317: {
+ if (la == null) { currentState = 317; break; }
if (set[23].Get(la.kind)) {
goto case 55;
} else {
if (la.kind == 132) {
- currentState = 312;
+ currentState = 314;
break;
} else {
if (la.kind == 194) {
- currentState = 316;
+ currentState = 318;
break;
} else {
goto case 6;
@@ -5133,109 +5150,109 @@ partial class ExpressionFinder {
}
}
}
- case 316: {
- if (la == null) { currentState = 316; break; }
+ case 318: {
+ if (la == null) { currentState = 318; break; }
Expect(163, la); // "Next"
currentState = stateStack.Pop();
break;
}
- case 317: {
+ case 319: {
nextTokenIsPotentialStartOfExpression = true;
SetIdentifierExpected(la);
- goto case 318;
+ goto case 320;
}
- case 318: {
- if (la == null) { currentState = 318; break; }
+ case 320: {
+ if (la == null) { currentState = 320; break; }
if (set[35].Get(la.kind)) {
- stateStack.Push(334);
- goto case 328;
+ stateStack.Push(336);
+ goto case 330;
} else {
if (la.kind == 110) {
- currentState = 319;
+ currentState = 321;
break;
} else {
goto case 6;
}
}
}
- case 319: {
- stateStack.Push(320);
- goto case 328;
+ case 321: {
+ stateStack.Push(322);
+ goto case 330;
}
- case 320: {
- if (la == null) { currentState = 320; break; }
+ case 322: {
+ if (la == null) { currentState = 322; break; }
Expect(138, la); // "In"
- currentState = 321;
+ currentState = 323;
break;
}
- case 321: {
- stateStack.Push(322);
+ case 323: {
+ stateStack.Push(324);
goto case 55;
}
- case 322: {
- stateStack.Push(323);
- goto case 259;
+ case 324: {
+ stateStack.Push(325);
+ goto case 261;
}
- case 323: {
- if (la == null) { currentState = 323; break; }
+ case 325: {
+ if (la == null) { currentState = 325; break; }
Expect(163, la); // "Next"
- currentState = 324;
+ currentState = 326;
break;
}
- case 324: {
+ case 326: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 325;
+ goto case 327;
}
- case 325: {
- if (la == null) { currentState = 325; break; }
+ case 327: {
+ if (la == null) { currentState = 327; break; }
if (set[23].Get(la.kind)) {
- goto case 326;
+ goto case 328;
} else {
currentState = stateStack.Pop();
goto switchlbl;
}
}
- case 326: {
- stateStack.Push(327);
+ case 328: {
+ stateStack.Push(329);
goto case 55;
}
- case 327: {
- if (la == null) { currentState = 327; break; }
+ case 329: {
+ if (la == null) { currentState = 329; break; }
if (la.kind == 22) {
- currentState = 326;
+ currentState = 328;
break;
} else {
currentState = stateStack.Pop();
goto switchlbl;
}
}
- case 328: {
+ case 330: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(329);
+ stateStack.Push(331);
goto case 173;
}
- case 329: {
+ case 331: {
PopContext();
- goto case 330;
+ goto case 332;
}
- case 330: {
- if (la == null) { currentState = 330; break; }
+ case 332: {
+ if (la == null) { currentState = 332; break; }
if (la.kind == 33) {
- currentState = 331;
+ currentState = 333;
break;
} else {
- goto case 331;
+ goto case 333;
}
}
- case 331: {
- if (la == null) { currentState = 331; break; }
+ case 333: {
+ if (la == null) { currentState = 333; break; }
if (set[32].Get(la.kind)) {
- stateStack.Push(331);
+ stateStack.Push(333);
goto case 160;
} else {
if (la.kind == 63) {
- currentState = 332;
+ currentState = 334;
break;
} else {
currentState = stateStack.Pop();
@@ -5243,98 +5260,98 @@ partial class ExpressionFinder {
}
}
}
- case 332: {
+ case 334: {
PushContext(Context.Type, la, t);
- stateStack.Push(333);
+ stateStack.Push(335);
goto case 37;
}
- case 333: {
+ case 335: {
PopContext();
currentState = stateStack.Pop();
goto switchlbl;
}
- case 334: {
- if (la == null) { currentState = 334; break; }
+ case 336: {
+ if (la == null) { currentState = 336; break; }
Expect(20, la); // "="
- currentState = 335;
+ currentState = 337;
break;
}
- case 335: {
- stateStack.Push(336);
+ case 337: {
+ stateStack.Push(338);
goto case 55;
}
- case 336: {
- if (la == null) { currentState = 336; break; }
+ case 338: {
+ if (la == null) { currentState = 338; break; }
if (la.kind == 205) {
- currentState = 343;
+ currentState = 345;
break;
} else {
- goto case 337;
+ goto case 339;
}
}
- case 337: {
- stateStack.Push(338);
- goto case 259;
+ case 339: {
+ stateStack.Push(340);
+ goto case 261;
}
- case 338: {
- if (la == null) { currentState = 338; break; }
+ case 340: {
+ if (la == null) { currentState = 340; break; }
Expect(163, la); // "Next"
- currentState = 339;
+ currentState = 341;
break;
}
- case 339: {
+ case 341: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 340;
+ goto case 342;
}
- case 340: {
- if (la == null) { currentState = 340; break; }
+ case 342: {
+ if (la == null) { currentState = 342; break; }
if (set[23].Get(la.kind)) {
- goto case 341;
+ goto case 343;
} else {
currentState = stateStack.Pop();
goto switchlbl;
}
}
- case 341: {
- stateStack.Push(342);
+ case 343: {
+ stateStack.Push(344);
goto case 55;
}
- case 342: {
- if (la == null) { currentState = 342; break; }
+ case 344: {
+ if (la == null) { currentState = 344; break; }
if (la.kind == 22) {
- currentState = 341;
+ currentState = 343;
break;
} else {
currentState = stateStack.Pop();
goto switchlbl;
}
}
- case 343: {
- stateStack.Push(337);
+ case 345: {
+ stateStack.Push(339);
goto case 55;
}
- case 344: {
- if (la == null) { currentState = 344; break; }
+ case 346: {
+ if (la == null) { currentState = 346; break; }
if (la.kind == 224 || la.kind == 231) {
- currentState = 347;
+ currentState = 349;
break;
} else {
if (la.kind == 1 || la.kind == 21) {
- stateStack.Push(345);
- goto case 259;
+ stateStack.Push(347);
+ goto case 261;
} else {
goto case 6;
}
}
}
- case 345: {
- if (la == null) { currentState = 345; break; }
+ case 347: {
+ if (la == null) { currentState = 347; break; }
Expect(152, la); // "Loop"
- currentState = 346;
+ currentState = 348;
break;
}
- case 346: {
- if (la == null) { currentState = 346; break; }
+ case 348: {
+ if (la == null) { currentState = 348; break; }
if (la.kind == 224 || la.kind == 231) {
currentState = 55;
break;
@@ -5343,142 +5360,142 @@ partial class ExpressionFinder {
goto switchlbl;
}
}
- case 347: {
- stateStack.Push(348);
+ case 349: {
+ stateStack.Push(350);
goto case 55;
}
- case 348: {
- stateStack.Push(349);
- goto case 259;
+ case 350: {
+ stateStack.Push(351);
+ goto case 261;
}
- case 349: {
- if (la == null) { currentState = 349; break; }
+ case 351: {
+ if (la == null) { currentState = 351; break; }
Expect(152, la); // "Loop"
currentState = stateStack.Pop();
break;
}
- case 350: {
- stateStack.Push(351);
+ case 352: {
+ stateStack.Push(353);
goto case 55;
}
- case 351: {
- stateStack.Push(352);
- goto case 259;
+ case 353: {
+ stateStack.Push(354);
+ goto case 261;
}
- case 352: {
- if (la == null) { currentState = 352; break; }
+ case 354: {
+ if (la == null) { currentState = 354; break; }
Expect(113, la); // "End"
- currentState = 353;
+ currentState = 355;
break;
}
- case 353: {
- if (la == null) { currentState = 353; break; }
+ case 355: {
+ if (la == null) { currentState = 355; break; }
Expect(231, la); // "While"
currentState = stateStack.Pop();
break;
}
- case 354: {
+ case 356: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 355;
+ goto case 357;
}
- case 355: {
- if (la == null) { currentState = 355; break; }
+ case 357: {
+ if (la == null) { currentState = 357; break; }
if (la.kind == 74) {
- currentState = 356;
+ currentState = 358;
break;
} else {
- goto case 356;
+ goto case 358;
}
}
- case 356: {
- stateStack.Push(357);
+ case 358: {
+ stateStack.Push(359);
goto case 55;
}
- case 357: {
- stateStack.Push(358);
+ case 359: {
+ stateStack.Push(360);
goto case 23;
}
- case 358: {
- if (la == null) { currentState = 358; break; }
+ case 360: {
+ if (la == null) { currentState = 360; break; }
if (la.kind == 74) {
- currentState = 360;
+ currentState = 362;
break;
} else {
Expect(113, la); // "End"
- currentState = 359;
+ currentState = 361;
break;
}
}
- case 359: {
- if (la == null) { currentState = 359; break; }
+ case 361: {
+ if (la == null) { currentState = 361; break; }
Expect(197, la); // "Select"
currentState = stateStack.Pop();
break;
}
- case 360: {
+ case 362: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 361;
+ goto case 363;
}
- case 361: {
- if (la == null) { currentState = 361; break; }
+ case 363: {
+ if (la == null) { currentState = 363; break; }
if (la.kind == 111) {
- currentState = 362;
+ currentState = 364;
break;
} else {
if (set[67].Get(la.kind)) {
- goto case 363;
+ goto case 365;
} else {
Error(la);
- goto case 362;
+ goto case 364;
}
}
}
- case 362: {
- stateStack.Push(358);
- goto case 259;
+ case 364: {
+ stateStack.Push(360);
+ goto case 261;
}
- case 363: {
+ case 365: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 364;
+ goto case 366;
}
- case 364: {
- if (la == null) { currentState = 364; break; }
+ case 366: {
+ if (la == null) { currentState = 366; break; }
if (set[142].Get(la.kind)) {
if (la.kind == 144) {
- currentState = 366;
+ currentState = 368;
break;
} else {
- goto case 366;
+ goto case 368;
}
} else {
if (set[23].Get(la.kind)) {
- stateStack.Push(365);
+ stateStack.Push(367);
goto case 55;
} else {
Error(la);
- goto case 365;
+ goto case 367;
}
}
}
- case 365: {
- if (la == null) { currentState = 365; break; }
+ case 367: {
+ if (la == null) { currentState = 367; break; }
if (la.kind == 22) {
- currentState = 363;
+ currentState = 365;
break;
} else {
- goto case 362;
+ goto case 364;
}
}
- case 366: {
- stateStack.Push(367);
- goto case 368;
+ case 368: {
+ stateStack.Push(369);
+ goto case 370;
}
- case 367: {
- stateStack.Push(365);
+ case 369: {
+ stateStack.Push(367);
goto case 75;
}
- case 368: {
- if (la == null) { currentState = 368; break; }
+ case 370: {
+ if (la == null) { currentState = 370; break; }
if (la.kind == 20) {
goto case 73;
} else {
@@ -5489,7 +5506,7 @@ partial class ExpressionFinder {
goto case 71;
} else {
if (la.kind == 39) {
- currentState = 369;
+ currentState = 371;
break;
} else {
if (la.kind == 42) {
@@ -5506,109 +5523,109 @@ partial class ExpressionFinder {
}
}
}
- case 369: {
+ case 371: {
wasNormalAttribute = false;
currentState = stateStack.Pop();
goto switchlbl;
}
- case 370: {
- stateStack.Push(371);
+ case 372: {
+ stateStack.Push(373);
goto case 55;
}
- case 371: {
- if (la == null) { currentState = 371; break; }
+ case 373: {
+ if (la == null) { currentState = 373; break; }
if (la.kind == 214) {
- currentState = 379;
+ currentState = 381;
break;
} else {
- goto case 372;
+ goto case 374;
}
}
- case 372: {
- if (la == null) { currentState = 372; break; }
+ case 374: {
+ if (la == null) { currentState = 374; break; }
if (la.kind == 1 || la.kind == 21) {
- goto case 373;
+ goto case 375;
} else {
goto case 6;
}
}
- case 373: {
- stateStack.Push(374);
- goto case 259;
+ case 375: {
+ stateStack.Push(376);
+ goto case 261;
}
- case 374: {
- if (la == null) { currentState = 374; break; }
+ case 376: {
+ if (la == null) { currentState = 376; break; }
if (la.kind == 111 || la.kind == 112) {
if (la.kind == 111) {
- currentState = 378;
+ currentState = 380;
break;
} else {
if (la.kind == 112) {
- currentState = 376;
+ currentState = 378;
break;
} else {
Error(la);
- goto case 373;
+ goto case 375;
}
}
} else {
Expect(113, la); // "End"
- currentState = 375;
+ currentState = 377;
break;
}
}
- case 375: {
- if (la == null) { currentState = 375; break; }
+ case 377: {
+ if (la == null) { currentState = 377; break; }
Expect(135, la); // "If"
currentState = stateStack.Pop();
break;
}
- case 376: {
- stateStack.Push(377);
+ case 378: {
+ stateStack.Push(379);
goto case 55;
}
- case 377: {
- if (la == null) { currentState = 377; break; }
+ case 379: {
+ if (la == null) { currentState = 379; break; }
if (la.kind == 214) {
- currentState = 373;
+ currentState = 375;
break;
} else {
- goto case 373;
+ goto case 375;
}
}
- case 378: {
- if (la == null) { currentState = 378; break; }
+ case 380: {
+ if (la == null) { currentState = 380; break; }
if (la.kind == 135) {
- currentState = 376;
+ currentState = 378;
break;
} else {
- goto case 373;
+ goto case 375;
}
}
- case 379: {
+ case 381: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 380;
+ goto case 382;
}
- case 380: {
- if (la == null) { currentState = 380; break; }
+ case 382: {
+ if (la == null) { currentState = 382; break; }
if (set[50].Get(la.kind)) {
- goto case 381;
+ goto case 383;
} else {
- goto case 372;
+ goto case 374;
}
}
- case 381: {
- stateStack.Push(382);
- goto case 267;
+ case 383: {
+ stateStack.Push(384);
+ goto case 269;
}
- case 382: {
- if (la == null) { currentState = 382; break; }
+ case 384: {
+ if (la == null) { currentState = 384; break; }
if (la.kind == 21) {
- currentState = 386;
+ currentState = 388;
break;
} else {
if (la.kind == 111) {
- currentState = 383;
+ currentState = 385;
break;
} else {
currentState = stateStack.Pop();
@@ -5616,99 +5633,99 @@ partial class ExpressionFinder {
}
}
}
- case 383: {
+ case 385: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 384;
+ goto case 386;
}
- case 384: {
- if (la == null) { currentState = 384; break; }
+ case 386: {
+ if (la == null) { currentState = 386; break; }
if (set[50].Get(la.kind)) {
- stateStack.Push(385);
- goto case 267;
+ stateStack.Push(387);
+ goto case 269;
} else {
- goto case 385;
+ goto case 387;
}
}
- case 385: {
- if (la == null) { currentState = 385; break; }
+ case 387: {
+ if (la == null) { currentState = 387; break; }
if (la.kind == 21) {
- currentState = 383;
+ currentState = 385;
break;
} else {
currentState = stateStack.Pop();
goto switchlbl;
}
}
- case 386: {
+ case 388: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 387;
+ goto case 389;
}
- case 387: {
- if (la == null) { currentState = 387; break; }
+ case 389: {
+ if (la == null) { currentState = 389; break; }
if (set[50].Get(la.kind)) {
- goto case 381;
+ goto case 383;
} else {
- goto case 382;
+ goto case 384;
}
}
- case 388: {
- stateStack.Push(389);
+ case 390: {
+ stateStack.Push(391);
goto case 101;
}
- case 389: {
- if (la == null) { currentState = 389; break; }
+ case 391: {
+ if (la == null) { currentState = 391; break; }
if (la.kind == 37) {
- currentState = 390;
+ currentState = 392;
break;
} else {
currentState = stateStack.Pop();
goto switchlbl;
}
}
- case 390: {
+ case 392: {
PushContext(Context.Expression, la, t);
nextTokenIsPotentialStartOfExpression = true;
- goto case 391;
+ goto case 393;
}
- case 391: {
- if (la == null) { currentState = 391; break; }
+ case 393: {
+ if (la == null) { currentState = 393; break; }
if (set[21].Get(la.kind)) {
- stateStack.Push(392);
+ stateStack.Push(394);
goto case 47;
} else {
- goto case 392;
+ goto case 394;
}
}
- case 392: {
+ case 394: {
PopContext();
goto case 46;
}
- case 393: {
- stateStack.Push(394);
+ case 395: {
+ stateStack.Push(396);
goto case 55;
}
- case 394: {
- if (la == null) { currentState = 394; break; }
+ case 396: {
+ if (la == null) { currentState = 396; break; }
Expect(22, la); // ","
currentState = 55;
break;
}
- case 395: {
- stateStack.Push(396);
+ case 397: {
+ stateStack.Push(398);
goto case 55;
}
- case 396: {
- stateStack.Push(397);
- goto case 259;
+ case 398: {
+ stateStack.Push(399);
+ goto case 261;
}
- case 397: {
- if (la == null) { currentState = 397; break; }
+ case 399: {
+ if (la == null) { currentState = 399; break; }
Expect(113, la); // "End"
- currentState = 398;
+ currentState = 400;
break;
}
- case 398: {
- if (la == null) { currentState = 398; break; }
+ case 400: {
+ if (la == null) { currentState = 400; break; }
if (la.kind == 233) {
goto case 102;
} else {
@@ -5719,362 +5736,362 @@ partial class ExpressionFinder {
}
}
}
- case 399: {
+ case 401: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(400);
+ stateStack.Push(402);
goto case 205;
}
- case 400: {
+ case 402: {
PopContext();
- goto case 401;
+ goto case 403;
}
- case 401: {
- if (la == null) { currentState = 401; break; }
+ case 403: {
+ if (la == null) { currentState = 403; break; }
if (la.kind == 33) {
- currentState = 402;
+ currentState = 404;
break;
} else {
- goto case 402;
+ goto case 404;
}
}
- case 402: {
- if (la == null) { currentState = 402; break; }
+ case 404: {
+ if (la == null) { currentState = 404; break; }
if (la.kind == 37) {
- currentState = 419;
+ currentState = 421;
break;
} else {
if (la.kind == 63) {
- currentState = 416;
+ currentState = 418;
break;
} else {
- goto case 403;
+ goto case 405;
}
}
}
- case 403: {
- if (la == null) { currentState = 403; break; }
+ case 405: {
+ if (la == null) { currentState = 405; break; }
if (la.kind == 20) {
- currentState = 415;
+ currentState = 417;
break;
} else {
- goto case 404;
+ goto case 406;
}
}
- case 404: {
- if (la == null) { currentState = 404; break; }
+ case 406: {
+ if (la == null) { currentState = 406; break; }
if (la.kind == 22) {
- currentState = 405;
+ currentState = 407;
break;
} else {
currentState = stateStack.Pop();
goto switchlbl;
}
}
- case 405: {
+ case 407: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(406);
+ stateStack.Push(408);
goto case 205;
}
- case 406: {
+ case 408: {
PopContext();
- goto case 407;
+ goto case 409;
}
- case 407: {
- if (la == null) { currentState = 407; break; }
+ case 409: {
+ if (la == null) { currentState = 409; break; }
if (la.kind == 33) {
- currentState = 408;
+ currentState = 410;
break;
} else {
- goto case 408;
+ goto case 410;
}
}
- case 408: {
- if (la == null) { currentState = 408; break; }
+ case 410: {
+ if (la == null) { currentState = 410; break; }
if (la.kind == 37) {
- currentState = 412;
+ currentState = 414;
break;
} else {
if (la.kind == 63) {
- currentState = 409;
+ currentState = 411;
break;
} else {
- goto case 403;
+ goto case 405;
}
}
}
- case 409: {
+ case 411: {
PushContext(Context.Type, la, t);
- goto case 410;
+ goto case 412;
}
- case 410: {
- if (la == null) { currentState = 410; break; }
+ case 412: {
+ if (la == null) { currentState = 412; break; }
if (la.kind == 162) {
- stateStack.Push(411);
+ stateStack.Push(413);
goto case 85;
} else {
if (set[16].Get(la.kind)) {
- stateStack.Push(411);
+ stateStack.Push(413);
goto case 37;
} else {
Error(la);
- goto case 411;
+ goto case 413;
}
}
}
- case 411: {
+ case 413: {
PopContext();
- goto case 403;
+ goto case 405;
}
- case 412: {
+ case 414: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 413;
+ goto case 415;
}
- case 413: {
- if (la == null) { currentState = 413; break; }
+ case 415: {
+ if (la == null) { currentState = 415; break; }
if (set[23].Get(la.kind)) {
- stateStack.Push(414);
+ stateStack.Push(416);
goto case 55;
} else {
- goto case 414;
+ goto case 416;
}
}
- case 414: {
- if (la == null) { currentState = 414; break; }
+ case 416: {
+ if (la == null) { currentState = 416; break; }
if (la.kind == 22) {
- currentState = 412;
+ currentState = 414;
break;
} else {
Expect(38, la); // ")"
- currentState = 408;
+ currentState = 410;
break;
}
}
- case 415: {
- stateStack.Push(404);
+ case 417: {
+ stateStack.Push(406);
goto case 55;
}
- case 416: {
+ case 418: {
PushContext(Context.Type, la, t);
- goto case 417;
+ goto case 419;
}
- case 417: {
- if (la == null) { currentState = 417; break; }
+ case 419: {
+ if (la == null) { currentState = 419; break; }
if (la.kind == 162) {
- stateStack.Push(418);
+ stateStack.Push(420);
goto case 85;
} else {
if (set[16].Get(la.kind)) {
- stateStack.Push(418);
+ stateStack.Push(420);
goto case 37;
} else {
Error(la);
- goto case 418;
+ goto case 420;
}
}
}
- case 418: {
+ case 420: {
PopContext();
- goto case 403;
+ goto case 405;
}
- case 419: {
+ case 421: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 420;
+ goto case 422;
}
- case 420: {
- if (la == null) { currentState = 420; break; }
+ case 422: {
+ if (la == null) { currentState = 422; break; }
if (set[23].Get(la.kind)) {
- stateStack.Push(421);
+ stateStack.Push(423);
goto case 55;
} else {
- goto case 421;
+ goto case 423;
}
}
- case 421: {
- if (la == null) { currentState = 421; break; }
+ case 423: {
+ if (la == null) { currentState = 423; break; }
if (la.kind == 22) {
- currentState = 419;
+ currentState = 421;
break;
} else {
Expect(38, la); // ")"
- currentState = 402;
+ currentState = 404;
break;
}
}
- case 422: {
+ case 424: {
PushContext(Context.Type, la, t);
- stateStack.Push(423);
+ stateStack.Push(425);
goto case 37;
}
- case 423: {
+ case 425: {
PopContext();
- goto case 256;
+ goto case 258;
}
- case 424: {
- if (la == null) { currentState = 424; break; }
+ case 426: {
+ if (la == null) { currentState = 426; break; }
Expect(37, la); // "("
- currentState = 425;
+ currentState = 427;
break;
}
- case 425: {
+ case 427: {
PushContext(Context.Default, la, t);
SetIdentifierExpected(la);
- goto case 426;
+ goto case 428;
}
- case 426: {
- if (la == null) { currentState = 426; break; }
+ case 428: {
+ if (la == null) { currentState = 428; break; }
if (set[77].Get(la.kind)) {
- stateStack.Push(427);
- goto case 428;
+ stateStack.Push(429);
+ goto case 430;
} else {
- goto case 427;
+ goto case 429;
}
}
- case 427: {
+ case 429: {
PopContext();
goto case 46;
}
- case 428: {
- stateStack.Push(429);
+ case 430: {
+ stateStack.Push(431);
PushContext(Context.Parameter, la, t);
- goto case 430;
+ goto case 432;
}
- case 429: {
- if (la == null) { currentState = 429; break; }
+ case 431: {
+ if (la == null) { currentState = 431; break; }
if (la.kind == 22) {
- currentState = 428;
+ currentState = 430;
break;
} else {
currentState = stateStack.Pop();
goto switchlbl;
}
}
- case 430: {
+ case 432: {
SetIdentifierExpected(la);
- goto case 431;
+ goto case 433;
}
- case 431: {
- if (la == null) { currentState = 431; break; }
+ case 433: {
+ if (la == null) { currentState = 433; break; }
if (la.kind == 40) {
- stateStack.Push(430);
- goto case 443;
+ stateStack.Push(432);
+ goto case 445;
} else {
- goto case 432;
+ goto case 434;
}
}
- case 432: {
+ case 434: {
SetIdentifierExpected(la);
- goto case 433;
+ goto case 435;
}
- case 433: {
- if (la == null) { currentState = 433; break; }
+ case 435: {
+ if (la == null) { currentState = 435; break; }
if (set[143].Get(la.kind)) {
- currentState = 432;
+ currentState = 434;
break;
} else {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(434);
+ stateStack.Push(436);
goto case 205;
}
}
- case 434: {
+ case 436: {
PopContext();
- goto case 435;
+ goto case 437;
}
- case 435: {
- if (la == null) { currentState = 435; break; }
+ case 437: {
+ if (la == null) { currentState = 437; break; }
if (la.kind == 33) {
- currentState = 436;
+ currentState = 438;
break;
} else {
- goto case 436;
+ goto case 438;
}
}
- case 436: {
- if (la == null) { currentState = 436; break; }
+ case 438: {
+ if (la == null) { currentState = 438; break; }
if (la.kind == 37) {
- currentState = 442;
+ currentState = 444;
break;
} else {
if (la.kind == 63) {
- currentState = 440;
+ currentState = 442;
break;
} else {
- goto case 437;
+ goto case 439;
}
}
}
- case 437: {
- if (la == null) { currentState = 437; break; }
+ case 439: {
+ if (la == null) { currentState = 439; break; }
if (la.kind == 20) {
- currentState = 439;
+ currentState = 441;
break;
} else {
- goto case 438;
+ goto case 440;
}
}
- case 438: {
+ case 440: {
PopContext();
currentState = stateStack.Pop();
goto switchlbl;
}
- case 439: {
- stateStack.Push(438);
+ case 441: {
+ stateStack.Push(440);
goto case 55;
}
- case 440: {
+ case 442: {
PushContext(Context.Type, la, t);
- stateStack.Push(441);
+ stateStack.Push(443);
goto case 37;
}
- case 441: {
+ case 443: {
PopContext();
- goto case 437;
+ goto case 439;
}
- case 442: {
- if (la == null) { currentState = 442; break; }
+ case 444: {
+ if (la == null) { currentState = 444; break; }
if (la.kind == 22) {
- currentState = 442;
+ currentState = 444;
break;
} else {
Expect(38, la); // ")"
- currentState = 436;
+ currentState = 438;
break;
}
}
- case 443: {
- if (la == null) { currentState = 443; break; }
+ case 445: {
+ if (la == null) { currentState = 445; break; }
Expect(40, la); // "<"
- currentState = 444;
+ currentState = 446;
break;
}
- case 444: {
+ case 446: {
wasNormalAttribute = true; PushContext(Context.Attribute, la, t);
- goto case 445;
+ goto case 447;
}
- case 445: {
- stateStack.Push(446);
- goto case 449;
+ case 447: {
+ stateStack.Push(448);
+ goto case 451;
}
- case 446: {
- if (la == null) { currentState = 446; break; }
+ case 448: {
+ if (la == null) { currentState = 448; break; }
if (la.kind == 22) {
- currentState = 445;
+ currentState = 447;
break;
} else {
Expect(39, la); // ">"
- currentState = 447;
+ currentState = 449;
break;
}
}
- case 447: {
+ case 449: {
PopContext();
- goto case 448;
+ goto case 450;
}
- case 448: {
- if (la == null) { currentState = 448; break; }
+ case 450: {
+ if (la == null) { currentState = 450; break; }
if (la.kind == 1) {
goto case 25;
} else {
@@ -6082,296 +6099,302 @@ partial class ExpressionFinder {
goto switchlbl;
}
}
- case 449: {
- if (la == null) { currentState = 449; break; }
+ case 451: {
+ if (la == null) { currentState = 451; break; }
if (la.kind == 65 || la.kind == 155) {
- currentState = 450;
+ currentState = 452;
break;
} else {
goto case 37;
}
}
- case 450: {
- if (la == null) { currentState = 450; break; }
+ case 452: {
+ if (la == null) { currentState = 452; break; }
Expect(21, la); // ":"
- currentState = 451;
+ currentState = 453;
break;
}
- case 451: {
+ case 453: {
wasNormalAttribute = false;
goto case 37;
}
- case 452: {
- stateStack.Push(453);
- goto case 424;
+ case 454: {
+ if (la == null) { currentState = 454; break; }
+ Expect(210, la); // "Sub"
+ currentState = 455;
+ break;
}
- case 453: {
+ case 455: {
+ stateStack.Push(456);
+ goto case 426;
+ }
+ case 456: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 454;
+ goto case 457;
}
- case 454: {
- if (la == null) { currentState = 454; break; }
+ case 457: {
+ if (la == null) { currentState = 457; break; }
if (set[50].Get(la.kind)) {
- goto case 267;
+ goto case 269;
} else {
if (la.kind == 1 || la.kind == 21) {
- stateStack.Push(455);
- goto case 259;
+ stateStack.Push(458);
+ goto case 261;
} else {
goto case 6;
}
}
}
- case 455: {
- if (la == null) { currentState = 455; break; }
+ case 458: {
+ if (la == null) { currentState = 458; break; }
Expect(113, la); // "End"
- currentState = 456;
+ currentState = 459;
break;
}
- case 456: {
- if (la == null) { currentState = 456; break; }
+ case 459: {
+ if (la == null) { currentState = 459; break; }
Expect(210, la); // "Sub"
currentState = stateStack.Pop();
break;
}
- case 457: {
- if (la == null) { currentState = 457; break; }
+ case 460: {
+ if (la == null) { currentState = 460; break; }
if (la.kind == 17 || la.kind == 18 || la.kind == 19) {
- currentState = 470;
+ currentState = 473;
break;
} else {
if (la.kind == 10) {
- stateStack.Push(459);
- goto case 461;
+ stateStack.Push(462);
+ goto case 464;
} else {
Error(la);
- goto case 458;
+ goto case 461;
}
}
}
- case 458: {
+ case 461: {
PopContext();
currentState = stateStack.Pop();
goto switchlbl;
}
- case 459: {
- if (la == null) { currentState = 459; break; }
+ case 462: {
+ if (la == null) { currentState = 462; break; }
if (la.kind == 17) {
- currentState = 460;
+ currentState = 463;
break;
} else {
- goto case 458;
+ goto case 461;
}
}
- case 460: {
- if (la == null) { currentState = 460; break; }
+ case 463: {
+ if (la == null) { currentState = 463; break; }
if (la.kind == 16) {
- currentState = 459;
+ currentState = 462;
break;
} else {
- goto case 459;
+ goto case 462;
}
}
- case 461: {
+ case 464: {
PushContext(Context.Xml, la, t);
- goto case 462;
+ goto case 465;
}
- case 462: {
- if (la == null) { currentState = 462; break; }
+ case 465: {
+ if (la == null) { currentState = 465; break; }
Expect(10, la); // XmlOpenTag
- currentState = 463;
+ currentState = 466;
break;
}
- case 463: {
- if (la == null) { currentState = 463; break; }
+ case 466: {
+ if (la == null) { currentState = 466; break; }
if (set[144].Get(la.kind)) {
if (set[145].Get(la.kind)) {
- currentState = 463;
+ currentState = 466;
break;
} else {
if (la.kind == 12) {
- stateStack.Push(463);
- goto case 467;
+ stateStack.Push(466);
+ goto case 470;
} else {
Error(la);
- goto case 463;
+ goto case 466;
}
}
} else {
if (la.kind == 14) {
- currentState = 464;
+ currentState = 467;
break;
} else {
if (la.kind == 11) {
- currentState = 465;
+ currentState = 468;
break;
} else {
Error(la);
- goto case 464;
+ goto case 467;
}
}
}
}
- case 464: {
+ case 467: {
PopContext();
currentState = stateStack.Pop();
goto switchlbl;
}
- case 465: {
- if (la == null) { currentState = 465; break; }
+ case 468: {
+ if (la == null) { currentState = 468; break; }
if (set[146].Get(la.kind)) {
if (set[147].Get(la.kind)) {
- currentState = 465;
+ currentState = 468;
break;
} else {
if (la.kind == 12) {
- stateStack.Push(465);
- goto case 467;
+ stateStack.Push(468);
+ goto case 470;
} else {
if (la.kind == 10) {
- stateStack.Push(465);
- goto case 461;
+ stateStack.Push(468);
+ goto case 464;
} else {
Error(la);
- goto case 465;
+ goto case 468;
}
}
}
} else {
Expect(15, la); // XmlOpenEndTag
- currentState = 466;
+ currentState = 469;
break;
}
}
- case 466: {
- if (la == null) { currentState = 466; break; }
+ case 469: {
+ if (la == null) { currentState = 469; break; }
if (set[148].Get(la.kind)) {
if (set[149].Get(la.kind)) {
- currentState = 466;
+ currentState = 469;
break;
} else {
if (la.kind == 12) {
- stateStack.Push(466);
- goto case 467;
+ stateStack.Push(469);
+ goto case 470;
} else {
Error(la);
- goto case 466;
+ goto case 469;
}
}
} else {
Expect(11, la); // XmlCloseTag
- currentState = 464;
+ currentState = 467;
break;
}
}
- case 467: {
- if (la == null) { currentState = 467; break; }
+ case 470: {
+ if (la == null) { currentState = 470; break; }
Expect(12, la); // XmlStartInlineVB
- currentState = 468;
+ currentState = 471;
break;
}
- case 468: {
- stateStack.Push(469);
+ case 471: {
+ stateStack.Push(472);
goto case 55;
}
- case 469: {
- if (la == null) { currentState = 469; break; }
+ case 472: {
+ if (la == null) { currentState = 472; break; }
Expect(13, la); // XmlEndInlineVB
currentState = stateStack.Pop();
break;
}
- case 470: {
- if (la == null) { currentState = 470; break; }
+ case 473: {
+ if (la == null) { currentState = 473; break; }
if (la.kind == 16) {
- currentState = 471;
+ currentState = 474;
break;
} else {
- goto case 471;
+ goto case 474;
}
}
- case 471: {
- if (la == null) { currentState = 471; break; }
+ case 474: {
+ if (la == null) { currentState = 474; break; }
if (la.kind == 17 || la.kind == 19) {
- currentState = 470;
+ currentState = 473;
break;
} else {
if (la.kind == 10) {
- stateStack.Push(472);
- goto case 461;
+ stateStack.Push(475);
+ goto case 464;
} else {
- goto case 458;
+ goto case 461;
}
}
}
- case 472: {
- if (la == null) { currentState = 472; break; }
+ case 475: {
+ if (la == null) { currentState = 475; break; }
if (la.kind == 17) {
- currentState = 473;
+ currentState = 476;
break;
} else {
- goto case 458;
+ goto case 461;
}
}
- case 473: {
- if (la == null) { currentState = 473; break; }
+ case 476: {
+ if (la == null) { currentState = 476; break; }
if (la.kind == 16) {
- currentState = 472;
+ currentState = 475;
break;
} else {
- goto case 472;
+ goto case 475;
}
}
- case 474: {
- if (la == null) { currentState = 474; break; }
+ case 477: {
+ if (la == null) { currentState = 477; break; }
Expect(37, la); // "("
- currentState = 475;
+ currentState = 478;
break;
}
- case 475: {
+ case 478: {
readXmlIdentifier = true;
- stateStack.Push(476);
+ stateStack.Push(479);
goto case 205;
}
- case 476: {
- if (la == null) { currentState = 476; break; }
+ case 479: {
+ if (la == null) { currentState = 479; break; }
Expect(38, la); // ")"
currentState = 175;
break;
}
- case 477: {
- if (la == null) { currentState = 477; break; }
+ case 480: {
+ if (la == null) { currentState = 480; break; }
Expect(37, la); // "("
- currentState = 478;
+ currentState = 481;
break;
}
- case 478: {
+ case 481: {
PushContext(Context.Type, la, t);
- stateStack.Push(479);
+ stateStack.Push(482);
goto case 37;
}
- case 479: {
+ case 482: {
PopContext();
- goto case 476;
+ goto case 479;
}
- case 480: {
+ case 483: {
nextTokenIsStartOfImportsOrAccessExpression = true; wasQualifierTokenAtStart = true;
- goto case 481;
+ goto case 484;
}
- case 481: {
- if (la == null) { currentState = 481; break; }
+ case 484: {
+ if (la == null) { currentState = 484; break; }
if (la.kind == 10) {
- currentState = 482;
+ currentState = 485;
break;
} else {
- goto case 482;
+ goto case 485;
}
}
- case 482: {
- stateStack.Push(483);
+ case 485: {
+ stateStack.Push(486);
goto case 101;
}
- case 483: {
- if (la == null) { currentState = 483; break; }
+ case 486: {
+ if (la == null) { currentState = 486; break; }
if (la.kind == 11) {
currentState = 175;
break;
@@ -6379,235 +6402,235 @@ partial class ExpressionFinder {
goto case 175;
}
}
- case 484: {
+ case 487: {
activeArgument = 0;
- goto case 485;
+ goto case 488;
}
- case 485: {
- stateStack.Push(486);
+ case 488: {
+ stateStack.Push(489);
goto case 55;
}
- case 486: {
- if (la == null) { currentState = 486; break; }
+ case 489: {
+ if (la == null) { currentState = 489; break; }
if (la.kind == 22) {
- currentState = 487;
+ currentState = 490;
break;
} else {
- goto case 476;
+ goto case 479;
}
}
- case 487: {
+ case 490: {
activeArgument++;
- goto case 485;
+ goto case 488;
}
- case 488: {
- stateStack.Push(489);
+ case 491: {
+ stateStack.Push(492);
goto case 55;
}
- case 489: {
- if (la == null) { currentState = 489; break; }
+ case 492: {
+ if (la == null) { currentState = 492; break; }
if (la.kind == 22) {
- currentState = 490;
+ currentState = 493;
break;
} else {
currentState = stateStack.Pop();
goto switchlbl;
}
}
- case 490: {
+ case 493: {
activeArgument++;
nextTokenIsPotentialStartOfExpression = true;
- goto case 491;
+ goto case 494;
}
- case 491: {
- if (la == null) { currentState = 491; break; }
+ case 494: {
+ if (la == null) { currentState = 494; break; }
if (set[23].Get(la.kind)) {
- goto case 488;
+ goto case 491;
} else {
- goto case 489;
+ goto case 492;
}
}
- case 492: {
- if (la == null) { currentState = 492; break; }
+ case 495: {
+ if (la == null) { currentState = 495; break; }
if (set[16].Get(la.kind)) {
PushContext(Context.Type, la, t);
- stateStack.Push(496);
+ stateStack.Push(499);
goto case 37;
} else {
- goto case 493;
+ goto case 496;
}
}
- case 493: {
- if (la == null) { currentState = 493; break; }
+ case 496: {
+ if (la == null) { currentState = 496; break; }
if (la.kind == 22) {
- currentState = 494;
+ currentState = 497;
break;
} else {
goto case 45;
}
}
- case 494: {
- if (la == null) { currentState = 494; break; }
+ case 497: {
+ if (la == null) { currentState = 497; break; }
if (set[16].Get(la.kind)) {
PushContext(Context.Type, la, t);
- stateStack.Push(495);
+ stateStack.Push(498);
goto case 37;
} else {
- goto case 493;
+ goto case 496;
}
}
- case 495: {
+ case 498: {
PopContext();
- goto case 493;
+ goto case 496;
}
- case 496: {
+ case 499: {
PopContext();
- goto case 493;
+ goto case 496;
}
- case 497: {
+ case 500: {
SetIdentifierExpected(la);
- goto case 498;
+ goto case 501;
}
- case 498: {
- if (la == null) { currentState = 498; break; }
+ case 501: {
+ if (la == null) { currentState = 501; break; }
if (set[150].Get(la.kind)) {
if (la.kind == 169) {
- currentState = 500;
+ currentState = 503;
break;
} else {
if (set[77].Get(la.kind)) {
- stateStack.Push(499);
- goto case 428;
+ stateStack.Push(502);
+ goto case 430;
} else {
Error(la);
- goto case 499;
+ goto case 502;
}
}
} else {
- goto case 499;
+ goto case 502;
}
}
- case 499: {
- if (la == null) { currentState = 499; break; }
- Expect(38, la); // ")"
- currentState = 34;
- break;
- }
- case 500: {
- stateStack.Push(499);
- goto case 501;
- }
- case 501: {
- SetIdentifierExpected(la);
- goto case 502;
- }
case 502: {
if (la == null) { currentState = 502; break; }
- if (la.kind == 138 || la.kind == 178) {
- currentState = 503;
- break;
- } else {
- goto case 503;
- }
+ Expect(38, la); // ")"
+ currentState = 34;
+ break;
}
case 503: {
- PushContext(Context.Identifier, la, t);
- SetIdentifierExpected(la);
- stateStack.Push(504);
- goto case 518;
+ stateStack.Push(502);
+ goto case 504;
}
case 504: {
- PopContext();
+ SetIdentifierExpected(la);
goto case 505;
}
case 505: {
if (la == null) { currentState = 505; break; }
- if (la.kind == 63) {
- currentState = 519;
+ if (la.kind == 138 || la.kind == 178) {
+ currentState = 506;
break;
} else {
goto case 506;
}
}
case 506: {
- if (la == null) { currentState = 506; break; }
- if (la.kind == 22) {
- currentState = 507;
- break;
- } else {
- currentState = stateStack.Pop();
- goto switchlbl;
- }
+ PushContext(Context.Identifier, la, t);
+ SetIdentifierExpected(la);
+ stateStack.Push(507);
+ goto case 521;
}
case 507: {
- SetIdentifierExpected(la);
+ PopContext();
goto case 508;
}
case 508: {
if (la == null) { currentState = 508; break; }
- if (la.kind == 138 || la.kind == 178) {
- currentState = 509;
+ if (la.kind == 63) {
+ currentState = 522;
break;
} else {
goto case 509;
}
}
case 509: {
- PushContext(Context.Identifier, la, t);
- SetIdentifierExpected(la);
- stateStack.Push(510);
- goto case 518;
+ if (la == null) { currentState = 509; break; }
+ if (la.kind == 22) {
+ currentState = 510;
+ break;
+ } else {
+ currentState = stateStack.Pop();
+ goto switchlbl;
+ }
}
case 510: {
- PopContext();
+ SetIdentifierExpected(la);
goto case 511;
}
case 511: {
if (la == null) { currentState = 511; break; }
- if (la.kind == 63) {
+ if (la.kind == 138 || la.kind == 178) {
currentState = 512;
break;
} else {
- goto case 506;
+ goto case 512;
}
}
case 512: {
- PushContext(Context.Type, la, t);
+ PushContext(Context.Identifier, la, t);
+ SetIdentifierExpected(la);
stateStack.Push(513);
- goto case 514;
+ goto case 521;
}
case 513: {
PopContext();
- goto case 506;
+ goto case 514;
}
case 514: {
if (la == null) { currentState = 514; break; }
+ if (la.kind == 63) {
+ currentState = 515;
+ break;
+ } else {
+ goto case 509;
+ }
+ }
+ case 515: {
+ PushContext(Context.Type, la, t);
+ stateStack.Push(516);
+ goto case 517;
+ }
+ case 516: {
+ PopContext();
+ goto case 509;
+ }
+ case 517: {
+ if (la == null) { currentState = 517; break; }
if (set[94].Get(la.kind)) {
- goto case 517;
+ goto case 520;
} else {
if (la.kind == 35) {
- currentState = 515;
+ currentState = 518;
break;
} else {
goto case 6;
}
}
}
- case 515: {
- stateStack.Push(516);
- goto case 517;
+ case 518: {
+ stateStack.Push(519);
+ goto case 520;
}
- case 516: {
- if (la == null) { currentState = 516; break; }
+ case 519: {
+ if (la == null) { currentState = 519; break; }
if (la.kind == 22) {
- currentState = 515;
+ currentState = 518;
break;
} else {
goto case 82;
}
}
- case 517: {
- if (la == null) { currentState = 517; break; }
+ case 520: {
+ if (la == null) { currentState = 520; break; }
if (set[16].Get(la.kind)) {
currentState = 38;
break;
@@ -6627,8 +6650,8 @@ partial class ExpressionFinder {
}
}
}
- case 518: {
- if (la == null) { currentState = 518; break; }
+ case 521: {
+ if (la == null) { currentState = 521; break; }
if (la.kind == 2) {
goto case 145;
} else {
@@ -6735,515 +6758,515 @@ partial class ExpressionFinder {
}
}
}
- case 519: {
+ case 522: {
PushContext(Context.Type, la, t);
- stateStack.Push(520);
- goto case 514;
+ stateStack.Push(523);
+ goto case 517;
}
- case 520: {
+ case 523: {
PopContext();
- goto case 506;
+ goto case 509;
}
- case 521: {
+ case 524: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(522);
+ stateStack.Push(525);
goto case 205;
}
- case 522: {
+ case 525: {
PopContext();
- goto case 523;
+ goto case 526;
}
- case 523: {
- if (la == null) { currentState = 523; break; }
+ case 526: {
+ if (la == null) { currentState = 526; break; }
if (la.kind == 37) {
- stateStack.Push(524);
- goto case 424;
+ stateStack.Push(527);
+ goto case 426;
} else {
- goto case 524;
+ goto case 527;
}
}
- case 524: {
- if (la == null) { currentState = 524; break; }
+ case 527: {
+ if (la == null) { currentState = 527; break; }
if (la.kind == 63) {
- currentState = 525;
+ currentState = 528;
break;
} else {
goto case 23;
}
}
- case 525: {
+ case 528: {
PushContext(Context.Type, la, t);
- goto case 526;
+ goto case 529;
}
- case 526: {
- if (la == null) { currentState = 526; break; }
+ case 529: {
+ if (la == null) { currentState = 529; break; }
if (la.kind == 40) {
- stateStack.Push(526);
- goto case 443;
+ stateStack.Push(529);
+ goto case 445;
} else {
- stateStack.Push(527);
+ stateStack.Push(530);
goto case 37;
}
}
- case 527: {
+ case 530: {
PopContext();
goto case 23;
}
- case 528: {
+ case 531: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(529);
+ stateStack.Push(532);
goto case 205;
}
- case 529: {
+ case 532: {
PopContext();
- goto case 530;
+ goto case 533;
}
- case 530: {
- if (la == null) { currentState = 530; break; }
+ case 533: {
+ if (la == null) { currentState = 533; break; }
if (la.kind == 37 || la.kind == 63) {
if (la.kind == 63) {
- currentState = 532;
+ currentState = 535;
break;
} else {
if (la.kind == 37) {
stateStack.Push(23);
- goto case 424;
+ goto case 426;
} else {
- goto case 531;
+ goto case 534;
}
}
} else {
goto case 23;
}
}
- case 531: {
+ case 534: {
Error(la);
goto case 23;
}
- case 532: {
+ case 535: {
PushContext(Context.Type, la, t);
- stateStack.Push(533);
+ stateStack.Push(536);
goto case 37;
}
- case 533: {
+ case 536: {
PopContext();
goto case 23;
}
- case 534: {
+ case 537: {
PushContext(Context.TypeDeclaration, la, t);
- goto case 535;
+ goto case 538;
}
- case 535: {
- if (la == null) { currentState = 535; break; }
+ case 538: {
+ if (la == null) { currentState = 538; break; }
Expect(115, la); // "Enum"
- currentState = 536;
+ currentState = 539;
break;
}
- case 536: {
+ case 539: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(537);
+ stateStack.Push(540);
goto case 205;
}
- case 537: {
+ case 540: {
PopContext();
- goto case 538;
+ goto case 541;
}
- case 538: {
- if (la == null) { currentState = 538; break; }
+ case 541: {
+ if (la == null) { currentState = 541; break; }
if (la.kind == 63) {
- currentState = 550;
+ currentState = 553;
break;
} else {
- goto case 539;
+ goto case 542;
}
}
- case 539: {
- stateStack.Push(540);
+ case 542: {
+ stateStack.Push(543);
goto case 23;
}
- case 540: {
+ case 543: {
SetIdentifierExpected(la);
- goto case 541;
+ goto case 544;
}
- case 541: {
- if (la == null) { currentState = 541; break; }
+ case 544: {
+ if (la == null) { currentState = 544; break; }
if (set[97].Get(la.kind)) {
- goto case 545;
+ goto case 548;
} else {
Expect(113, la); // "End"
- currentState = 542;
+ currentState = 545;
break;
}
}
- case 542: {
- if (la == null) { currentState = 542; break; }
+ case 545: {
+ if (la == null) { currentState = 545; break; }
Expect(115, la); // "Enum"
- currentState = 543;
+ currentState = 546;
break;
}
- case 543: {
- stateStack.Push(544);
+ case 546: {
+ stateStack.Push(547);
goto case 23;
}
- case 544: {
+ case 547: {
PopContext();
currentState = stateStack.Pop();
goto switchlbl;
}
- case 545: {
+ case 548: {
SetIdentifierExpected(la);
- goto case 546;
+ goto case 549;
}
- case 546: {
- if (la == null) { currentState = 546; break; }
+ case 549: {
+ if (la == null) { currentState = 549; break; }
if (la.kind == 40) {
- stateStack.Push(545);
- goto case 443;
+ stateStack.Push(548);
+ goto case 445;
} else {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(547);
+ stateStack.Push(550);
goto case 205;
}
}
- case 547: {
+ case 550: {
PopContext();
- goto case 548;
+ goto case 551;
}
- case 548: {
- if (la == null) { currentState = 548; break; }
+ case 551: {
+ if (la == null) { currentState = 551; break; }
if (la.kind == 20) {
- currentState = 549;
+ currentState = 552;
break;
} else {
- goto case 539;
+ goto case 542;
}
}
- case 549: {
- stateStack.Push(539);
+ case 552: {
+ stateStack.Push(542);
goto case 55;
}
- case 550: {
+ case 553: {
PushContext(Context.Type, la, t);
- stateStack.Push(551);
+ stateStack.Push(554);
goto case 37;
}
- case 551: {
+ case 554: {
PopContext();
- goto case 539;
+ goto case 542;
}
- case 552: {
- if (la == null) { currentState = 552; break; }
+ case 555: {
+ if (la == null) { currentState = 555; break; }
Expect(103, la); // "Delegate"
- currentState = 553;
+ currentState = 556;
break;
}
- case 553: {
- if (la == null) { currentState = 553; break; }
+ case 556: {
+ if (la == null) { currentState = 556; break; }
if (la.kind == 210) {
- currentState = 554;
+ currentState = 557;
break;
} else {
if (la.kind == 127) {
- currentState = 554;
+ currentState = 557;
break;
} else {
Error(la);
- goto case 554;
+ goto case 557;
}
}
}
- case 554: {
+ case 557: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- goto case 555;
+ goto case 558;
}
- case 555: {
- if (la == null) { currentState = 555; break; }
- currentState = 556;
+ case 558: {
+ if (la == null) { currentState = 558; break; }
+ currentState = 559;
break;
}
- case 556: {
+ case 559: {
PopContext();
- goto case 557;
+ goto case 560;
}
- case 557: {
- if (la == null) { currentState = 557; break; }
+ case 560: {
+ if (la == null) { currentState = 560; break; }
if (la.kind == 37) {
- currentState = 560;
+ currentState = 563;
break;
} else {
if (la.kind == 63) {
- currentState = 558;
+ currentState = 561;
break;
} else {
goto case 23;
}
}
}
- case 558: {
+ case 561: {
PushContext(Context.Type, la, t);
- stateStack.Push(559);
+ stateStack.Push(562);
goto case 37;
}
- case 559: {
+ case 562: {
PopContext();
goto case 23;
}
- case 560: {
+ case 563: {
SetIdentifierExpected(la);
- goto case 561;
+ goto case 564;
}
- case 561: {
- if (la == null) { currentState = 561; break; }
+ case 564: {
+ if (la == null) { currentState = 564; break; }
if (set[150].Get(la.kind)) {
if (la.kind == 169) {
- currentState = 563;
+ currentState = 566;
break;
} else {
if (set[77].Get(la.kind)) {
- stateStack.Push(562);
- goto case 428;
+ stateStack.Push(565);
+ goto case 430;
} else {
Error(la);
- goto case 562;
+ goto case 565;
}
}
} else {
- goto case 562;
+ goto case 565;
}
}
- case 562: {
- if (la == null) { currentState = 562; break; }
+ case 565: {
+ if (la == null) { currentState = 565; break; }
Expect(38, la); // ")"
- currentState = 557;
+ currentState = 560;
break;
}
- case 563: {
- stateStack.Push(562);
- goto case 501;
+ case 566: {
+ stateStack.Push(565);
+ goto case 504;
}
- case 564: {
+ case 567: {
PushContext(Context.TypeDeclaration, la, t);
- goto case 565;
+ goto case 568;
}
- case 565: {
- if (la == null) { currentState = 565; break; }
+ case 568: {
+ if (la == null) { currentState = 568; break; }
if (la.kind == 155) {
- currentState = 566;
+ currentState = 569;
break;
} else {
if (la.kind == 84) {
- currentState = 566;
+ currentState = 569;
break;
} else {
if (la.kind == 209) {
- currentState = 566;
+ currentState = 569;
break;
} else {
Error(la);
- goto case 566;
+ goto case 569;
}
}
}
}
- case 566: {
+ case 569: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(567);
+ stateStack.Push(570);
goto case 205;
}
- case 567: {
+ case 570: {
PopContext();
- goto case 568;
+ goto case 571;
}
- case 568: {
- if (la == null) { currentState = 568; break; }
+ case 571: {
+ if (la == null) { currentState = 571; break; }
if (la.kind == 37) {
- currentState = 718;
+ currentState = 721;
break;
} else {
- goto case 569;
+ goto case 572;
}
}
- case 569: {
- stateStack.Push(570);
+ case 572: {
+ stateStack.Push(573);
goto case 23;
}
- case 570: {
+ case 573: {
SetIdentifierExpected(la);
isMissingModifier = true;
- goto case 571;
+ goto case 574;
}
- case 571: {
- if (la == null) { currentState = 571; break; }
+ case 574: {
+ if (la == null) { currentState = 574; break; }
if (la.kind == 140) {
isMissingModifier = false;
- goto case 715;
+ goto case 718;
} else {
- goto case 572;
+ goto case 575;
}
}
- case 572: {
+ case 575: {
SetIdentifierExpected(la);
isMissingModifier = true;
- goto case 573;
+ goto case 576;
}
- case 573: {
- if (la == null) { currentState = 573; break; }
+ case 576: {
+ if (la == null) { currentState = 576; break; }
if (la.kind == 136) {
isMissingModifier = false;
- goto case 709;
+ goto case 712;
} else {
- goto case 574;
+ goto case 577;
}
}
- case 574: {
+ case 577: {
SetIdentifierExpected(la);
isMissingModifier = true;
- goto case 575;
+ goto case 578;
}
- case 575: {
- if (la == null) { currentState = 575; break; }
+ case 578: {
+ if (la == null) { currentState = 578; break; }
if (set[101].Get(la.kind)) {
- goto case 580;
+ goto case 583;
} else {
isMissingModifier = false;
- goto case 576;
+ goto case 579;
}
}
- case 576: {
- if (la == null) { currentState = 576; break; }
+ case 579: {
+ if (la == null) { currentState = 579; break; }
Expect(113, la); // "End"
- currentState = 577;
+ currentState = 580;
break;
}
- case 577: {
- if (la == null) { currentState = 577; break; }
+ case 580: {
+ if (la == null) { currentState = 580; break; }
if (la.kind == 155) {
- currentState = 578;
+ currentState = 581;
break;
} else {
if (la.kind == 84) {
- currentState = 578;
+ currentState = 581;
break;
} else {
if (la.kind == 209) {
- currentState = 578;
+ currentState = 581;
break;
} else {
Error(la);
- goto case 578;
+ goto case 581;
}
}
}
}
- case 578: {
- stateStack.Push(579);
+ case 581: {
+ stateStack.Push(582);
goto case 23;
}
- case 579: {
+ case 582: {
PopContext();
currentState = stateStack.Pop();
goto switchlbl;
}
- case 580: {
+ case 583: {
SetIdentifierExpected(la);
isMissingModifier = true;
- goto case 581;
+ goto case 584;
}
- case 581: {
- if (la == null) { currentState = 581; break; }
+ case 584: {
+ if (la == null) { currentState = 584; break; }
if (la.kind == 40) {
- stateStack.Push(580);
- goto case 443;
+ stateStack.Push(583);
+ goto case 445;
} else {
isMissingModifier = true;
- goto case 582;
+ goto case 585;
}
}
- case 582: {
+ case 585: {
SetIdentifierExpected(la);
- goto case 583;
+ goto case 586;
}
- case 583: {
- if (la == null) { currentState = 583; break; }
+ case 586: {
+ if (la == null) { currentState = 586; break; }
if (set[132].Get(la.kind)) {
- currentState = 708;
+ currentState = 711;
break;
} else {
isMissingModifier = false;
SetIdentifierExpected(la);
- goto case 584;
+ goto case 587;
}
}
- case 584: {
- if (la == null) { currentState = 584; break; }
+ case 587: {
+ if (la == null) { currentState = 587; break; }
if (la.kind == 84 || la.kind == 155 || la.kind == 209) {
- stateStack.Push(574);
- goto case 564;
+ stateStack.Push(577);
+ goto case 567;
} else {
if (la.kind == 103) {
- stateStack.Push(574);
- goto case 552;
+ stateStack.Push(577);
+ goto case 555;
} else {
if (la.kind == 115) {
- stateStack.Push(574);
- goto case 534;
+ stateStack.Push(577);
+ goto case 537;
} else {
if (la.kind == 142) {
- stateStack.Push(574);
+ stateStack.Push(577);
goto case 9;
} else {
if (set[104].Get(la.kind)) {
- stateStack.Push(574);
+ stateStack.Push(577);
PushContext(Context.Member, la, t);
SetIdentifierExpected(la);
- goto case 585;
+ goto case 588;
} else {
Error(la);
- goto case 574;
+ goto case 577;
}
}
}
}
}
}
- case 585: {
- if (la == null) { currentState = 585; break; }
+ case 588: {
+ if (la == null) { currentState = 588; break; }
if (set[122].Get(la.kind)) {
- stateStack.Push(586);
- goto case 693;
+ stateStack.Push(589);
+ goto case 696;
} else {
if (la.kind == 127 || la.kind == 210) {
- stateStack.Push(586);
- goto case 675;
+ stateStack.Push(589);
+ goto case 678;
} else {
if (la.kind == 101) {
- stateStack.Push(586);
- goto case 662;
+ stateStack.Push(589);
+ goto case 665;
} else {
if (la.kind == 119) {
- stateStack.Push(586);
- goto case 650;
+ stateStack.Push(589);
+ goto case 653;
} else {
if (la.kind == 98) {
- stateStack.Push(586);
- goto case 638;
+ stateStack.Push(589);
+ goto case 641;
} else {
if (la.kind == 186) {
- stateStack.Push(586);
- goto case 601;
+ stateStack.Push(589);
+ goto case 604;
} else {
if (la.kind == 172) {
- stateStack.Push(586);
- goto case 587;
+ stateStack.Push(589);
+ goto case 590;
} else {
Error(la);
- goto case 586;
+ goto case 589;
}
}
}
@@ -7252,716 +7275,716 @@ partial class ExpressionFinder {
}
}
}
- case 586: {
+ case 589: {
PopContext();
currentState = stateStack.Pop();
goto switchlbl;
}
- case 587: {
- if (la == null) { currentState = 587; break; }
+ case 590: {
+ if (la == null) { currentState = 590; break; }
Expect(172, la); // "Operator"
- currentState = 588;
+ currentState = 591;
break;
}
- case 588: {
+ case 591: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- goto case 589;
+ goto case 592;
}
- case 589: {
- if (la == null) { currentState = 589; break; }
- currentState = 590;
+ case 592: {
+ if (la == null) { currentState = 592; break; }
+ currentState = 593;
break;
}
- case 590: {
+ case 593: {
PopContext();
- goto case 591;
+ goto case 594;
}
- case 591: {
- if (la == null) { currentState = 591; break; }
+ case 594: {
+ if (la == null) { currentState = 594; break; }
Expect(37, la); // "("
- currentState = 592;
+ currentState = 595;
break;
}
- case 592: {
- stateStack.Push(593);
- goto case 428;
+ case 595: {
+ stateStack.Push(596);
+ goto case 430;
}
- case 593: {
- if (la == null) { currentState = 593; break; }
+ case 596: {
+ if (la == null) { currentState = 596; break; }
Expect(38, la); // ")"
- currentState = 594;
+ currentState = 597;
break;
}
- case 594: {
- if (la == null) { currentState = 594; break; }
+ case 597: {
+ if (la == null) { currentState = 597; break; }
if (la.kind == 63) {
- currentState = 598;
+ currentState = 601;
break;
} else {
- goto case 595;
+ goto case 598;
}
}
- case 595: {
- stateStack.Push(596);
- goto case 259;
+ case 598: {
+ stateStack.Push(599);
+ goto case 261;
}
- case 596: {
- if (la == null) { currentState = 596; break; }
+ case 599: {
+ if (la == null) { currentState = 599; break; }
Expect(113, la); // "End"
- currentState = 597;
+ currentState = 600;
break;
}
- case 597: {
- if (la == null) { currentState = 597; break; }
+ case 600: {
+ if (la == null) { currentState = 600; break; }
Expect(172, la); // "Operator"
currentState = 23;
break;
}
- case 598: {
+ case 601: {
PushContext(Context.Type, la, t);
- goto case 599;
+ goto case 602;
}
- case 599: {
- if (la == null) { currentState = 599; break; }
+ case 602: {
+ if (la == null) { currentState = 602; break; }
if (la.kind == 40) {
- stateStack.Push(599);
- goto case 443;
+ stateStack.Push(602);
+ goto case 445;
} else {
- stateStack.Push(600);
+ stateStack.Push(603);
goto case 37;
}
}
- case 600: {
+ case 603: {
PopContext();
- goto case 595;
+ goto case 598;
}
- case 601: {
- if (la == null) { currentState = 601; break; }
+ case 604: {
+ if (la == null) { currentState = 604; break; }
Expect(186, la); // "Property"
- currentState = 602;
+ currentState = 605;
break;
}
- case 602: {
+ case 605: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(603);
+ stateStack.Push(606);
goto case 205;
}
- case 603: {
+ case 606: {
PopContext();
- goto case 604;
+ goto case 607;
}
- case 604: {
- if (la == null) { currentState = 604; break; }
+ case 607: {
+ if (la == null) { currentState = 607; break; }
if (la.kind == 37) {
- stateStack.Push(605);
- goto case 424;
+ stateStack.Push(608);
+ goto case 426;
} else {
- goto case 605;
+ goto case 608;
}
}
- case 605: {
- if (la == null) { currentState = 605; break; }
+ case 608: {
+ if (la == null) { currentState = 608; break; }
if (la.kind == 63) {
- currentState = 635;
+ currentState = 638;
break;
} else {
- goto case 606;
+ goto case 609;
}
}
- case 606: {
- if (la == null) { currentState = 606; break; }
+ case 609: {
+ if (la == null) { currentState = 609; break; }
if (la.kind == 136) {
- currentState = 630;
+ currentState = 633;
break;
} else {
- goto case 607;
+ goto case 610;
}
}
- case 607: {
- if (la == null) { currentState = 607; break; }
+ case 610: {
+ if (la == null) { currentState = 610; break; }
if (la.kind == 20) {
- currentState = 629;
+ currentState = 632;
break;
} else {
- goto case 608;
+ goto case 611;
}
}
- case 608: {
- stateStack.Push(609);
+ case 611: {
+ stateStack.Push(612);
goto case 23;
}
- case 609: {
+ case 612: {
PopContext();
- goto case 610;
+ goto case 613;
}
- case 610: {
- if (la == null) { currentState = 610; break; }
+ case 613: {
+ if (la == null) { currentState = 613; break; }
if (la.kind == 40) {
- stateStack.Push(610);
- goto case 443;
+ stateStack.Push(613);
+ goto case 445;
} else {
- goto case 611;
+ goto case 614;
}
}
- case 611: {
- if (la == null) { currentState = 611; break; }
+ case 614: {
+ if (la == null) { currentState = 614; break; }
if (set[151].Get(la.kind)) {
- currentState = 628;
+ currentState = 631;
break;
} else {
if (la.kind == 128 || la.kind == 198) {
PushContext(Context.Member, la, t);
- goto case 612;
+ goto case 615;
} else {
currentState = stateStack.Pop();
goto switchlbl;
}
}
}
- case 612: {
- if (la == null) { currentState = 612; break; }
+ case 615: {
+ if (la == null) { currentState = 615; break; }
if (la.kind == 128) {
- currentState = 613;
+ currentState = 616;
break;
} else {
if (la.kind == 198) {
- currentState = 613;
+ currentState = 616;
break;
} else {
Error(la);
- goto case 613;
+ goto case 616;
}
}
}
- case 613: {
- if (la == null) { currentState = 613; break; }
+ case 616: {
+ if (la == null) { currentState = 616; break; }
if (la.kind == 37) {
- stateStack.Push(614);
- goto case 424;
+ stateStack.Push(617);
+ goto case 426;
} else {
- goto case 614;
+ goto case 617;
}
}
- case 614: {
- stateStack.Push(615);
- goto case 259;
+ case 617: {
+ stateStack.Push(618);
+ goto case 261;
}
- case 615: {
- if (la == null) { currentState = 615; break; }
+ case 618: {
+ if (la == null) { currentState = 618; break; }
Expect(113, la); // "End"
- currentState = 616;
+ currentState = 619;
break;
}
- case 616: {
- if (la == null) { currentState = 616; break; }
+ case 619: {
+ if (la == null) { currentState = 619; break; }
if (la.kind == 128) {
- currentState = 617;
+ currentState = 620;
break;
} else {
if (la.kind == 198) {
- currentState = 617;
+ currentState = 620;
break;
} else {
Error(la);
- goto case 617;
+ goto case 620;
}
}
}
- case 617: {
- stateStack.Push(618);
+ case 620: {
+ stateStack.Push(621);
goto case 23;
}
- case 618: {
- if (la == null) { currentState = 618; break; }
+ case 621: {
+ if (la == null) { currentState = 621; break; }
if (set[110].Get(la.kind)) {
- goto case 621;
+ goto case 624;
} else {
- goto case 619;
+ goto case 622;
}
}
- case 619: {
- if (la == null) { currentState = 619; break; }
+ case 622: {
+ if (la == null) { currentState = 622; break; }
Expect(113, la); // "End"
- currentState = 620;
+ currentState = 623;
break;
}
- case 620: {
- if (la == null) { currentState = 620; break; }
+ case 623: {
+ if (la == null) { currentState = 623; break; }
Expect(186, la); // "Property"
currentState = 23;
break;
}
- case 621: {
- if (la == null) { currentState = 621; break; }
+ case 624: {
+ if (la == null) { currentState = 624; break; }
if (la.kind == 40) {
- stateStack.Push(621);
- goto case 443;
+ stateStack.Push(624);
+ goto case 445;
} else {
- goto case 622;
+ goto case 625;
}
}
- case 622: {
- if (la == null) { currentState = 622; break; }
+ case 625: {
+ if (la == null) { currentState = 625; break; }
if (set[151].Get(la.kind)) {
- currentState = 622;
+ currentState = 625;
break;
} else {
if (la.kind == 128) {
- currentState = 623;
+ currentState = 626;
break;
} else {
if (la.kind == 198) {
- currentState = 623;
+ currentState = 626;
break;
} else {
Error(la);
- goto case 623;
+ goto case 626;
}
}
}
}
- case 623: {
- if (la == null) { currentState = 623; break; }
+ case 626: {
+ if (la == null) { currentState = 626; break; }
if (la.kind == 37) {
- stateStack.Push(624);
- goto case 424;
+ stateStack.Push(627);
+ goto case 426;
} else {
- goto case 624;
+ goto case 627;
}
}
- case 624: {
- stateStack.Push(625);
- goto case 259;
+ case 627: {
+ stateStack.Push(628);
+ goto case 261;
}
- case 625: {
- if (la == null) { currentState = 625; break; }
+ case 628: {
+ if (la == null) { currentState = 628; break; }
Expect(113, la); // "End"
- currentState = 626;
+ currentState = 629;
break;
}
- case 626: {
- if (la == null) { currentState = 626; break; }
+ case 629: {
+ if (la == null) { currentState = 629; break; }
if (la.kind == 128) {
- currentState = 627;
+ currentState = 630;
break;
} else {
if (la.kind == 198) {
- currentState = 627;
+ currentState = 630;
break;
} else {
Error(la);
- goto case 627;
+ goto case 630;
}
}
}
- case 627: {
- stateStack.Push(619);
+ case 630: {
+ stateStack.Push(622);
goto case 23;
}
- case 628: {
+ case 631: {
SetIdentifierExpected(la);
- goto case 611;
+ goto case 614;
}
- case 629: {
- stateStack.Push(608);
+ case 632: {
+ stateStack.Push(611);
goto case 55;
}
- case 630: {
+ case 633: {
PushContext(Context.Type, la, t);
- stateStack.Push(631);
+ stateStack.Push(634);
goto case 37;
}
- case 631: {
+ case 634: {
PopContext();
- goto case 632;
+ goto case 635;
}
- case 632: {
- if (la == null) { currentState = 632; break; }
+ case 635: {
+ if (la == null) { currentState = 635; break; }
if (la.kind == 22) {
- currentState = 633;
+ currentState = 636;
break;
} else {
- goto case 607;
+ goto case 610;
}
}
- case 633: {
+ case 636: {
PushContext(Context.Type, la, t);
- stateStack.Push(634);
+ stateStack.Push(637);
goto case 37;
}
- case 634: {
+ case 637: {
PopContext();
- goto case 632;
+ goto case 635;
}
- case 635: {
+ case 638: {
PushContext(Context.Type, la, t);
- goto case 636;
+ goto case 639;
}
- case 636: {
- if (la == null) { currentState = 636; break; }
+ case 639: {
+ if (la == null) { currentState = 639; break; }
if (la.kind == 40) {
- stateStack.Push(636);
- goto case 443;
+ stateStack.Push(639);
+ goto case 445;
} else {
if (la.kind == 162) {
- stateStack.Push(637);
+ stateStack.Push(640);
goto case 85;
} else {
if (set[16].Get(la.kind)) {
- stateStack.Push(637);
+ stateStack.Push(640);
goto case 37;
} else {
Error(la);
- goto case 637;
+ goto case 640;
}
}
}
}
- case 637: {
+ case 640: {
PopContext();
- goto case 606;
+ goto case 609;
}
- case 638: {
- if (la == null) { currentState = 638; break; }
+ case 641: {
+ if (la == null) { currentState = 641; break; }
Expect(98, la); // "Custom"
- currentState = 639;
+ currentState = 642;
break;
}
- case 639: {
- stateStack.Push(640);
- goto case 650;
+ case 642: {
+ stateStack.Push(643);
+ goto case 653;
}
- case 640: {
- if (la == null) { currentState = 640; break; }
+ case 643: {
+ if (la == null) { currentState = 643; break; }
if (set[115].Get(la.kind)) {
- goto case 642;
+ goto case 645;
} else {
Expect(113, la); // "End"
- currentState = 641;
+ currentState = 644;
break;
}
}
- case 641: {
- if (la == null) { currentState = 641; break; }
+ case 644: {
+ if (la == null) { currentState = 644; break; }
Expect(119, la); // "Event"
currentState = 23;
break;
}
- case 642: {
- if (la == null) { currentState = 642; break; }
+ case 645: {
+ if (la == null) { currentState = 645; break; }
if (la.kind == 40) {
- stateStack.Push(642);
- goto case 443;
+ stateStack.Push(645);
+ goto case 445;
} else {
if (la.kind == 56) {
- currentState = 643;
+ currentState = 646;
break;
} else {
if (la.kind == 193) {
- currentState = 643;
+ currentState = 646;
break;
} else {
if (la.kind == 189) {
- currentState = 643;
+ currentState = 646;
break;
} else {
Error(la);
- goto case 643;
+ goto case 646;
}
}
}
}
}
- case 643: {
- if (la == null) { currentState = 643; break; }
+ case 646: {
+ if (la == null) { currentState = 646; break; }
Expect(37, la); // "("
- currentState = 644;
+ currentState = 647;
break;
}
- case 644: {
- stateStack.Push(645);
- goto case 428;
+ case 647: {
+ stateStack.Push(648);
+ goto case 430;
}
- case 645: {
- if (la == null) { currentState = 645; break; }
+ case 648: {
+ if (la == null) { currentState = 648; break; }
Expect(38, la); // ")"
- currentState = 646;
+ currentState = 649;
break;
}
- case 646: {
- stateStack.Push(647);
- goto case 259;
+ case 649: {
+ stateStack.Push(650);
+ goto case 261;
}
- case 647: {
- if (la == null) { currentState = 647; break; }
+ case 650: {
+ if (la == null) { currentState = 650; break; }
Expect(113, la); // "End"
- currentState = 648;
+ currentState = 651;
break;
}
- case 648: {
- if (la == null) { currentState = 648; break; }
+ case 651: {
+ if (la == null) { currentState = 651; break; }
if (la.kind == 56) {
- currentState = 649;
+ currentState = 652;
break;
} else {
if (la.kind == 193) {
- currentState = 649;
+ currentState = 652;
break;
} else {
if (la.kind == 189) {
- currentState = 649;
+ currentState = 652;
break;
} else {
Error(la);
- goto case 649;
+ goto case 652;
}
}
}
}
- case 649: {
- stateStack.Push(640);
+ case 652: {
+ stateStack.Push(643);
goto case 23;
}
- case 650: {
- if (la == null) { currentState = 650; break; }
+ case 653: {
+ if (la == null) { currentState = 653; break; }
Expect(119, la); // "Event"
- currentState = 651;
+ currentState = 654;
break;
}
- case 651: {
+ case 654: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(652);
+ stateStack.Push(655);
goto case 205;
}
- case 652: {
+ case 655: {
PopContext();
- goto case 653;
+ goto case 656;
}
- case 653: {
- if (la == null) { currentState = 653; break; }
+ case 656: {
+ if (la == null) { currentState = 656; break; }
if (la.kind == 63) {
- currentState = 660;
+ currentState = 663;
break;
} else {
if (set[152].Get(la.kind)) {
if (la.kind == 37) {
- stateStack.Push(654);
- goto case 424;
+ stateStack.Push(657);
+ goto case 426;
} else {
- goto case 654;
+ goto case 657;
}
} else {
Error(la);
- goto case 654;
+ goto case 657;
}
}
}
- case 654: {
- if (la == null) { currentState = 654; break; }
+ case 657: {
+ if (la == null) { currentState = 657; break; }
if (la.kind == 136) {
- currentState = 655;
+ currentState = 658;
break;
} else {
goto case 23;
}
}
- case 655: {
+ case 658: {
PushContext(Context.Type, la, t);
- stateStack.Push(656);
+ stateStack.Push(659);
goto case 37;
}
- case 656: {
+ case 659: {
PopContext();
- goto case 657;
+ goto case 660;
}
- case 657: {
- if (la == null) { currentState = 657; break; }
+ case 660: {
+ if (la == null) { currentState = 660; break; }
if (la.kind == 22) {
- currentState = 658;
+ currentState = 661;
break;
} else {
goto case 23;
}
}
- case 658: {
+ case 661: {
PushContext(Context.Type, la, t);
- stateStack.Push(659);
+ stateStack.Push(662);
goto case 37;
}
- case 659: {
+ case 662: {
PopContext();
- goto case 657;
+ goto case 660;
}
- case 660: {
+ case 663: {
PushContext(Context.Type, la, t);
- stateStack.Push(661);
+ stateStack.Push(664);
goto case 37;
}
- case 661: {
+ case 664: {
PopContext();
- goto case 654;
+ goto case 657;
}
- case 662: {
- if (la == null) { currentState = 662; break; }
+ case 665: {
+ if (la == null) { currentState = 665; break; }
Expect(101, la); // "Declare"
- currentState = 663;
+ currentState = 666;
break;
}
- case 663: {
- if (la == null) { currentState = 663; break; }
+ case 666: {
+ if (la == null) { currentState = 666; break; }
if (la.kind == 62 || la.kind == 66 || la.kind == 223) {
- currentState = 664;
+ currentState = 667;
break;
} else {
- goto case 664;
+ goto case 667;
}
}
- case 664: {
- if (la == null) { currentState = 664; break; }
+ case 667: {
+ if (la == null) { currentState = 667; break; }
if (la.kind == 210) {
- currentState = 665;
+ currentState = 668;
break;
} else {
if (la.kind == 127) {
- currentState = 665;
+ currentState = 668;
break;
} else {
Error(la);
- goto case 665;
+ goto case 668;
}
}
}
- case 665: {
+ case 668: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(666);
+ stateStack.Push(669);
goto case 205;
}
- case 666: {
+ case 669: {
PopContext();
- goto case 667;
+ goto case 670;
}
- case 667: {
- if (la == null) { currentState = 667; break; }
+ case 670: {
+ if (la == null) { currentState = 670; break; }
Expect(149, la); // "Lib"
- currentState = 668;
+ currentState = 671;
break;
}
- case 668: {
- if (la == null) { currentState = 668; break; }
+ case 671: {
+ if (la == null) { currentState = 671; break; }
Expect(3, la); // LiteralString
- currentState = 669;
+ currentState = 672;
break;
}
- case 669: {
- if (la == null) { currentState = 669; break; }
+ case 672: {
+ if (la == null) { currentState = 672; break; }
if (la.kind == 59) {
- currentState = 674;
+ currentState = 677;
break;
} else {
- goto case 670;
+ goto case 673;
}
}
- case 670: {
- if (la == null) { currentState = 670; break; }
+ case 673: {
+ if (la == null) { currentState = 673; break; }
if (la.kind == 37) {
- stateStack.Push(671);
- goto case 424;
+ stateStack.Push(674);
+ goto case 426;
} else {
- goto case 671;
+ goto case 674;
}
}
- case 671: {
- if (la == null) { currentState = 671; break; }
+ case 674: {
+ if (la == null) { currentState = 674; break; }
if (la.kind == 63) {
- currentState = 672;
+ currentState = 675;
break;
} else {
goto case 23;
}
}
- case 672: {
+ case 675: {
PushContext(Context.Type, la, t);
- stateStack.Push(673);
+ stateStack.Push(676);
goto case 37;
}
- case 673: {
+ case 676: {
PopContext();
goto case 23;
}
- case 674: {
- if (la == null) { currentState = 674; break; }
+ case 677: {
+ if (la == null) { currentState = 677; break; }
Expect(3, la); // LiteralString
- currentState = 670;
+ currentState = 673;
break;
}
- case 675: {
- if (la == null) { currentState = 675; break; }
+ case 678: {
+ if (la == null) { currentState = 678; break; }
if (la.kind == 210) {
- currentState = 676;
+ currentState = 679;
break;
} else {
if (la.kind == 127) {
- currentState = 676;
+ currentState = 679;
break;
} else {
Error(la);
- goto case 676;
+ goto case 679;
}
}
}
- case 676: {
+ case 679: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- goto case 677;
+ goto case 680;
}
- case 677: {
- if (la == null) { currentState = 677; break; }
- currentState = 678;
+ case 680: {
+ if (la == null) { currentState = 680; break; }
+ currentState = 681;
break;
}
- case 678: {
+ case 681: {
PopContext();
- goto case 679;
+ goto case 682;
}
- case 679: {
- if (la == null) { currentState = 679; break; }
+ case 682: {
+ if (la == null) { currentState = 682; break; }
if (la.kind == 37) {
- currentState = 689;
+ currentState = 692;
break;
} else {
if (la.kind == 63) {
- currentState = 687;
+ currentState = 690;
break;
} else {
- goto case 680;
+ goto case 683;
}
}
}
- case 680: {
- if (la == null) { currentState = 680; break; }
+ case 683: {
+ if (la == null) { currentState = 683; break; }
if (la.kind == 134 || la.kind == 136) {
- currentState = 684;
+ currentState = 687;
break;
} else {
- goto case 681;
+ goto case 684;
}
}
- case 681: {
- stateStack.Push(682);
- goto case 259;
+ case 684: {
+ stateStack.Push(685);
+ goto case 261;
}
- case 682: {
- if (la == null) { currentState = 682; break; }
+ case 685: {
+ if (la == null) { currentState = 685; break; }
Expect(113, la); // "End"
- currentState = 683;
+ currentState = 686;
break;
}
- case 683: {
- if (la == null) { currentState = 683; break; }
+ case 686: {
+ if (la == null) { currentState = 686; break; }
if (la.kind == 210) {
currentState = 23;
break;
@@ -7970,129 +7993,129 @@ partial class ExpressionFinder {
currentState = 23;
break;
} else {
- goto case 531;
+ goto case 534;
}
}
}
- case 684: {
- if (la == null) { currentState = 684; break; }
+ case 687: {
+ if (la == null) { currentState = 687; break; }
if (la.kind == 153 || la.kind == 158 || la.kind == 159) {
- currentState = 686;
+ currentState = 689;
break;
} else {
- goto case 685;
+ goto case 688;
}
}
- case 685: {
- stateStack.Push(681);
+ case 688: {
+ stateStack.Push(684);
goto case 37;
}
- case 686: {
- if (la == null) { currentState = 686; break; }
+ case 689: {
+ if (la == null) { currentState = 689; break; }
Expect(26, la); // "."
- currentState = 685;
+ currentState = 688;
break;
}
- case 687: {
+ case 690: {
PushContext(Context.Type, la, t);
- stateStack.Push(688);
+ stateStack.Push(691);
goto case 37;
}
- case 688: {
+ case 691: {
PopContext();
- goto case 680;
+ goto case 683;
}
- case 689: {
+ case 692: {
SetIdentifierExpected(la);
- goto case 690;
+ goto case 693;
}
- case 690: {
- if (la == null) { currentState = 690; break; }
+ case 693: {
+ if (la == null) { currentState = 693; break; }
if (set[150].Get(la.kind)) {
if (la.kind == 169) {
- currentState = 692;
+ currentState = 695;
break;
} else {
if (set[77].Get(la.kind)) {
- stateStack.Push(691);
- goto case 428;
+ stateStack.Push(694);
+ goto case 430;
} else {
Error(la);
- goto case 691;
+ goto case 694;
}
}
} else {
- goto case 691;
+ goto case 694;
}
}
- case 691: {
- if (la == null) { currentState = 691; break; }
+ case 694: {
+ if (la == null) { currentState = 694; break; }
Expect(38, la); // ")"
- currentState = 679;
+ currentState = 682;
break;
}
- case 692: {
- stateStack.Push(691);
- goto case 501;
- }
- case 693: {
+ case 695: {
stateStack.Push(694);
+ goto case 504;
+ }
+ case 696: {
+ stateStack.Push(697);
SetIdentifierExpected(la);
- goto case 695;
+ goto case 698;
}
- case 694: {
- if (la == null) { currentState = 694; break; }
+ case 697: {
+ if (la == null) { currentState = 697; break; }
if (la.kind == 22) {
- currentState = 693;
+ currentState = 696;
break;
} else {
goto case 23;
}
}
- case 695: {
- if (la == null) { currentState = 695; break; }
+ case 698: {
+ if (la == null) { currentState = 698; break; }
if (la.kind == 88) {
- currentState = 696;
+ currentState = 699;
break;
} else {
- goto case 696;
+ goto case 699;
}
}
- case 696: {
+ case 699: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- stateStack.Push(697);
- goto case 707;
+ stateStack.Push(700);
+ goto case 710;
}
- case 697: {
+ case 700: {
PopContext();
- goto case 698;
+ goto case 701;
}
- case 698: {
- if (la == null) { currentState = 698; break; }
+ case 701: {
+ if (la == null) { currentState = 701; break; }
if (la.kind == 33) {
- currentState = 699;
+ currentState = 702;
break;
} else {
- goto case 699;
+ goto case 702;
}
}
- case 699: {
- if (la == null) { currentState = 699; break; }
+ case 702: {
+ if (la == null) { currentState = 702; break; }
if (la.kind == 37) {
- currentState = 704;
+ currentState = 707;
break;
} else {
if (la.kind == 63) {
- currentState = 701;
+ currentState = 704;
break;
} else {
- goto case 700;
+ goto case 703;
}
}
}
- case 700: {
- if (la == null) { currentState = 700; break; }
+ case 703: {
+ if (la == null) { currentState = 703; break; }
if (la.kind == 20) {
currentState = 55;
break;
@@ -8101,55 +8124,55 @@ partial class ExpressionFinder {
goto switchlbl;
}
}
- case 701: {
+ case 704: {
PushContext(Context.Type, la, t);
- goto case 702;
+ goto case 705;
}
- case 702: {
- if (la == null) { currentState = 702; break; }
+ case 705: {
+ if (la == null) { currentState = 705; break; }
if (la.kind == 162) {
- stateStack.Push(703);
+ stateStack.Push(706);
goto case 85;
} else {
if (set[16].Get(la.kind)) {
- stateStack.Push(703);
+ stateStack.Push(706);
goto case 37;
} else {
Error(la);
- goto case 703;
+ goto case 706;
}
}
}
- case 703: {
+ case 706: {
PopContext();
- goto case 700;
+ goto case 703;
}
- case 704: {
+ case 707: {
nextTokenIsPotentialStartOfExpression = true;
- goto case 705;
+ goto case 708;
}
- case 705: {
- if (la == null) { currentState = 705; break; }
+ case 708: {
+ if (la == null) { currentState = 708; break; }
if (set[23].Get(la.kind)) {
- stateStack.Push(706);
+ stateStack.Push(709);
goto case 55;
} else {
- goto case 706;
+ goto case 709;
}
}
- case 706: {
- if (la == null) { currentState = 706; break; }
+ case 709: {
+ if (la == null) { currentState = 709; break; }
if (la.kind == 22) {
- currentState = 704;
+ currentState = 707;
break;
} else {
Expect(38, la); // ")"
- currentState = 699;
+ currentState = 702;
break;
}
}
- case 707: {
- if (la == null) { currentState = 707; break; }
+ case 710: {
+ if (la == null) { currentState = 710; break; }
if (set[137].Get(la.kind)) {
currentState = stateStack.Pop();
break;
@@ -8165,249 +8188,249 @@ partial class ExpressionFinder {
}
}
}
- case 708: {
+ case 711: {
isMissingModifier = false;
- goto case 582;
+ goto case 585;
}
- case 709: {
- if (la == null) { currentState = 709; break; }
+ case 712: {
+ if (la == null) { currentState = 712; break; }
Expect(136, la); // "Implements"
- currentState = 710;
+ currentState = 713;
break;
}
- case 710: {
+ case 713: {
PushContext(Context.Type, la, t);
- stateStack.Push(711);
+ stateStack.Push(714);
goto case 37;
}
- case 711: {
+ case 714: {
PopContext();
- goto case 712;
+ goto case 715;
}
- case 712: {
- if (la == null) { currentState = 712; break; }
+ case 715: {
+ if (la == null) { currentState = 715; break; }
if (la.kind == 22) {
- currentState = 713;
+ currentState = 716;
break;
} else {
- stateStack.Push(574);
+ stateStack.Push(577);
goto case 23;
}
}
- case 713: {
+ case 716: {
PushContext(Context.Type, la, t);
- stateStack.Push(714);
+ stateStack.Push(717);
goto case 37;
}
- case 714: {
+ case 717: {
PopContext();
- goto case 712;
+ goto case 715;
}
- case 715: {
- if (la == null) { currentState = 715; break; }
+ case 718: {
+ if (la == null) { currentState = 718; break; }
Expect(140, la); // "Inherits"
- currentState = 716;
+ currentState = 719;
break;
}
- case 716: {
+ case 719: {
PushContext(Context.Type, la, t);
- stateStack.Push(717);
+ stateStack.Push(720);
goto case 37;
}
- case 717: {
+ case 720: {
PopContext();
- stateStack.Push(572);
+ stateStack.Push(575);
goto case 23;
}
- case 718: {
- if (la == null) { currentState = 718; break; }
+ case 721: {
+ if (la == null) { currentState = 721; break; }
Expect(169, la); // "Of"
- currentState = 719;
+ currentState = 722;
break;
}
- case 719: {
- stateStack.Push(720);
- goto case 501;
+ case 722: {
+ stateStack.Push(723);
+ goto case 504;
}
- case 720: {
- if (la == null) { currentState = 720; break; }
+ case 723: {
+ if (la == null) { currentState = 723; break; }
Expect(38, la); // ")"
- currentState = 569;
+ currentState = 572;
break;
}
- case 721: {
+ case 724: {
isMissingModifier = false;
goto case 28;
}
- case 722: {
+ case 725: {
PushContext(Context.Type, la, t);
- stateStack.Push(723);
+ stateStack.Push(726);
goto case 37;
}
- case 723: {
+ case 726: {
PopContext();
- goto case 724;
+ goto case 727;
}
- case 724: {
- if (la == null) { currentState = 724; break; }
+ case 727: {
+ if (la == null) { currentState = 727; break; }
if (la.kind == 22) {
- currentState = 725;
+ currentState = 728;
break;
} else {
stateStack.Push(17);
goto case 23;
}
}
- case 725: {
+ case 728: {
PushContext(Context.Type, la, t);
- stateStack.Push(726);
+ stateStack.Push(729);
goto case 37;
}
- case 726: {
+ case 729: {
PopContext();
- goto case 724;
+ goto case 727;
}
- case 727: {
- if (la == null) { currentState = 727; break; }
+ case 730: {
+ if (la == null) { currentState = 730; break; }
Expect(169, la); // "Of"
- currentState = 728;
+ currentState = 731;
break;
}
- case 728: {
- stateStack.Push(729);
- goto case 501;
+ case 731: {
+ stateStack.Push(732);
+ goto case 504;
}
- case 729: {
- if (la == null) { currentState = 729; break; }
+ case 732: {
+ if (la == null) { currentState = 732; break; }
Expect(38, la); // ")"
currentState = 14;
break;
}
- case 730: {
+ case 733: {
PushContext(Context.Identifier, la, t);
SetIdentifierExpected(la);
- goto case 731;
+ goto case 734;
}
- case 731: {
- if (la == null) { currentState = 731; break; }
+ case 734: {
+ if (la == null) { currentState = 734; break; }
if (set[49].Get(la.kind)) {
- currentState = 731;
+ currentState = 734;
break;
} else {
PopContext();
- stateStack.Push(732);
+ stateStack.Push(735);
goto case 23;
}
}
- case 732: {
- if (la == null) { currentState = 732; break; }
+ case 735: {
+ if (la == null) { currentState = 735; break; }
if (set[3].Get(la.kind)) {
- stateStack.Push(732);
+ stateStack.Push(735);
goto case 5;
} else {
Expect(113, la); // "End"
- currentState = 733;
+ currentState = 736;
break;
}
}
- case 733: {
- if (la == null) { currentState = 733; break; }
+ case 736: {
+ if (la == null) { currentState = 736; break; }
Expect(160, la); // "Namespace"
currentState = 23;
break;
}
- case 734: {
- if (la == null) { currentState = 734; break; }
+ case 737: {
+ if (la == null) { currentState = 737; break; }
Expect(137, la); // "Imports"
- currentState = 735;
+ currentState = 738;
break;
}
- case 735: {
+ case 738: {
PushContext(Context.Importable, la, t);
nextTokenIsStartOfImportsOrAccessExpression = true;
- goto case 736;
+ goto case 739;
}
- case 736: {
- if (la == null) { currentState = 736; break; }
+ case 739: {
+ if (la == null) { currentState = 739; break; }
if (set[153].Get(la.kind)) {
- currentState = 742;
+ currentState = 745;
break;
} else {
if (la.kind == 10) {
- currentState = 738;
+ currentState = 741;
break;
} else {
Error(la);
- goto case 737;
+ goto case 740;
}
}
}
- case 737: {
+ case 740: {
PopContext();
goto case 23;
}
- case 738: {
- stateStack.Push(739);
+ case 741: {
+ stateStack.Push(742);
goto case 205;
}
- case 739: {
- if (la == null) { currentState = 739; break; }
+ case 742: {
+ if (la == null) { currentState = 742; break; }
Expect(20, la); // "="
- currentState = 740;
+ currentState = 743;
break;
}
- case 740: {
- if (la == null) { currentState = 740; break; }
+ case 743: {
+ if (la == null) { currentState = 743; break; }
Expect(3, la); // LiteralString
- currentState = 741;
+ currentState = 744;
break;
}
- case 741: {
- if (la == null) { currentState = 741; break; }
+ case 744: {
+ if (la == null) { currentState = 744; break; }
Expect(11, la); // XmlCloseTag
- currentState = 737;
+ currentState = 740;
break;
}
- case 742: {
- if (la == null) { currentState = 742; break; }
+ case 745: {
+ if (la == null) { currentState = 745; break; }
if (la.kind == 33 || la.kind == 37) {
- stateStack.Push(742);
+ stateStack.Push(745);
goto case 42;
} else {
if (la.kind == 20 || la.kind == 26) {
- currentState = 743;
+ currentState = 746;
break;
} else {
- goto case 737;
+ goto case 740;
}
}
}
- case 743: {
- stateStack.Push(737);
+ case 746: {
+ stateStack.Push(740);
goto case 37;
}
- case 744: {
- if (la == null) { currentState = 744; break; }
+ case 747: {
+ if (la == null) { currentState = 747; break; }
Expect(173, la); // "Option"
- currentState = 745;
+ currentState = 748;
break;
}
- case 745: {
- if (la == null) { currentState = 745; break; }
+ case 748: {
+ if (la == null) { currentState = 748; break; }
if (la.kind == 121 || la.kind == 139 || la.kind == 207) {
- currentState = 747;
+ currentState = 750;
break;
} else {
if (la.kind == 87) {
- currentState = 746;
+ currentState = 749;
break;
} else {
- goto case 531;
+ goto case 534;
}
}
}
- case 746: {
- if (la == null) { currentState = 746; break; }
+ case 749: {
+ if (la == null) { currentState = 749; break; }
if (la.kind == 213) {
currentState = 23;
break;
@@ -8416,12 +8439,12 @@ partial class ExpressionFinder {
currentState = 23;
break;
} else {
- goto case 531;
+ goto case 534;
}
}
}
- case 747: {
- if (la == null) { currentState = 747; break; }
+ case 750: {
+ if (la == null) { currentState = 750; break; }
if (la.kind == 170 || la.kind == 171) {
currentState = 23;
break;
diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/PushParser.frame b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/PushParser.frame
index 2e7fcca080..1bf369d5ea 100644
--- a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/PushParser.frame
+++ b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/PushParser.frame
@@ -42,6 +42,7 @@ partial class ExpressionFinder {
bool isMissingModifier = false;
bool isAlreadyInExpr = false;
bool wasNormalAttribute = false;
+ int lambdaNestingDepth = 0;
int activeArgument = 0;
List errors = new List();
diff --git a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs
index d5f5a8c3b1..6fd33cca4f 100644
--- a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs
+++ b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs
@@ -183,7 +183,7 @@ out u);
void GlobalAttributeSection() {
Expect(40);
-#line 2823 "VBNET.ATG"
+#line 2826 "VBNET.ATG"
Location startPos = t.Location;
if (la.kind == 65) {
lexer.NextToken();
@@ -191,20 +191,20 @@ out u);
lexer.NextToken();
} else SynErr(243);
-#line 2825 "VBNET.ATG"
+#line 2828 "VBNET.ATG"
string attributeTarget = t.val != null ? t.val.ToLower(System.Globalization.CultureInfo.InvariantCulture) : null;
List attributes = new List();
ASTAttribute attribute;
Expect(21);
Attribute(
-#line 2829 "VBNET.ATG"
+#line 2832 "VBNET.ATG"
out attribute);
-#line 2829 "VBNET.ATG"
+#line 2832 "VBNET.ATG"
attributes.Add(attribute);
while (
-#line 2830 "VBNET.ATG"
+#line 2833 "VBNET.ATG"
NotFinalComma()) {
if (la.kind == 22) {
lexer.NextToken();
@@ -216,10 +216,10 @@ NotFinalComma()) {
Expect(21);
}
Attribute(
-#line 2830 "VBNET.ATG"
+#line 2833 "VBNET.ATG"
out attribute);
-#line 2830 "VBNET.ATG"
+#line 2833 "VBNET.ATG"
attributes.Add(attribute);
}
if (la.kind == 22) {
@@ -228,7 +228,7 @@ out attribute);
Expect(39);
EndOfStmt();
-#line 2835 "VBNET.ATG"
+#line 2838 "VBNET.ATG"
AttributeSection section = new AttributeSection {
AttributeTarget = attributeTarget,
Attributes = attributes,
@@ -354,47 +354,47 @@ out aliasedType);
}
void Qualident(
-#line 3623 "VBNET.ATG"
+#line 3626 "VBNET.ATG"
out string qualident) {
-#line 3625 "VBNET.ATG"
+#line 3628 "VBNET.ATG"
string name;
qualidentBuilder.Length = 0;
Identifier();
-#line 3629 "VBNET.ATG"
+#line 3632 "VBNET.ATG"
qualidentBuilder.Append(t.val);
while (
-#line 3630 "VBNET.ATG"
+#line 3633 "VBNET.ATG"
DotAndIdentOrKw()) {
Expect(26);
IdentifierOrKeyword(
-#line 3630 "VBNET.ATG"
+#line 3633 "VBNET.ATG"
out name);
-#line 3630 "VBNET.ATG"
+#line 3633 "VBNET.ATG"
qualidentBuilder.Append('.'); qualidentBuilder.Append(name);
}
-#line 3632 "VBNET.ATG"
+#line 3635 "VBNET.ATG"
qualident = qualidentBuilder.ToString();
}
void TypeName(
-#line 2694 "VBNET.ATG"
+#line 2697 "VBNET.ATG"
out TypeReference typeref) {
-#line 2695 "VBNET.ATG"
+#line 2698 "VBNET.ATG"
ArrayList rank = null; Location startLocation = la.Location;
NonArrayTypeName(
-#line 2697 "VBNET.ATG"
+#line 2700 "VBNET.ATG"
out typeref, false);
ArrayTypeModifiers(
-#line 2698 "VBNET.ATG"
+#line 2701 "VBNET.ATG"
out rank);
-#line 2700 "VBNET.ATG"
+#line 2703 "VBNET.ATG"
if (typeref != null) {
if (rank != null) {
typeref.RankSpecifier = (int[])rank.ToArray(typeof(int));
@@ -429,10 +429,10 @@ out rank);
}
void AttributeSection(
-#line 2901 "VBNET.ATG"
+#line 2904 "VBNET.ATG"
out AttributeSection section) {
-#line 2903 "VBNET.ATG"
+#line 2906 "VBNET.ATG"
string attributeTarget = "";
List attributes = new List();
ASTAttribute attribute;
@@ -440,22 +440,22 @@ out AttributeSection section) {
Expect(40);
if (
-#line 2909 "VBNET.ATG"
+#line 2912 "VBNET.ATG"
IsLocalAttrTarget()) {
if (la.kind == 119) {
lexer.NextToken();
-#line 2910 "VBNET.ATG"
+#line 2913 "VBNET.ATG"
attributeTarget = "event";
} else if (la.kind == 195) {
lexer.NextToken();
-#line 2911 "VBNET.ATG"
+#line 2914 "VBNET.ATG"
attributeTarget = "return";
} else {
Identifier();
-#line 2914 "VBNET.ATG"
+#line 2917 "VBNET.ATG"
string val = t.val.ToLower(System.Globalization.CultureInfo.InvariantCulture);
if (val != "field" || val != "method" ||
val != "module" || val != "param" ||
@@ -468,20 +468,20 @@ IsLocalAttrTarget()) {
Expect(21);
}
Attribute(
-#line 2924 "VBNET.ATG"
+#line 2927 "VBNET.ATG"
out attribute);
-#line 2924 "VBNET.ATG"
+#line 2927 "VBNET.ATG"
attributes.Add(attribute);
while (
-#line 2925 "VBNET.ATG"
+#line 2928 "VBNET.ATG"
NotFinalComma()) {
Expect(22);
Attribute(
-#line 2925 "VBNET.ATG"
+#line 2928 "VBNET.ATG"
out attribute);
-#line 2925 "VBNET.ATG"
+#line 2928 "VBNET.ATG"
attributes.Add(attribute);
}
if (la.kind == 22) {
@@ -489,7 +489,7 @@ out attribute);
}
Expect(39);
-#line 2929 "VBNET.ATG"
+#line 2932 "VBNET.ATG"
section = new AttributeSection {
AttributeTarget = attributeTarget,
Attributes = attributes,
@@ -500,69 +500,69 @@ out attribute);
}
void TypeModifier(
-#line 3708 "VBNET.ATG"
+#line 3711 "VBNET.ATG"
ModifierList m) {
switch (la.kind) {
case 188: {
lexer.NextToken();
-#line 3709 "VBNET.ATG"
+#line 3712 "VBNET.ATG"
m.Add(Modifiers.Public, t.Location);
break;
}
case 187: {
lexer.NextToken();
-#line 3710 "VBNET.ATG"
+#line 3713 "VBNET.ATG"
m.Add(Modifiers.Protected, t.Location);
break;
}
case 125: {
lexer.NextToken();
-#line 3711 "VBNET.ATG"
+#line 3714 "VBNET.ATG"
m.Add(Modifiers.Internal, t.Location);
break;
}
case 185: {
lexer.NextToken();
-#line 3712 "VBNET.ATG"
+#line 3715 "VBNET.ATG"
m.Add(Modifiers.Private, t.Location);
break;
}
case 200: {
lexer.NextToken();
-#line 3713 "VBNET.ATG"
+#line 3716 "VBNET.ATG"
m.Add(Modifiers.Static, t.Location);
break;
}
case 199: {
lexer.NextToken();
-#line 3714 "VBNET.ATG"
+#line 3717 "VBNET.ATG"
m.Add(Modifiers.New, t.Location);
break;
}
case 156: {
lexer.NextToken();
-#line 3715 "VBNET.ATG"
+#line 3718 "VBNET.ATG"
m.Add(Modifiers.Abstract, t.Location);
break;
}
case 166: {
lexer.NextToken();
-#line 3716 "VBNET.ATG"
+#line 3719 "VBNET.ATG"
m.Add(Modifiers.Sealed, t.Location);
break;
}
case 183: {
lexer.NextToken();
-#line 3717 "VBNET.ATG"
+#line 3720 "VBNET.ATG"
m.Add(Modifiers.Partial, t.Location);
break;
}
@@ -1007,28 +1007,28 @@ out typeRef);
}
void TypeImplementsClause(
-#line 1617 "VBNET.ATG"
+#line 1620 "VBNET.ATG"
out List baseInterfaces) {
-#line 1619 "VBNET.ATG"
+#line 1622 "VBNET.ATG"
baseInterfaces = new List();
TypeReference type = null;
Expect(136);
TypeName(
-#line 1622 "VBNET.ATG"
+#line 1625 "VBNET.ATG"
out type);
-#line 1624 "VBNET.ATG"
+#line 1627 "VBNET.ATG"
if (type != null) baseInterfaces.Add(type);
while (la.kind == 22) {
lexer.NextToken();
TypeName(
-#line 1627 "VBNET.ATG"
+#line 1630 "VBNET.ATG"
out type);
-#line 1628 "VBNET.ATG"
+#line 1631 "VBNET.ATG"
if (type != null) baseInterfaces.Add(type);
}
EndOfStmt();
@@ -1158,10 +1158,10 @@ m, attributes);
}
void NonArrayTypeName(
-#line 2722 "VBNET.ATG"
+#line 2725 "VBNET.ATG"
out TypeReference typeref, bool canBeUnbound) {
-#line 2724 "VBNET.ATG"
+#line 2727 "VBNET.ATG"
string name;
typeref = null;
bool isGlobal = false;
@@ -1171,36 +1171,36 @@ out TypeReference typeref, bool canBeUnbound) {
lexer.NextToken();
Expect(26);
-#line 2729 "VBNET.ATG"
+#line 2732 "VBNET.ATG"
isGlobal = true;
}
QualIdentAndTypeArguments(
-#line 2730 "VBNET.ATG"
+#line 2733 "VBNET.ATG"
out typeref, canBeUnbound);
-#line 2731 "VBNET.ATG"
+#line 2734 "VBNET.ATG"
typeref.IsGlobal = isGlobal;
while (la.kind == 26) {
lexer.NextToken();
-#line 2732 "VBNET.ATG"
+#line 2735 "VBNET.ATG"
TypeReference nestedTypeRef;
QualIdentAndTypeArguments(
-#line 2733 "VBNET.ATG"
+#line 2736 "VBNET.ATG"
out nestedTypeRef, canBeUnbound);
-#line 2734 "VBNET.ATG"
+#line 2737 "VBNET.ATG"
typeref = new InnerClassTypeReference(typeref, nestedTypeRef.Type, nestedTypeRef.GenericTypes);
}
} else if (la.kind == 168) {
lexer.NextToken();
-#line 2737 "VBNET.ATG"
+#line 2740 "VBNET.ATG"
typeref = new TypeReference("System.Object", true);
if (la.kind == 33) {
lexer.NextToken();
-#line 2741 "VBNET.ATG"
+#line 2744 "VBNET.ATG"
List typeArguments = new List(1);
if (typeref != null) typeArguments.Add(typeref);
typeref = new TypeReference("System.Nullable", typeArguments) { IsKeyword = true };
@@ -1208,15 +1208,15 @@ out nestedTypeRef, canBeUnbound);
}
} else if (StartOf(12)) {
PrimitiveTypeName(
-#line 2747 "VBNET.ATG"
+#line 2750 "VBNET.ATG"
out name);
-#line 2747 "VBNET.ATG"
+#line 2750 "VBNET.ATG"
typeref = new TypeReference(name, true);
if (la.kind == 33) {
lexer.NextToken();
-#line 2751 "VBNET.ATG"
+#line 2754 "VBNET.ATG"
List typeArguments = new List(1);
if (typeref != null) typeArguments.Add(typeref);
typeref = new TypeReference("System.Nullable", typeArguments) { IsKeyword = true };
@@ -1255,27 +1255,27 @@ out f);
}
void InterfaceBase(
-#line 1602 "VBNET.ATG"
+#line 1605 "VBNET.ATG"
out List bases) {
-#line 1604 "VBNET.ATG"
+#line 1607 "VBNET.ATG"
TypeReference type;
bases = new List();
Expect(140);
TypeName(
-#line 1608 "VBNET.ATG"
+#line 1611 "VBNET.ATG"
out type);
-#line 1608 "VBNET.ATG"
+#line 1611 "VBNET.ATG"
if (type != null) bases.Add(type);
while (la.kind == 22) {
lexer.NextToken();
TypeName(
-#line 1611 "VBNET.ATG"
+#line 1614 "VBNET.ATG"
out type);
-#line 1611 "VBNET.ATG"
+#line 1614 "VBNET.ATG"
if (type != null) bases.Add(type);
}
EndOfStmt();
@@ -1302,162 +1302,162 @@ TypeDeclaration newType) {
}
void FormalParameterList(
-#line 2939 "VBNET.ATG"
+#line 2942 "VBNET.ATG"
List parameter) {
-#line 2940 "VBNET.ATG"
+#line 2943 "VBNET.ATG"
ParameterDeclarationExpression p;
FormalParameter(
-#line 2942 "VBNET.ATG"
+#line 2945 "VBNET.ATG"
out p);
-#line 2942 "VBNET.ATG"
+#line 2945 "VBNET.ATG"
if (p != null) parameter.Add(p);
while (la.kind == 22) {
lexer.NextToken();
FormalParameter(
-#line 2944 "VBNET.ATG"
+#line 2947 "VBNET.ATG"
out p);
-#line 2944 "VBNET.ATG"
+#line 2947 "VBNET.ATG"
if (p != null) parameter.Add(p);
}
}
void MemberModifier(
-#line 3720 "VBNET.ATG"
+#line 3723 "VBNET.ATG"
ModifierList m) {
switch (la.kind) {
case 156: {
lexer.NextToken();
-#line 3721 "VBNET.ATG"
+#line 3724 "VBNET.ATG"
m.Add(Modifiers.Abstract, t.Location);
break;
}
case 102: {
lexer.NextToken();
-#line 3722 "VBNET.ATG"
+#line 3725 "VBNET.ATG"
m.Add(Modifiers.Default, t.Location);
break;
}
case 125: {
lexer.NextToken();
-#line 3723 "VBNET.ATG"
+#line 3726 "VBNET.ATG"
m.Add(Modifiers.Internal, t.Location);
break;
}
case 199: {
lexer.NextToken();
-#line 3724 "VBNET.ATG"
+#line 3727 "VBNET.ATG"
m.Add(Modifiers.New, t.Location);
break;
}
case 181: {
lexer.NextToken();
-#line 3725 "VBNET.ATG"
+#line 3728 "VBNET.ATG"
m.Add(Modifiers.Override, t.Location);
break;
}
case 157: {
lexer.NextToken();
-#line 3726 "VBNET.ATG"
+#line 3729 "VBNET.ATG"
m.Add(Modifiers.Abstract, t.Location);
break;
}
case 185: {
lexer.NextToken();
-#line 3727 "VBNET.ATG"
+#line 3730 "VBNET.ATG"
m.Add(Modifiers.Private, t.Location);
break;
}
case 187: {
lexer.NextToken();
-#line 3728 "VBNET.ATG"
+#line 3731 "VBNET.ATG"
m.Add(Modifiers.Protected, t.Location);
break;
}
case 188: {
lexer.NextToken();
-#line 3729 "VBNET.ATG"
+#line 3732 "VBNET.ATG"
m.Add(Modifiers.Public, t.Location);
break;
}
case 166: {
lexer.NextToken();
-#line 3730 "VBNET.ATG"
+#line 3733 "VBNET.ATG"
m.Add(Modifiers.Sealed, t.Location);
break;
}
case 167: {
lexer.NextToken();
-#line 3731 "VBNET.ATG"
+#line 3734 "VBNET.ATG"
m.Add(Modifiers.Sealed, t.Location);
break;
}
case 200: {
lexer.NextToken();
-#line 3732 "VBNET.ATG"
+#line 3735 "VBNET.ATG"
m.Add(Modifiers.Static, t.Location);
break;
}
case 180: {
lexer.NextToken();
-#line 3733 "VBNET.ATG"
+#line 3736 "VBNET.ATG"
m.Add(Modifiers.Virtual, t.Location);
break;
}
case 179: {
lexer.NextToken();
-#line 3734 "VBNET.ATG"
+#line 3737 "VBNET.ATG"
m.Add(Modifiers.Overloads, t.Location);
break;
}
case 190: {
lexer.NextToken();
-#line 3735 "VBNET.ATG"
+#line 3738 "VBNET.ATG"
m.Add(Modifiers.ReadOnly, t.Location);
break;
}
case 235: {
lexer.NextToken();
-#line 3736 "VBNET.ATG"
+#line 3739 "VBNET.ATG"
m.Add(Modifiers.WriteOnly, t.Location);
break;
}
case 234: {
lexer.NextToken();
-#line 3737 "VBNET.ATG"
+#line 3740 "VBNET.ATG"
m.Add(Modifiers.WithEvents, t.Location);
break;
}
case 105: {
lexer.NextToken();
-#line 3738 "VBNET.ATG"
+#line 3741 "VBNET.ATG"
m.Add(Modifiers.Dim, t.Location);
break;
}
case 183: {
lexer.NextToken();
-#line 3739 "VBNET.ATG"
+#line 3742 "VBNET.ATG"
m.Add(Modifiers.Partial, t.Location);
break;
}
@@ -2249,6 +2249,7 @@ out stmt);
Parameters = parameters,
TypeReference = returnType,
OverloadableOperator = operatorType,
+ Name = GetReflectionNameForOperator(operatorType, opConversionType),
ConversionType = opConversionType,
Body = (BlockStatement)stmt,
StartLocation = m.GetDeclarationLocation(startPos),
@@ -2506,28 +2507,28 @@ mod, attributes);
}
void Expr(
-#line 1661 "VBNET.ATG"
+#line 1664 "VBNET.ATG"
out Expression expr) {
-#line 1662 "VBNET.ATG"
+#line 1665 "VBNET.ATG"
expr = null; Location startLocation = la.Location;
if (
-#line 1665 "VBNET.ATG"
+#line 1668 "VBNET.ATG"
IsQueryExpression() ) {
QueryExpr(
-#line 1666 "VBNET.ATG"
+#line 1669 "VBNET.ATG"
out expr);
} else if (la.kind == 127 || la.kind == 210) {
LambdaExpr(
-#line 1667 "VBNET.ATG"
+#line 1670 "VBNET.ATG"
out expr);
} else if (StartOf(21)) {
DisjunctionExpr(
-#line 1668 "VBNET.ATG"
+#line 1671 "VBNET.ATG"
out expr);
} else SynErr(266);
-#line 1671 "VBNET.ATG"
+#line 1674 "VBNET.ATG"
if (expr != null) {
expr.StartLocation = startLocation;
expr.EndLocation = t.EndLocation;
@@ -2536,87 +2537,87 @@ out expr);
}
void ImplementsClause(
-#line 1634 "VBNET.ATG"
+#line 1637 "VBNET.ATG"
out List baseInterfaces) {
-#line 1636 "VBNET.ATG"
+#line 1639 "VBNET.ATG"
baseInterfaces = new List();
TypeReference type = null;
string memberName = null;
Expect(136);
NonArrayTypeName(
-#line 1641 "VBNET.ATG"
+#line 1644 "VBNET.ATG"
out type, false);
-#line 1642 "VBNET.ATG"
+#line 1645 "VBNET.ATG"
if (type != null) memberName = TypeReference.StripLastIdentifierFromType(ref type);
-#line 1643 "VBNET.ATG"
+#line 1646 "VBNET.ATG"
baseInterfaces.Add(new InterfaceImplementation(type, memberName));
while (la.kind == 22) {
lexer.NextToken();
NonArrayTypeName(
-#line 1645 "VBNET.ATG"
+#line 1648 "VBNET.ATG"
out type, false);
-#line 1646 "VBNET.ATG"
+#line 1649 "VBNET.ATG"
if (type != null) memberName = TypeReference.StripLastIdentifierFromType(ref type);
-#line 1647 "VBNET.ATG"
+#line 1650 "VBNET.ATG"
baseInterfaces.Add(new InterfaceImplementation(type, memberName));
}
}
void HandlesClause(
-#line 1592 "VBNET.ATG"
+#line 1595 "VBNET.ATG"
out List handlesClause) {
-#line 1594 "VBNET.ATG"
+#line 1597 "VBNET.ATG"
handlesClause = new List();
string name;
Expect(134);
EventMemberSpecifier(
-#line 1597 "VBNET.ATG"
+#line 1600 "VBNET.ATG"
out name);
-#line 1597 "VBNET.ATG"
+#line 1600 "VBNET.ATG"
if (name != null) handlesClause.Add(name);
while (la.kind == 22) {
lexer.NextToken();
EventMemberSpecifier(
-#line 1598 "VBNET.ATG"
+#line 1601 "VBNET.ATG"
out name);
-#line 1598 "VBNET.ATG"
+#line 1601 "VBNET.ATG"
if (name != null) handlesClause.Add(name);
}
}
void Block(
-#line 2987 "VBNET.ATG"
+#line 2990 "VBNET.ATG"
out Statement stmt) {
-#line 2990 "VBNET.ATG"
+#line 2993 "VBNET.ATG"
BlockStatement blockStmt = new BlockStatement();
/* in snippet parsing mode, t might be null */
if (t != null) blockStmt.StartLocation = t.EndLocation;
BlockStart(blockStmt);
while (StartOf(22) ||
-#line 2996 "VBNET.ATG"
+#line 2999 "VBNET.ATG"
IsEndStmtAhead()) {
if (
-#line 2996 "VBNET.ATG"
+#line 2999 "VBNET.ATG"
IsEndStmtAhead()) {
-#line 2997 "VBNET.ATG"
+#line 3000 "VBNET.ATG"
Token first = la;
Expect(113);
EndOfStmt();
-#line 3000 "VBNET.ATG"
+#line 3003 "VBNET.ATG"
AddChild(new EndStatement() {
StartLocation = first.Location,
EndLocation = first.EndLocation }
@@ -2628,7 +2629,7 @@ IsEndStmtAhead()) {
}
}
-#line 3009 "VBNET.ATG"
+#line 3012 "VBNET.ATG"
stmt = blockStmt;
if (t != null) blockStmt.EndLocation = t.EndLocation;
BlockEnd();
@@ -2636,26 +2637,26 @@ IsEndStmtAhead()) {
}
void Charset(
-#line 1584 "VBNET.ATG"
+#line 1587 "VBNET.ATG"
out CharsetModifier charsetModifier) {
-#line 1585 "VBNET.ATG"
+#line 1588 "VBNET.ATG"
charsetModifier = CharsetModifier.None;
if (la.kind == 127 || la.kind == 210) {
} else if (la.kind == 62) {
lexer.NextToken();
-#line 1586 "VBNET.ATG"
+#line 1589 "VBNET.ATG"
charsetModifier = CharsetModifier.Ansi;
} else if (la.kind == 66) {
lexer.NextToken();
-#line 1587 "VBNET.ATG"
+#line 1590 "VBNET.ATG"
charsetModifier = CharsetModifier.Auto;
} else if (la.kind == 223) {
lexer.NextToken();
-#line 1588 "VBNET.ATG"
+#line 1591 "VBNET.ATG"
charsetModifier = CharsetModifier.Unicode;
} else SynErr(267);
}
@@ -2783,10 +2784,10 @@ out CharsetModifier charsetModifier) {
}
void VariableDeclaratorPartAfterIdentifier(
-#line 1463 "VBNET.ATG"
+#line 1466 "VBNET.ATG"
List fieldDeclaration, string name) {
-#line 1465 "VBNET.ATG"
+#line 1468 "VBNET.ATG"
Expression expr = null;
TypeReference type = null;
ArrayList rank = null;
@@ -2794,28 +2795,28 @@ List fieldDeclaration, string name) {
Location startLocation = t.Location;
if (
-#line 1471 "VBNET.ATG"
+#line 1474 "VBNET.ATG"
IsSize() && !IsDims()) {
ArrayInitializationModifier(
-#line 1471 "VBNET.ATG"
+#line 1474 "VBNET.ATG"
out dimension);
}
if (
-#line 1472 "VBNET.ATG"
+#line 1475 "VBNET.ATG"
IsDims()) {
ArrayNameModifier(
-#line 1472 "VBNET.ATG"
+#line 1475 "VBNET.ATG"
out rank);
}
if (
-#line 1474 "VBNET.ATG"
+#line 1477 "VBNET.ATG"
IsObjectCreation()) {
Expect(63);
ObjectCreateExpression(
-#line 1474 "VBNET.ATG"
+#line 1477 "VBNET.ATG"
out expr);
-#line 1476 "VBNET.ATG"
+#line 1479 "VBNET.ATG"
if (expr is ObjectCreateExpression) {
type = ((ObjectCreateExpression)expr).CreateType.Clone();
} else {
@@ -2826,10 +2827,10 @@ out expr);
if (la.kind == 63) {
lexer.NextToken();
TypeName(
-#line 1483 "VBNET.ATG"
+#line 1486 "VBNET.ATG"
out type);
-#line 1485 "VBNET.ATG"
+#line 1488 "VBNET.ATG"
if (type != null) {
for (int i = fieldDeclaration.Count - 1; i >= 0; i--) {
VariableDeclaration vd = fieldDeclaration[i];
@@ -2842,7 +2843,7 @@ out type);
}
-#line 1497 "VBNET.ATG"
+#line 1500 "VBNET.ATG"
if (type == null && (dimension != null || rank != null)) {
type = new TypeReference("");
}
@@ -2869,12 +2870,12 @@ out type);
if (la.kind == 20) {
lexer.NextToken();
Expr(
-#line 1520 "VBNET.ATG"
+#line 1523 "VBNET.ATG"
out expr);
}
} else SynErr(269);
-#line 1523 "VBNET.ATG"
+#line 1526 "VBNET.ATG"
VariableDeclaration varDecl = new VariableDeclaration(name, expr, type);
varDecl.StartLocation = startLocation;
varDecl.EndLocation = t.Location;
@@ -2883,22 +2884,22 @@ out expr);
}
void VariableDeclarator(
-#line 1457 "VBNET.ATG"
+#line 1460 "VBNET.ATG"
List fieldDeclaration) {
Identifier();
-#line 1459 "VBNET.ATG"
+#line 1462 "VBNET.ATG"
string name = t.val;
VariableDeclaratorPartAfterIdentifier(
-#line 1460 "VBNET.ATG"
+#line 1463 "VBNET.ATG"
fieldDeclaration, name);
}
void ConstantDeclarator(
-#line 1438 "VBNET.ATG"
+#line 1441 "VBNET.ATG"
List constantDeclaration) {
-#line 1440 "VBNET.ATG"
+#line 1443 "VBNET.ATG"
Expression expr = null;
TypeReference type = null;
string name = String.Empty;
@@ -2906,20 +2907,20 @@ List constantDeclaration) {
Identifier();
-#line 1445 "VBNET.ATG"
+#line 1448 "VBNET.ATG"
name = t.val; location = t.Location;
if (la.kind == 63) {
lexer.NextToken();
TypeName(
-#line 1446 "VBNET.ATG"
+#line 1449 "VBNET.ATG"
out type);
}
Expect(20);
Expr(
-#line 1447 "VBNET.ATG"
+#line 1450 "VBNET.ATG"
out expr);
-#line 1449 "VBNET.ATG"
+#line 1452 "VBNET.ATG"
VariableDeclaration f = new VariableDeclaration(name, expr);
f.TypeReference = type;
f.StartLocation = location;
@@ -2928,10 +2929,10 @@ out expr);
}
void ObjectCreateExpression(
-#line 2123 "VBNET.ATG"
+#line 2126 "VBNET.ATG"
out Expression oce) {
-#line 2125 "VBNET.ATG"
+#line 2128 "VBNET.ATG"
TypeReference type = null;
CollectionInitializerExpression initializer = null;
List arguments = null;
@@ -2943,39 +2944,39 @@ out Expression oce) {
Expect(162);
if (StartOf(8)) {
NonArrayTypeName(
-#line 2134 "VBNET.ATG"
+#line 2137 "VBNET.ATG"
out type, false);
if (la.kind == 37) {
lexer.NextToken();
NormalOrReDimArgumentList(
-#line 2135 "VBNET.ATG"
+#line 2138 "VBNET.ATG"
out arguments, out canBeNormal, out canBeReDim);
Expect(38);
if (la.kind == 35 ||
-#line 2136 "VBNET.ATG"
+#line 2139 "VBNET.ATG"
la.kind == Tokens.OpenParenthesis) {
if (
-#line 2136 "VBNET.ATG"
+#line 2139 "VBNET.ATG"
la.kind == Tokens.OpenParenthesis) {
ArrayTypeModifiers(
-#line 2137 "VBNET.ATG"
+#line 2140 "VBNET.ATG"
out dimensions);
CollectionInitializer(
-#line 2138 "VBNET.ATG"
+#line 2141 "VBNET.ATG"
out initializer);
} else {
CollectionInitializer(
-#line 2139 "VBNET.ATG"
+#line 2142 "VBNET.ATG"
out initializer);
}
}
-#line 2141 "VBNET.ATG"
+#line 2144 "VBNET.ATG"
if (canBeReDim && !canBeNormal && initializer == null) initializer = new CollectionInitializerExpression();
}
}
-#line 2145 "VBNET.ATG"
+#line 2148 "VBNET.ATG"
if (initializer == null) {
oce = new ObjectCreateExpression(type, arguments);
} else {
@@ -2990,53 +2991,53 @@ out initializer);
if (la.kind == 126 || la.kind == 233) {
if (la.kind == 233) {
-#line 2160 "VBNET.ATG"
+#line 2163 "VBNET.ATG"
MemberInitializerExpression memberInitializer = null;
Expression anonymousMember = null;
lexer.NextToken();
-#line 2165 "VBNET.ATG"
+#line 2168 "VBNET.ATG"
CollectionInitializerExpression memberInitializers = new CollectionInitializerExpression();
memberInitializers.StartLocation = la.Location;
Expect(35);
if (la.kind == 26 || la.kind == 147) {
MemberInitializer(
-#line 2170 "VBNET.ATG"
+#line 2173 "VBNET.ATG"
out memberInitializer);
-#line 2171 "VBNET.ATG"
+#line 2174 "VBNET.ATG"
memberInitializers.CreateExpressions.Add(memberInitializer);
} else if (StartOf(24)) {
Expr(
-#line 2172 "VBNET.ATG"
+#line 2175 "VBNET.ATG"
out anonymousMember);
-#line 2173 "VBNET.ATG"
+#line 2176 "VBNET.ATG"
memberInitializers.CreateExpressions.Add(anonymousMember);
} else SynErr(270);
while (la.kind == 22) {
lexer.NextToken();
if (la.kind == 26 || la.kind == 147) {
MemberInitializer(
-#line 2177 "VBNET.ATG"
+#line 2180 "VBNET.ATG"
out memberInitializer);
-#line 2178 "VBNET.ATG"
+#line 2181 "VBNET.ATG"
memberInitializers.CreateExpressions.Add(memberInitializer);
} else if (StartOf(24)) {
Expr(
-#line 2179 "VBNET.ATG"
+#line 2182 "VBNET.ATG"
out anonymousMember);
-#line 2180 "VBNET.ATG"
+#line 2183 "VBNET.ATG"
memberInitializers.CreateExpressions.Add(anonymousMember);
} else SynErr(271);
}
Expect(36);
-#line 2185 "VBNET.ATG"
+#line 2188 "VBNET.ATG"
memberInitializers.EndLocation = t.Location;
if(oce is ObjectCreateExpression)
{
@@ -3046,17 +3047,17 @@ out anonymousMember);
} else {
lexer.NextToken();
CollectionInitializer(
-#line 2195 "VBNET.ATG"
+#line 2198 "VBNET.ATG"
out initializer);
-#line 2197 "VBNET.ATG"
+#line 2200 "VBNET.ATG"
if(oce is ObjectCreateExpression)
((ObjectCreateExpression)oce).ObjectInitializer = initializer;
}
}
-#line 2203 "VBNET.ATG"
+#line 2206 "VBNET.ATG"
if (oce != null) {
oce.StartLocation = startLocation;
oce.EndLocation = t.EndLocation;
@@ -3065,10 +3066,10 @@ out initializer);
}
void AccessorDecls(
-#line 1372 "VBNET.ATG"
+#line 1375 "VBNET.ATG"
out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
-#line 1374 "VBNET.ATG"
+#line 1377 "VBNET.ATG"
List attributes = new List();
AttributeSection section;
getBlock = null;
@@ -3076,60 +3077,60 @@ out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
while (la.kind == 40) {
AttributeSection(
-#line 1379 "VBNET.ATG"
+#line 1382 "VBNET.ATG"
out section);
-#line 1379 "VBNET.ATG"
+#line 1382 "VBNET.ATG"
attributes.Add(section);
}
if (StartOf(25)) {
GetAccessorDecl(
-#line 1381 "VBNET.ATG"
+#line 1384 "VBNET.ATG"
out getBlock, attributes);
if (StartOf(26)) {
-#line 1383 "VBNET.ATG"
+#line 1386 "VBNET.ATG"
attributes = new List();
while (la.kind == 40) {
AttributeSection(
-#line 1384 "VBNET.ATG"
+#line 1387 "VBNET.ATG"
out section);
-#line 1384 "VBNET.ATG"
+#line 1387 "VBNET.ATG"
attributes.Add(section);
}
SetAccessorDecl(
-#line 1385 "VBNET.ATG"
+#line 1388 "VBNET.ATG"
out setBlock, attributes);
}
} else if (StartOf(27)) {
SetAccessorDecl(
-#line 1388 "VBNET.ATG"
+#line 1391 "VBNET.ATG"
out setBlock, attributes);
if (StartOf(28)) {
-#line 1390 "VBNET.ATG"
+#line 1393 "VBNET.ATG"
attributes = new List();
while (la.kind == 40) {
AttributeSection(
-#line 1391 "VBNET.ATG"
+#line 1394 "VBNET.ATG"
out section);
-#line 1391 "VBNET.ATG"
+#line 1394 "VBNET.ATG"
attributes.Add(section);
}
GetAccessorDecl(
-#line 1392 "VBNET.ATG"
+#line 1395 "VBNET.ATG"
out getBlock, attributes);
}
} else SynErr(272);
}
void EventAccessorDeclaration(
-#line 1335 "VBNET.ATG"
+#line 1338 "VBNET.ATG"
out EventAddRemoveRegion eventAccessorDeclaration) {
-#line 1337 "VBNET.ATG"
+#line 1340 "VBNET.ATG"
Statement stmt = null;
List p = new List();
AttributeSection section;
@@ -3138,10 +3139,10 @@ out EventAddRemoveRegion eventAccessorDeclaration) {
while (la.kind == 40) {
AttributeSection(
-#line 1343 "VBNET.ATG"
+#line 1346 "VBNET.ATG"
out section);
-#line 1343 "VBNET.ATG"
+#line 1346 "VBNET.ATG"
attributes.Add(section);
}
if (la.kind == 56) {
@@ -3150,20 +3151,20 @@ out section);
lexer.NextToken();
if (StartOf(6)) {
FormalParameterList(
-#line 1345 "VBNET.ATG"
+#line 1348 "VBNET.ATG"
p);
}
Expect(38);
}
Expect(1);
Block(
-#line 1346 "VBNET.ATG"
+#line 1349 "VBNET.ATG"
out stmt);
Expect(113);
Expect(56);
EndOfStmt();
-#line 1348 "VBNET.ATG"
+#line 1351 "VBNET.ATG"
eventAccessorDeclaration = new EventAddRegion(attributes);
eventAccessorDeclaration.Block = (BlockStatement)stmt;
eventAccessorDeclaration.Parameters = p;
@@ -3174,20 +3175,20 @@ out stmt);
lexer.NextToken();
if (StartOf(6)) {
FormalParameterList(
-#line 1353 "VBNET.ATG"
+#line 1356 "VBNET.ATG"
p);
}
Expect(38);
}
Expect(1);
Block(
-#line 1354 "VBNET.ATG"
+#line 1357 "VBNET.ATG"
out stmt);
Expect(113);
Expect(193);
EndOfStmt();
-#line 1356 "VBNET.ATG"
+#line 1359 "VBNET.ATG"
eventAccessorDeclaration = new EventRemoveRegion(attributes);
eventAccessorDeclaration.Block = (BlockStatement)stmt;
eventAccessorDeclaration.Parameters = p;
@@ -3198,20 +3199,20 @@ out stmt);
lexer.NextToken();
if (StartOf(6)) {
FormalParameterList(
-#line 1361 "VBNET.ATG"
+#line 1364 "VBNET.ATG"
p);
}
Expect(38);
}
Expect(1);
Block(
-#line 1362 "VBNET.ATG"
+#line 1365 "VBNET.ATG"
out stmt);
Expect(113);
Expect(189);
EndOfStmt();
-#line 1364 "VBNET.ATG"
+#line 1367 "VBNET.ATG"
eventAccessorDeclaration = new EventRaiseRegion(attributes);
eventAccessorDeclaration.Block = (BlockStatement)stmt;
eventAccessorDeclaration.Parameters = p;
@@ -3220,163 +3221,170 @@ out stmt);
}
void OverloadableOperator(
-#line 1277 "VBNET.ATG"
+#line 1278 "VBNET.ATG"
out OverloadableOperatorType operatorType) {
-#line 1278 "VBNET.ATG"
+#line 1279 "VBNET.ATG"
operatorType = OverloadableOperatorType.None;
switch (la.kind) {
case 31: {
lexer.NextToken();
-#line 1280 "VBNET.ATG"
+#line 1281 "VBNET.ATG"
operatorType = OverloadableOperatorType.Add;
break;
}
case 30: {
lexer.NextToken();
-#line 1282 "VBNET.ATG"
+#line 1283 "VBNET.ATG"
operatorType = OverloadableOperatorType.Subtract;
break;
}
case 34: {
lexer.NextToken();
-#line 1284 "VBNET.ATG"
+#line 1285 "VBNET.ATG"
operatorType = OverloadableOperatorType.Multiply;
break;
}
case 24: {
lexer.NextToken();
-#line 1286 "VBNET.ATG"
+#line 1287 "VBNET.ATG"
operatorType = OverloadableOperatorType.Divide;
break;
}
case 25: {
lexer.NextToken();
-#line 1288 "VBNET.ATG"
+#line 1289 "VBNET.ATG"
operatorType = OverloadableOperatorType.DivideInteger;
break;
}
case 23: {
lexer.NextToken();
-#line 1290 "VBNET.ATG"
+#line 1291 "VBNET.ATG"
operatorType = OverloadableOperatorType.Concat;
break;
}
case 150: {
lexer.NextToken();
-#line 1292 "VBNET.ATG"
+#line 1293 "VBNET.ATG"
operatorType = OverloadableOperatorType.Like;
break;
}
case 154: {
lexer.NextToken();
-#line 1294 "VBNET.ATG"
+#line 1295 "VBNET.ATG"
operatorType = OverloadableOperatorType.Modulus;
break;
}
case 60: {
lexer.NextToken();
-#line 1296 "VBNET.ATG"
+#line 1297 "VBNET.ATG"
operatorType = OverloadableOperatorType.BitwiseAnd;
break;
}
case 175: {
lexer.NextToken();
-#line 1298 "VBNET.ATG"
+#line 1299 "VBNET.ATG"
operatorType = OverloadableOperatorType.BitwiseOr;
break;
}
case 236: {
lexer.NextToken();
-#line 1300 "VBNET.ATG"
+#line 1301 "VBNET.ATG"
operatorType = OverloadableOperatorType.ExclusiveOr;
break;
}
+ case 164: {
+ lexer.NextToken();
+
+#line 1303 "VBNET.ATG"
+ operatorType = OverloadableOperatorType.BitNot;
+ break;
+ }
case 32: {
lexer.NextToken();
-#line 1302 "VBNET.ATG"
+#line 1305 "VBNET.ATG"
operatorType = OverloadableOperatorType.Power;
break;
}
case 44: {
lexer.NextToken();
-#line 1304 "VBNET.ATG"
+#line 1307 "VBNET.ATG"
operatorType = OverloadableOperatorType.ShiftLeft;
break;
}
case 45: {
lexer.NextToken();
-#line 1306 "VBNET.ATG"
+#line 1309 "VBNET.ATG"
operatorType = OverloadableOperatorType.ShiftRight;
break;
}
case 20: {
lexer.NextToken();
-#line 1308 "VBNET.ATG"
+#line 1311 "VBNET.ATG"
operatorType = OverloadableOperatorType.Equality;
break;
}
case 41: {
lexer.NextToken();
-#line 1310 "VBNET.ATG"
+#line 1313 "VBNET.ATG"
operatorType = OverloadableOperatorType.InEquality;
break;
}
case 40: {
lexer.NextToken();
-#line 1312 "VBNET.ATG"
+#line 1315 "VBNET.ATG"
operatorType = OverloadableOperatorType.LessThan;
break;
}
case 43: {
lexer.NextToken();
-#line 1314 "VBNET.ATG"
+#line 1317 "VBNET.ATG"
operatorType = OverloadableOperatorType.LessThanOrEqual;
break;
}
case 39: {
lexer.NextToken();
-#line 1316 "VBNET.ATG"
+#line 1319 "VBNET.ATG"
operatorType = OverloadableOperatorType.GreaterThan;
break;
}
case 42: {
lexer.NextToken();
-#line 1318 "VBNET.ATG"
+#line 1321 "VBNET.ATG"
operatorType = OverloadableOperatorType.GreaterThanOrEqual;
break;
}
case 94: {
lexer.NextToken();
-#line 1320 "VBNET.ATG"
+#line 1323 "VBNET.ATG"
operatorType = OverloadableOperatorType.CType;
break;
}
case 2: case 58: case 62: case 64: case 65: case 66: case 67: case 70: case 87: case 98: case 104: case 107: case 116: case 121: case 126: case 133: case 139: case 143: case 146: case 147: case 170: case 176: case 178: case 184: case 203: case 212: case 213: case 223: case 224: case 230: {
Identifier();
-#line 1324 "VBNET.ATG"
+#line 1327 "VBNET.ATG"
string opName = t.val;
if (string.Equals(opName, "istrue", StringComparison.InvariantCultureIgnoreCase)) {
operatorType = OverloadableOperatorType.IsTrue;
@@ -3393,10 +3401,10 @@ out OverloadableOperatorType operatorType) {
}
void FormalParameter(
-#line 2948 "VBNET.ATG"
+#line 2951 "VBNET.ATG"
out ParameterDeclarationExpression p) {
-#line 2950 "VBNET.ATG"
+#line 2953 "VBNET.ATG"
AttributeSection section;
List attributes = new List();
TypeReference type = null;
@@ -3408,36 +3416,36 @@ out ParameterDeclarationExpression p) {
while (la.kind == 40) {
AttributeSection(
-#line 2960 "VBNET.ATG"
+#line 2963 "VBNET.ATG"
out section);
-#line 2960 "VBNET.ATG"
+#line 2963 "VBNET.ATG"
attributes.Add(section);
}
while (StartOf(29)) {
ParameterModifier(
-#line 2961 "VBNET.ATG"
+#line 2964 "VBNET.ATG"
mod);
}
Identifier();
-#line 2962 "VBNET.ATG"
+#line 2965 "VBNET.ATG"
string parameterName = t.val;
if (
-#line 2963 "VBNET.ATG"
+#line 2966 "VBNET.ATG"
IsDims()) {
ArrayTypeModifiers(
-#line 2963 "VBNET.ATG"
+#line 2966 "VBNET.ATG"
out arrayModifiers);
}
if (la.kind == 63) {
lexer.NextToken();
TypeName(
-#line 2964 "VBNET.ATG"
+#line 2967 "VBNET.ATG"
out type);
}
-#line 2966 "VBNET.ATG"
+#line 2969 "VBNET.ATG"
if(type != null) {
if (arrayModifiers != null) {
if (type.RankSpecifier != null) {
@@ -3451,11 +3459,11 @@ out type);
if (la.kind == 20) {
lexer.NextToken();
Expr(
-#line 2976 "VBNET.ATG"
+#line 2979 "VBNET.ATG"
out expr);
}
-#line 2978 "VBNET.ATG"
+#line 2981 "VBNET.ATG"
mod.Check();
p = new ParameterDeclarationExpression(type, parameterName, mod.Modifier, expr);
p.Attributes = attributes;
@@ -3465,67 +3473,67 @@ out expr);
}
void GetAccessorDecl(
-#line 1398 "VBNET.ATG"
+#line 1401 "VBNET.ATG"
out PropertyGetRegion getBlock, List attributes) {
-#line 1399 "VBNET.ATG"
+#line 1402 "VBNET.ATG"
Statement stmt = null; Modifiers m;
PropertyAccessorAccessModifier(
-#line 1401 "VBNET.ATG"
+#line 1404 "VBNET.ATG"
out m);
Expect(128);
-#line 1403 "VBNET.ATG"
+#line 1406 "VBNET.ATG"
Location startLocation = t.Location;
Expect(1);
Block(
-#line 1405 "VBNET.ATG"
+#line 1408 "VBNET.ATG"
out stmt);
-#line 1406 "VBNET.ATG"
+#line 1409 "VBNET.ATG"
getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes);
Expect(113);
Expect(128);
-#line 1408 "VBNET.ATG"
+#line 1411 "VBNET.ATG"
getBlock.Modifier = m;
-#line 1409 "VBNET.ATG"
+#line 1412 "VBNET.ATG"
getBlock.StartLocation = startLocation; getBlock.EndLocation = t.EndLocation;
EndOfStmt();
}
void SetAccessorDecl(
-#line 1414 "VBNET.ATG"
+#line 1417 "VBNET.ATG"
out PropertySetRegion setBlock, List attributes) {
-#line 1416 "VBNET.ATG"
+#line 1419 "VBNET.ATG"
Statement stmt = null;
List p = new List();
Modifiers m;
PropertyAccessorAccessModifier(
-#line 1421 "VBNET.ATG"
+#line 1424 "VBNET.ATG"
out m);
Expect(198);
-#line 1423 "VBNET.ATG"
+#line 1426 "VBNET.ATG"
Location startLocation = t.Location;
if (la.kind == 37) {
lexer.NextToken();
if (StartOf(6)) {
FormalParameterList(
-#line 1424 "VBNET.ATG"
+#line 1427 "VBNET.ATG"
p);
}
Expect(38);
}
Expect(1);
Block(
-#line 1426 "VBNET.ATG"
+#line 1429 "VBNET.ATG"
out stmt);
-#line 1428 "VBNET.ATG"
+#line 1431 "VBNET.ATG"
setBlock = new PropertySetRegion((BlockStatement)stmt, attributes);
setBlock.Modifier = m;
setBlock.Parameters = p;
@@ -3533,116 +3541,116 @@ out stmt);
Expect(113);
Expect(198);
-#line 1433 "VBNET.ATG"
+#line 1436 "VBNET.ATG"
setBlock.StartLocation = startLocation; setBlock.EndLocation = t.EndLocation;
EndOfStmt();
}
void PropertyAccessorAccessModifier(
-#line 3742 "VBNET.ATG"
+#line 3745 "VBNET.ATG"
out Modifiers m) {
-#line 3743 "VBNET.ATG"
+#line 3746 "VBNET.ATG"
m = Modifiers.None;
while (StartOf(30)) {
if (la.kind == 188) {
lexer.NextToken();
-#line 3745 "VBNET.ATG"
+#line 3748 "VBNET.ATG"
m |= Modifiers.Public;
} else if (la.kind == 187) {
lexer.NextToken();
-#line 3746 "VBNET.ATG"
+#line 3749 "VBNET.ATG"
m |= Modifiers.Protected;
} else if (la.kind == 125) {
lexer.NextToken();
-#line 3747 "VBNET.ATG"
+#line 3750 "VBNET.ATG"
m |= Modifiers.Internal;
} else {
lexer.NextToken();
-#line 3748 "VBNET.ATG"
+#line 3751 "VBNET.ATG"
m |= Modifiers.Private;
}
}
}
void ArrayInitializationModifier(
-#line 1531 "VBNET.ATG"
+#line 1534 "VBNET.ATG"
out List arrayModifiers) {
-#line 1533 "VBNET.ATG"
+#line 1536 "VBNET.ATG"
arrayModifiers = null;
Expect(37);
InitializationRankList(
-#line 1535 "VBNET.ATG"
+#line 1538 "VBNET.ATG"
out arrayModifiers);
Expect(38);
}
void ArrayNameModifier(
-#line 2775 "VBNET.ATG"
+#line 2778 "VBNET.ATG"
out ArrayList arrayModifiers) {
-#line 2777 "VBNET.ATG"
+#line 2780 "VBNET.ATG"
arrayModifiers = null;
ArrayTypeModifiers(
-#line 2779 "VBNET.ATG"
+#line 2782 "VBNET.ATG"
out arrayModifiers);
}
void InitializationRankList(
-#line 1539 "VBNET.ATG"
+#line 1542 "VBNET.ATG"
out List rank) {
-#line 1541 "VBNET.ATG"
+#line 1544 "VBNET.ATG"
rank = new List();
Expression expr = null;
Expr(
-#line 1544 "VBNET.ATG"
+#line 1547 "VBNET.ATG"
out expr);
if (la.kind == 216) {
lexer.NextToken();
-#line 1545 "VBNET.ATG"
+#line 1548 "VBNET.ATG"
EnsureIsZero(expr);
Expr(
-#line 1546 "VBNET.ATG"
+#line 1549 "VBNET.ATG"
out expr);
}
-#line 1548 "VBNET.ATG"
+#line 1551 "VBNET.ATG"
if (expr != null) { rank.Add(expr); }
while (la.kind == 22) {
lexer.NextToken();
Expr(
-#line 1550 "VBNET.ATG"
+#line 1553 "VBNET.ATG"
out expr);
if (la.kind == 216) {
lexer.NextToken();
-#line 1551 "VBNET.ATG"
+#line 1554 "VBNET.ATG"
EnsureIsZero(expr);
Expr(
-#line 1552 "VBNET.ATG"
+#line 1555 "VBNET.ATG"
out expr);
}
-#line 1554 "VBNET.ATG"
+#line 1557 "VBNET.ATG"
if (expr != null) { rank.Add(expr); }
}
}
void CollectionInitializer(
-#line 1559 "VBNET.ATG"
+#line 1562 "VBNET.ATG"
out CollectionInitializerExpression outExpr) {
-#line 1561 "VBNET.ATG"
+#line 1564 "VBNET.ATG"
Expression expr = null;
CollectionInitializerExpression initializer = new CollectionInitializerExpression();
Location startLocation = la.Location;
@@ -3650,27 +3658,27 @@ out CollectionInitializerExpression outExpr) {
Expect(35);
if (StartOf(24)) {
Expr(
-#line 1567 "VBNET.ATG"
+#line 1570 "VBNET.ATG"
out expr);
-#line 1569 "VBNET.ATG"
+#line 1572 "VBNET.ATG"
if (expr != null) { initializer.CreateExpressions.Add(expr); }
while (
-#line 1572 "VBNET.ATG"
+#line 1575 "VBNET.ATG"
NotFinalComma()) {
Expect(22);
Expr(
-#line 1572 "VBNET.ATG"
+#line 1575 "VBNET.ATG"
out expr);
-#line 1573 "VBNET.ATG"
+#line 1576 "VBNET.ATG"
if (expr != null) { initializer.CreateExpressions.Add(expr); }
}
}
Expect(36);
-#line 1578 "VBNET.ATG"
+#line 1581 "VBNET.ATG"
outExpr = initializer;
outExpr.StartLocation = startLocation;
outExpr.EndLocation = t.EndLocation;
@@ -3678,10 +3686,10 @@ out expr);
}
void EventMemberSpecifier(
-#line 1651 "VBNET.ATG"
+#line 1654 "VBNET.ATG"
out string name) {
-#line 1652 "VBNET.ATG"
+#line 1655 "VBNET.ATG"
string eventName;
if (StartOf(4)) {
Identifier();
@@ -3691,182 +3699,182 @@ out string name) {
lexer.NextToken();
} else SynErr(275);
-#line 1655 "VBNET.ATG"
+#line 1658 "VBNET.ATG"
name = t.val;
Expect(26);
IdentifierOrKeyword(
-#line 1657 "VBNET.ATG"
+#line 1660 "VBNET.ATG"
out eventName);
-#line 1658 "VBNET.ATG"
+#line 1661 "VBNET.ATG"
name = name + "." + eventName;
}
void IdentifierOrKeyword(
-#line 3675 "VBNET.ATG"
+#line 3678 "VBNET.ATG"
out string name) {
lexer.NextToken();
-#line 3677 "VBNET.ATG"
+#line 3680 "VBNET.ATG"
name = t.val;
}
void QueryExpr(
-#line 2296 "VBNET.ATG"
+#line 2299 "VBNET.ATG"
out Expression expr) {
-#line 2298 "VBNET.ATG"
+#line 2301 "VBNET.ATG"
QueryExpressionVB qexpr = new QueryExpressionVB();
qexpr.StartLocation = la.Location;
expr = qexpr;
FromOrAggregateQueryOperator(
-#line 2302 "VBNET.ATG"
+#line 2305 "VBNET.ATG"
qexpr.Clauses);
while (StartOf(31)) {
QueryOperator(
-#line 2303 "VBNET.ATG"
+#line 2306 "VBNET.ATG"
qexpr.Clauses);
}
-#line 2305 "VBNET.ATG"
+#line 2308 "VBNET.ATG"
qexpr.EndLocation = t.EndLocation;
}
void LambdaExpr(
-#line 2210 "VBNET.ATG"
+#line 2213 "VBNET.ATG"
out Expression expr) {
-#line 2212 "VBNET.ATG"
+#line 2215 "VBNET.ATG"
LambdaExpression lambda = null;
if (la.kind == 210) {
SubLambdaExpression(
-#line 2214 "VBNET.ATG"
+#line 2217 "VBNET.ATG"
out lambda);
} else if (la.kind == 127) {
FunctionLambdaExpression(
-#line 2215 "VBNET.ATG"
+#line 2218 "VBNET.ATG"
out lambda);
} else SynErr(276);
-#line 2216 "VBNET.ATG"
+#line 2219 "VBNET.ATG"
expr = lambda;
}
void DisjunctionExpr(
-#line 1960 "VBNET.ATG"
+#line 1963 "VBNET.ATG"
out Expression outExpr) {
-#line 1962 "VBNET.ATG"
+#line 1965 "VBNET.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
Location startLocation = la.Location;
ConjunctionExpr(
-#line 1966 "VBNET.ATG"
+#line 1969 "VBNET.ATG"
out outExpr);
while (la.kind == 175 || la.kind == 177 || la.kind == 236) {
if (la.kind == 175) {
lexer.NextToken();
-#line 1969 "VBNET.ATG"
+#line 1972 "VBNET.ATG"
op = BinaryOperatorType.BitwiseOr;
} else if (la.kind == 177) {
lexer.NextToken();
-#line 1970 "VBNET.ATG"
+#line 1973 "VBNET.ATG"
op = BinaryOperatorType.LogicalOr;
} else {
lexer.NextToken();
-#line 1971 "VBNET.ATG"
+#line 1974 "VBNET.ATG"
op = BinaryOperatorType.ExclusiveOr;
}
ConjunctionExpr(
-#line 1973 "VBNET.ATG"
+#line 1976 "VBNET.ATG"
out expr);
-#line 1973 "VBNET.ATG"
+#line 1976 "VBNET.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
}
}
void AssignmentOperator(
-#line 1678 "VBNET.ATG"
+#line 1681 "VBNET.ATG"
out AssignmentOperatorType op) {
-#line 1679 "VBNET.ATG"
+#line 1682 "VBNET.ATG"
op = AssignmentOperatorType.None;
switch (la.kind) {
case 20: {
lexer.NextToken();
-#line 1680 "VBNET.ATG"
+#line 1683 "VBNET.ATG"
op = AssignmentOperatorType.Assign;
break;
}
case 54: {
lexer.NextToken();
-#line 1681 "VBNET.ATG"
+#line 1684 "VBNET.ATG"
op = AssignmentOperatorType.ConcatString;
break;
}
case 46: {
lexer.NextToken();
-#line 1682 "VBNET.ATG"
+#line 1685 "VBNET.ATG"
op = AssignmentOperatorType.Add;
break;
}
case 48: {
lexer.NextToken();
-#line 1683 "VBNET.ATG"
+#line 1686 "VBNET.ATG"
op = AssignmentOperatorType.Subtract;
break;
}
case 49: {
lexer.NextToken();
-#line 1684 "VBNET.ATG"
+#line 1687 "VBNET.ATG"
op = AssignmentOperatorType.Multiply;
break;
}
case 50: {
lexer.NextToken();
-#line 1685 "VBNET.ATG"
+#line 1688 "VBNET.ATG"
op = AssignmentOperatorType.Divide;
break;
}
case 51: {
lexer.NextToken();
-#line 1686 "VBNET.ATG"
+#line 1689 "VBNET.ATG"
op = AssignmentOperatorType.DivideInteger;
break;
}
case 47: {
lexer.NextToken();
-#line 1687 "VBNET.ATG"
+#line 1690 "VBNET.ATG"
op = AssignmentOperatorType.Power;
break;
}
case 52: {
lexer.NextToken();
-#line 1688 "VBNET.ATG"
+#line 1691 "VBNET.ATG"
op = AssignmentOperatorType.ShiftLeft;
break;
}
case 53: {
lexer.NextToken();
-#line 1689 "VBNET.ATG"
+#line 1692 "VBNET.ATG"
op = AssignmentOperatorType.ShiftRight;
break;
}
@@ -3875,13 +3883,13 @@ out AssignmentOperatorType op) {
}
void SimpleExpr(
-#line 1693 "VBNET.ATG"
+#line 1696 "VBNET.ATG"
out Expression pexpr) {
-#line 1694 "VBNET.ATG"
+#line 1697 "VBNET.ATG"
string name; Location startLocation = la.Location;
SimpleNonInvocationExpression(
-#line 1697 "VBNET.ATG"
+#line 1700 "VBNET.ATG"
out pexpr);
while (StartOf(32)) {
if (la.kind == 26) {
@@ -3889,73 +3897,73 @@ out pexpr);
if (la.kind == 10) {
lexer.NextToken();
IdentifierOrKeyword(
-#line 1700 "VBNET.ATG"
+#line 1703 "VBNET.ATG"
out name);
Expect(11);
-#line 1701 "VBNET.ATG"
+#line 1704 "VBNET.ATG"
pexpr = new XmlMemberAccessExpression(pexpr, XmlAxisType.Element, name, true);
} else if (StartOf(33)) {
IdentifierOrKeyword(
-#line 1702 "VBNET.ATG"
+#line 1705 "VBNET.ATG"
out name);
-#line 1703 "VBNET.ATG"
+#line 1706 "VBNET.ATG"
pexpr = new MemberReferenceExpression(pexpr, name) { StartLocation = startLocation, EndLocation = t.EndLocation };
} else SynErr(278);
if (
-#line 1705 "VBNET.ATG"
+#line 1708 "VBNET.ATG"
la.kind == Tokens.OpenParenthesis && Peek(1).kind == Tokens.Of) {
lexer.NextToken();
Expect(169);
TypeArgumentList(
-#line 1706 "VBNET.ATG"
+#line 1709 "VBNET.ATG"
((MemberReferenceExpression)pexpr).TypeArguments);
Expect(38);
}
} else if (la.kind == 29) {
lexer.NextToken();
IdentifierOrKeyword(
-#line 1708 "VBNET.ATG"
+#line 1711 "VBNET.ATG"
out name);
-#line 1708 "VBNET.ATG"
+#line 1711 "VBNET.ATG"
pexpr = new BinaryOperatorExpression(pexpr, BinaryOperatorType.DictionaryAccess, new PrimitiveExpression(name, name) { StartLocation = t.Location, EndLocation = t.EndLocation });
} else if (la.kind == 27 || la.kind == 28) {
-#line 1709 "VBNET.ATG"
+#line 1712 "VBNET.ATG"
XmlAxisType type = XmlAxisType.Attribute; bool isXmlName = false;
if (la.kind == 28) {
lexer.NextToken();
} else if (la.kind == 27) {
lexer.NextToken();
-#line 1710 "VBNET.ATG"
+#line 1713 "VBNET.ATG"
type = XmlAxisType.Descendents;
} else SynErr(279);
if (la.kind == 10) {
lexer.NextToken();
-#line 1710 "VBNET.ATG"
+#line 1713 "VBNET.ATG"
isXmlName = true;
}
IdentifierOrKeyword(
-#line 1710 "VBNET.ATG"
+#line 1713 "VBNET.ATG"
out name);
if (la.kind == 11) {
lexer.NextToken();
}
-#line 1711 "VBNET.ATG"
+#line 1714 "VBNET.ATG"
pexpr = new XmlMemberAccessExpression(pexpr, type, name, isXmlName);
} else {
InvocationExpression(
-#line 1712 "VBNET.ATG"
+#line 1715 "VBNET.ATG"
ref pexpr);
}
}
-#line 1716 "VBNET.ATG"
+#line 1719 "VBNET.ATG"
if (pexpr != null) {
pexpr.StartLocation = startLocation;
pexpr.EndLocation = t.EndLocation;
@@ -3964,10 +3972,10 @@ ref pexpr);
}
void SimpleNonInvocationExpression(
-#line 1723 "VBNET.ATG"
+#line 1726 "VBNET.ATG"
out Expression pexpr) {
-#line 1725 "VBNET.ATG"
+#line 1728 "VBNET.ATG"
Expression expr;
CollectionInitializerExpression cie;
TypeReference type = null;
@@ -3980,98 +3988,98 @@ out Expression pexpr) {
case 3: {
lexer.NextToken();
-#line 1735 "VBNET.ATG"
+#line 1738 "VBNET.ATG"
pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat };
break;
}
case 4: {
lexer.NextToken();
-#line 1736 "VBNET.ATG"
+#line 1739 "VBNET.ATG"
pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat };
break;
}
case 7: {
lexer.NextToken();
-#line 1737 "VBNET.ATG"
+#line 1740 "VBNET.ATG"
pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat };
break;
}
case 6: {
lexer.NextToken();
-#line 1738 "VBNET.ATG"
+#line 1741 "VBNET.ATG"
pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat };
break;
}
case 5: {
lexer.NextToken();
-#line 1739 "VBNET.ATG"
+#line 1742 "VBNET.ATG"
pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat };
break;
}
case 9: {
lexer.NextToken();
-#line 1740 "VBNET.ATG"
+#line 1743 "VBNET.ATG"
pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat };
break;
}
case 8: {
lexer.NextToken();
-#line 1741 "VBNET.ATG"
+#line 1744 "VBNET.ATG"
pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat };
break;
}
case 217: {
lexer.NextToken();
-#line 1743 "VBNET.ATG"
+#line 1746 "VBNET.ATG"
pexpr = new PrimitiveExpression(true, "true");
break;
}
case 122: {
lexer.NextToken();
-#line 1744 "VBNET.ATG"
+#line 1747 "VBNET.ATG"
pexpr = new PrimitiveExpression(false, "false");
break;
}
case 165: {
lexer.NextToken();
-#line 1745 "VBNET.ATG"
+#line 1748 "VBNET.ATG"
pexpr = new PrimitiveExpression(null, "null");
break;
}
case 37: {
lexer.NextToken();
Expr(
-#line 1746 "VBNET.ATG"
+#line 1749 "VBNET.ATG"
out expr);
Expect(38);
-#line 1746 "VBNET.ATG"
+#line 1749 "VBNET.ATG"
pexpr = new ParenthesizedExpression(expr);
break;
}
case 2: case 58: case 62: case 64: case 65: case 66: case 67: case 70: case 87: case 98: case 104: case 107: case 116: case 121: case 126: case 133: case 139: case 143: case 146: case 147: case 170: case 176: case 178: case 184: case 203: case 212: case 213: case 223: case 224: case 230: {
Identifier();
-#line 1748 "VBNET.ATG"
+#line 1751 "VBNET.ATG"
pexpr = new IdentifierExpression(t.val);
pexpr.StartLocation = t.Location; pexpr.EndLocation = t.EndLocation;
if (
-#line 1751 "VBNET.ATG"
+#line 1754 "VBNET.ATG"
la.kind == Tokens.OpenParenthesis && Peek(1).kind == Tokens.Of) {
lexer.NextToken();
Expect(169);
TypeArgumentList(
-#line 1752 "VBNET.ATG"
+#line 1755 "VBNET.ATG"
((IdentifierExpression)pexpr).TypeArguments);
Expect(38);
}
@@ -4079,51 +4087,51 @@ la.kind == Tokens.OpenParenthesis && Peek(1).kind == Tokens.Of) {
}
case 68: case 71: case 82: case 99: case 100: case 109: case 141: case 151: case 168: case 196: case 201: case 202: case 208: case 221: case 222: case 225: {
-#line 1754 "VBNET.ATG"
+#line 1757 "VBNET.ATG"
string val = String.Empty;
if (StartOf(12)) {
PrimitiveTypeName(
-#line 1755 "VBNET.ATG"
+#line 1758 "VBNET.ATG"
out val);
} else if (la.kind == 168) {
lexer.NextToken();
-#line 1755 "VBNET.ATG"
+#line 1758 "VBNET.ATG"
val = "System.Object";
} else SynErr(280);
-#line 1756 "VBNET.ATG"
+#line 1759 "VBNET.ATG"
pexpr = new TypeReferenceExpression(new TypeReference(val, true));
break;
}
case 153: {
lexer.NextToken();
-#line 1757 "VBNET.ATG"
+#line 1760 "VBNET.ATG"
pexpr = new ThisReferenceExpression();
break;
}
case 158: case 159: {
-#line 1758 "VBNET.ATG"
+#line 1761 "VBNET.ATG"
Expression retExpr = null;
if (la.kind == 158) {
lexer.NextToken();
-#line 1759 "VBNET.ATG"
+#line 1762 "VBNET.ATG"
retExpr = new BaseReferenceExpression() { StartLocation = t.Location, EndLocation = t.EndLocation };
} else if (la.kind == 159) {
lexer.NextToken();
-#line 1760 "VBNET.ATG"
+#line 1763 "VBNET.ATG"
retExpr = new ClassReferenceExpression() { StartLocation = t.Location, EndLocation = t.EndLocation };
} else SynErr(281);
Expect(26);
IdentifierOrKeyword(
-#line 1762 "VBNET.ATG"
+#line 1765 "VBNET.ATG"
out name);
-#line 1762 "VBNET.ATG"
+#line 1765 "VBNET.ATG"
pexpr = new MemberReferenceExpression(retExpr, name) { StartLocation = startLocation, EndLocation = t.EndLocation };
break;
}
@@ -4132,86 +4140,86 @@ out name);
Expect(26);
Identifier();
-#line 1764 "VBNET.ATG"
+#line 1767 "VBNET.ATG"
type = new TypeReference(t.val ?? "");
-#line 1766 "VBNET.ATG"
+#line 1769 "VBNET.ATG"
type.IsGlobal = true;
-#line 1767 "VBNET.ATG"
+#line 1770 "VBNET.ATG"
pexpr = new TypeReferenceExpression(type);
break;
}
case 162: {
ObjectCreateExpression(
-#line 1768 "VBNET.ATG"
+#line 1771 "VBNET.ATG"
out expr);
-#line 1768 "VBNET.ATG"
+#line 1771 "VBNET.ATG"
pexpr = expr;
break;
}
case 35: {
CollectionInitializer(
-#line 1769 "VBNET.ATG"
+#line 1772 "VBNET.ATG"
out cie);
-#line 1769 "VBNET.ATG"
+#line 1772 "VBNET.ATG"
pexpr = cie;
break;
}
case 94: case 106: case 219: {
-#line 1771 "VBNET.ATG"
+#line 1774 "VBNET.ATG"
CastType castType = CastType.Cast;
if (la.kind == 106) {
lexer.NextToken();
} else if (la.kind == 94) {
lexer.NextToken();
-#line 1773 "VBNET.ATG"
+#line 1776 "VBNET.ATG"
castType = CastType.Conversion;
} else if (la.kind == 219) {
lexer.NextToken();
-#line 1774 "VBNET.ATG"
+#line 1777 "VBNET.ATG"
castType = CastType.TryCast;
} else SynErr(282);
Expect(37);
Expr(
-#line 1776 "VBNET.ATG"
+#line 1779 "VBNET.ATG"
out expr);
Expect(22);
TypeName(
-#line 1776 "VBNET.ATG"
+#line 1779 "VBNET.ATG"
out type);
Expect(38);
-#line 1777 "VBNET.ATG"
+#line 1780 "VBNET.ATG"
pexpr = new CastExpression(type, expr, castType);
break;
}
case 76: case 77: case 78: case 79: case 80: case 81: case 83: case 85: case 86: case 90: case 91: case 92: case 93: case 95: case 96: case 97: {
CastTarget(
-#line 1778 "VBNET.ATG"
+#line 1781 "VBNET.ATG"
out type);
Expect(37);
Expr(
-#line 1778 "VBNET.ATG"
+#line 1781 "VBNET.ATG"
out expr);
Expect(38);
-#line 1778 "VBNET.ATG"
+#line 1781 "VBNET.ATG"
pexpr = new CastExpression(type, expr, CastType.PrimitiveConversion);
break;
}
case 57: {
lexer.NextToken();
Expr(
-#line 1779 "VBNET.ATG"
+#line 1782 "VBNET.ATG"
out expr);
-#line 1779 "VBNET.ATG"
+#line 1782 "VBNET.ATG"
pexpr = new AddressOfExpression(expr);
break;
}
@@ -4219,37 +4227,37 @@ out expr);
lexer.NextToken();
Expect(37);
GetTypeTypeName(
-#line 1780 "VBNET.ATG"
+#line 1783 "VBNET.ATG"
out type);
Expect(38);
-#line 1780 "VBNET.ATG"
+#line 1783 "VBNET.ATG"
pexpr = new TypeOfExpression(type);
break;
}
case 220: {
lexer.NextToken();
SimpleExpr(
-#line 1781 "VBNET.ATG"
+#line 1784 "VBNET.ATG"
out expr);
Expect(144);
TypeName(
-#line 1781 "VBNET.ATG"
+#line 1784 "VBNET.ATG"
out type);
-#line 1781 "VBNET.ATG"
+#line 1784 "VBNET.ATG"
pexpr = new TypeOfIsExpression(expr, type);
break;
}
case 135: {
ConditionalExpression(
-#line 1782 "VBNET.ATG"
+#line 1785 "VBNET.ATG"
out pexpr);
break;
}
case 10: case 16: case 17: case 18: case 19: {
XmlLiteralExpression(
-#line 1783 "VBNET.ATG"
+#line 1786 "VBNET.ATG"
out pexpr);
break;
}
@@ -4260,62 +4268,62 @@ out pexpr);
if (la.kind == 10) {
lexer.NextToken();
IdentifierOrKeyword(
-#line 1789 "VBNET.ATG"
+#line 1792 "VBNET.ATG"
out name);
Expect(11);
-#line 1790 "VBNET.ATG"
+#line 1793 "VBNET.ATG"
pexpr = new XmlMemberAccessExpression(null, XmlAxisType.Element, name, true) { StartLocation = startLocation, EndLocation = t.EndLocation };
} else if (StartOf(33)) {
IdentifierOrKeyword(
-#line 1791 "VBNET.ATG"
+#line 1794 "VBNET.ATG"
out name);
-#line 1792 "VBNET.ATG"
+#line 1795 "VBNET.ATG"
pexpr = new MemberReferenceExpression(null, name) { StartLocation = startLocation, EndLocation = t.EndLocation };
} else SynErr(283);
} else if (la.kind == 29) {
lexer.NextToken();
IdentifierOrKeyword(
-#line 1794 "VBNET.ATG"
+#line 1797 "VBNET.ATG"
out name);
-#line 1794 "VBNET.ATG"
+#line 1797 "VBNET.ATG"
pexpr = new BinaryOperatorExpression(null, BinaryOperatorType.DictionaryAccess, new PrimitiveExpression(name, name) { StartLocation = t.Location, EndLocation = t.EndLocation });
} else {
-#line 1795 "VBNET.ATG"
+#line 1798 "VBNET.ATG"
XmlAxisType axisType = XmlAxisType.Element; bool isXmlIdentifier = false;
if (la.kind == 27) {
lexer.NextToken();
-#line 1796 "VBNET.ATG"
+#line 1799 "VBNET.ATG"
axisType = XmlAxisType.Descendents;
} else if (la.kind == 28) {
lexer.NextToken();
-#line 1796 "VBNET.ATG"
+#line 1799 "VBNET.ATG"
axisType = XmlAxisType.Attribute;
} else SynErr(284);
if (la.kind == 10) {
lexer.NextToken();
-#line 1797 "VBNET.ATG"
+#line 1800 "VBNET.ATG"
isXmlIdentifier = true;
}
IdentifierOrKeyword(
-#line 1797 "VBNET.ATG"
+#line 1800 "VBNET.ATG"
out name);
if (la.kind == 11) {
lexer.NextToken();
}
-#line 1798 "VBNET.ATG"
+#line 1801 "VBNET.ATG"
pexpr = new XmlMemberAccessExpression(null, axisType, name, isXmlIdentifier);
}
} else SynErr(285);
-#line 1803 "VBNET.ATG"
+#line 1806 "VBNET.ATG"
if (pexpr != null) {
pexpr.StartLocation = startLocation;
pexpr.EndLocation = t.EndLocation;
@@ -4324,161 +4332,161 @@ out name);
}
void TypeArgumentList(
-#line 2811 "VBNET.ATG"
+#line 2814 "VBNET.ATG"
List typeArguments) {
-#line 2813 "VBNET.ATG"
+#line 2816 "VBNET.ATG"
TypeReference typeref;
TypeName(
-#line 2815 "VBNET.ATG"
+#line 2818 "VBNET.ATG"
out typeref);
-#line 2815 "VBNET.ATG"
+#line 2818 "VBNET.ATG"
if (typeref != null) typeArguments.Add(typeref);
while (la.kind == 22) {
lexer.NextToken();
TypeName(
-#line 2818 "VBNET.ATG"
+#line 2821 "VBNET.ATG"
out typeref);
-#line 2818 "VBNET.ATG"
+#line 2821 "VBNET.ATG"
if (typeref != null) typeArguments.Add(typeref);
}
}
void InvocationExpression(
-#line 1924 "VBNET.ATG"
+#line 1927 "VBNET.ATG"
ref Expression pexpr) {
-#line 1925 "VBNET.ATG"
+#line 1928 "VBNET.ATG"
List parameters = null;
Expect(37);
-#line 1927 "VBNET.ATG"
+#line 1930 "VBNET.ATG"
Location start = t.Location;
ArgumentList(
-#line 1928 "VBNET.ATG"
+#line 1931 "VBNET.ATG"
out parameters);
Expect(38);
-#line 1931 "VBNET.ATG"
+#line 1934 "VBNET.ATG"
pexpr = new InvocationExpression(pexpr, parameters);
-#line 1933 "VBNET.ATG"
+#line 1936 "VBNET.ATG"
pexpr.StartLocation = start; pexpr.EndLocation = t.Location;
}
void PrimitiveTypeName(
-#line 3682 "VBNET.ATG"
+#line 3685 "VBNET.ATG"
out string type) {
-#line 3683 "VBNET.ATG"
+#line 3686 "VBNET.ATG"
type = String.Empty;
switch (la.kind) {
case 68: {
lexer.NextToken();
-#line 3684 "VBNET.ATG"
+#line 3687 "VBNET.ATG"
type = "System.Boolean";
break;
}
case 99: {
lexer.NextToken();
-#line 3685 "VBNET.ATG"
+#line 3688 "VBNET.ATG"
type = "System.DateTime";
break;
}
case 82: {
lexer.NextToken();
-#line 3686 "VBNET.ATG"
+#line 3689 "VBNET.ATG"
type = "System.Char";
break;
}
case 208: {
lexer.NextToken();
-#line 3687 "VBNET.ATG"
+#line 3690 "VBNET.ATG"
type = "System.String";
break;
}
case 100: {
lexer.NextToken();
-#line 3688 "VBNET.ATG"
+#line 3691 "VBNET.ATG"
type = "System.Decimal";
break;
}
case 71: {
lexer.NextToken();
-#line 3689 "VBNET.ATG"
+#line 3692 "VBNET.ATG"
type = "System.Byte";
break;
}
case 201: {
lexer.NextToken();
-#line 3690 "VBNET.ATG"
+#line 3693 "VBNET.ATG"
type = "System.Int16";
break;
}
case 141: {
lexer.NextToken();
-#line 3691 "VBNET.ATG"
+#line 3694 "VBNET.ATG"
type = "System.Int32";
break;
}
case 151: {
lexer.NextToken();
-#line 3692 "VBNET.ATG"
+#line 3695 "VBNET.ATG"
type = "System.Int64";
break;
}
case 202: {
lexer.NextToken();
-#line 3693 "VBNET.ATG"
+#line 3696 "VBNET.ATG"
type = "System.Single";
break;
}
case 109: {
lexer.NextToken();
-#line 3694 "VBNET.ATG"
+#line 3697 "VBNET.ATG"
type = "System.Double";
break;
}
case 221: {
lexer.NextToken();
-#line 3695 "VBNET.ATG"
+#line 3698 "VBNET.ATG"
type = "System.UInt32";
break;
}
case 222: {
lexer.NextToken();
-#line 3696 "VBNET.ATG"
+#line 3699 "VBNET.ATG"
type = "System.UInt64";
break;
}
case 225: {
lexer.NextToken();
-#line 3697 "VBNET.ATG"
+#line 3700 "VBNET.ATG"
type = "System.UInt16";
break;
}
case 196: {
lexer.NextToken();
-#line 3698 "VBNET.ATG"
+#line 3701 "VBNET.ATG"
type = "System.SByte";
break;
}
@@ -4487,122 +4495,122 @@ out string type) {
}
void CastTarget(
-#line 1938 "VBNET.ATG"
+#line 1941 "VBNET.ATG"
out TypeReference type) {
-#line 1940 "VBNET.ATG"
+#line 1943 "VBNET.ATG"
type = null;
switch (la.kind) {
case 76: {
lexer.NextToken();
-#line 1942 "VBNET.ATG"
+#line 1945 "VBNET.ATG"
type = new TypeReference("System.Boolean", true);
break;
}
case 77: {
lexer.NextToken();
-#line 1943 "VBNET.ATG"
+#line 1946 "VBNET.ATG"
type = new TypeReference("System.Byte", true);
break;
}
case 90: {
lexer.NextToken();
-#line 1944 "VBNET.ATG"
+#line 1947 "VBNET.ATG"
type = new TypeReference("System.SByte", true);
break;
}
case 78: {
lexer.NextToken();
-#line 1945 "VBNET.ATG"
+#line 1948 "VBNET.ATG"
type = new TypeReference("System.Char", true);
break;
}
case 79: {
lexer.NextToken();
-#line 1946 "VBNET.ATG"
+#line 1949 "VBNET.ATG"
type = new TypeReference("System.DateTime", true);
break;
}
case 81: {
lexer.NextToken();
-#line 1947 "VBNET.ATG"
+#line 1950 "VBNET.ATG"
type = new TypeReference("System.Decimal", true);
break;
}
case 80: {
lexer.NextToken();
-#line 1948 "VBNET.ATG"
+#line 1951 "VBNET.ATG"
type = new TypeReference("System.Double", true);
break;
}
case 91: {
lexer.NextToken();
-#line 1949 "VBNET.ATG"
+#line 1952 "VBNET.ATG"
type = new TypeReference("System.Int16", true);
break;
}
case 83: {
lexer.NextToken();
-#line 1950 "VBNET.ATG"
+#line 1953 "VBNET.ATG"
type = new TypeReference("System.Int32", true);
break;
}
case 85: {
lexer.NextToken();
-#line 1951 "VBNET.ATG"
+#line 1954 "VBNET.ATG"
type = new TypeReference("System.Int64", true);
break;
}
case 97: {
lexer.NextToken();
-#line 1952 "VBNET.ATG"
+#line 1955 "VBNET.ATG"
type = new TypeReference("System.UInt16", true);
break;
}
case 95: {
lexer.NextToken();
-#line 1953 "VBNET.ATG"
+#line 1956 "VBNET.ATG"
type = new TypeReference("System.UInt32", true);
break;
}
case 96: {
lexer.NextToken();
-#line 1954 "VBNET.ATG"
+#line 1957 "VBNET.ATG"
type = new TypeReference("System.UInt64", true);
break;
}
case 86: {
lexer.NextToken();
-#line 1955 "VBNET.ATG"
+#line 1958 "VBNET.ATG"
type = new TypeReference("System.Object", true);
break;
}
case 92: {
lexer.NextToken();
-#line 1956 "VBNET.ATG"
+#line 1959 "VBNET.ATG"
type = new TypeReference("System.Single", true);
break;
}
case 93: {
lexer.NextToken();
-#line 1957 "VBNET.ATG"
+#line 1960 "VBNET.ATG"
type = new TypeReference("System.String", true);
break;
}
@@ -4611,19 +4619,19 @@ out TypeReference type) {
}
void GetTypeTypeName(
-#line 2710 "VBNET.ATG"
+#line 2713 "VBNET.ATG"
out TypeReference typeref) {
-#line 2711 "VBNET.ATG"
+#line 2714 "VBNET.ATG"
ArrayList rank = null;
NonArrayTypeName(
-#line 2713 "VBNET.ATG"
+#line 2716 "VBNET.ATG"
out typeref, true);
ArrayTypeModifiers(
-#line 2714 "VBNET.ATG"
+#line 2717 "VBNET.ATG"
out rank);
-#line 2715 "VBNET.ATG"
+#line 2718 "VBNET.ATG"
if (rank != null && typeref != null) {
typeref.RankSpecifier = (int[])rank.ToArray(typeof(int));
}
@@ -4631,10 +4639,10 @@ out rank);
}
void ConditionalExpression(
-#line 1890 "VBNET.ATG"
+#line 1893 "VBNET.ATG"
out Expression expr) {
-#line 1892 "VBNET.ATG"
+#line 1895 "VBNET.ATG"
ConditionalExpression conditionalExpression = new ConditionalExpression();
BinaryOperatorExpression binaryOperatorExpression = new BinaryOperatorExpression();
conditionalExpression.StartLocation = binaryOperatorExpression.StartLocation = la.Location;
@@ -4646,21 +4654,21 @@ out Expression expr) {
Expect(135);
Expect(37);
Expr(
-#line 1901 "VBNET.ATG"
+#line 1904 "VBNET.ATG"
out condition);
Expect(22);
Expr(
-#line 1901 "VBNET.ATG"
+#line 1904 "VBNET.ATG"
out trueExpr);
if (la.kind == 22) {
lexer.NextToken();
Expr(
-#line 1901 "VBNET.ATG"
+#line 1904 "VBNET.ATG"
out falseExpr);
}
Expect(38);
-#line 1903 "VBNET.ATG"
+#line 1906 "VBNET.ATG"
if(falseExpr != null)
{
conditionalExpression.Condition = condition;
@@ -4683,50 +4691,50 @@ out falseExpr);
}
void XmlLiteralExpression(
-#line 1810 "VBNET.ATG"
+#line 1813 "VBNET.ATG"
out Expression pexpr) {
-#line 1812 "VBNET.ATG"
+#line 1815 "VBNET.ATG"
List exprs = new List();
XmlExpression currentExpression = null;
if (StartOf(36)) {
XmlContentExpression(
-#line 1817 "VBNET.ATG"
+#line 1820 "VBNET.ATG"
exprs);
while (StartOf(36)) {
XmlContentExpression(
-#line 1817 "VBNET.ATG"
+#line 1820 "VBNET.ATG"
exprs);
}
if (la.kind == 10) {
XmlElement(
-#line 1817 "VBNET.ATG"
+#line 1820 "VBNET.ATG"
out currentExpression);
-#line 1817 "VBNET.ATG"
+#line 1820 "VBNET.ATG"
exprs.Add(currentExpression);
while (StartOf(36)) {
XmlContentExpression(
-#line 1817 "VBNET.ATG"
+#line 1820 "VBNET.ATG"
exprs);
}
}
} else if (la.kind == 10) {
XmlElement(
-#line 1819 "VBNET.ATG"
+#line 1822 "VBNET.ATG"
out currentExpression);
-#line 1819 "VBNET.ATG"
+#line 1822 "VBNET.ATG"
exprs.Add(currentExpression);
while (StartOf(36)) {
XmlContentExpression(
-#line 1819 "VBNET.ATG"
+#line 1822 "VBNET.ATG"
exprs);
}
} else SynErr(288);
-#line 1822 "VBNET.ATG"
+#line 1825 "VBNET.ATG"
if (exprs.Count > 1) {
pexpr = new XmlDocumentExpression() { Expressions = exprs };
} else {
@@ -4736,34 +4744,34 @@ exprs);
}
void XmlContentExpression(
-#line 1830 "VBNET.ATG"
+#line 1833 "VBNET.ATG"
List exprs) {
-#line 1831 "VBNET.ATG"
+#line 1834 "VBNET.ATG"
XmlContentExpression expr = null;
if (la.kind == 16) {
lexer.NextToken();
-#line 1833 "VBNET.ATG"
+#line 1836 "VBNET.ATG"
expr = new XmlContentExpression(t.val, XmlContentType.Text);
} else if (la.kind == 18) {
lexer.NextToken();
-#line 1834 "VBNET.ATG"
+#line 1837 "VBNET.ATG"
expr = new XmlContentExpression(t.val, XmlContentType.CData);
} else if (la.kind == 17) {
lexer.NextToken();
-#line 1835 "VBNET.ATG"
+#line 1838 "VBNET.ATG"
expr = new XmlContentExpression(t.val, XmlContentType.Comment);
} else if (la.kind == 19) {
lexer.NextToken();
-#line 1836 "VBNET.ATG"
+#line 1839 "VBNET.ATG"
expr = new XmlContentExpression(t.val, XmlContentType.ProcessingInstruction);
} else SynErr(289);
-#line 1839 "VBNET.ATG"
+#line 1842 "VBNET.ATG"
expr.StartLocation = t.Location;
expr.EndLocation = t.EndLocation;
exprs.Add(expr);
@@ -4771,54 +4779,54 @@ List exprs) {
}
void XmlElement(
-#line 1865 "VBNET.ATG"
+#line 1868 "VBNET.ATG"
out XmlExpression expr) {
-#line 1866 "VBNET.ATG"
+#line 1869 "VBNET.ATG"
XmlElementExpression el = new XmlElementExpression();
Expect(10);
-#line 1869 "VBNET.ATG"
+#line 1872 "VBNET.ATG"
el.StartLocation = t.Location;
if (la.kind == 12) {
lexer.NextToken();
-#line 1870 "VBNET.ATG"
+#line 1873 "VBNET.ATG"
Expression innerExpression;
Expr(
-#line 1870 "VBNET.ATG"
+#line 1873 "VBNET.ATG"
out innerExpression);
Expect(13);
-#line 1871 "VBNET.ATG"
+#line 1874 "VBNET.ATG"
el.NameExpression = new XmlEmbeddedExpression() { InlineVBExpression = innerExpression };
} else if (StartOf(4)) {
Identifier();
-#line 1872 "VBNET.ATG"
+#line 1875 "VBNET.ATG"
el.XmlName = t.val;
} else SynErr(290);
while (StartOf(37)) {
XmlAttribute(
-#line 1872 "VBNET.ATG"
+#line 1875 "VBNET.ATG"
el.Attributes);
}
if (la.kind == 14) {
lexer.NextToken();
-#line 1873 "VBNET.ATG"
+#line 1876 "VBNET.ATG"
el.EndLocation = t.EndLocation;
} else if (la.kind == 11) {
lexer.NextToken();
while (StartOf(38)) {
-#line 1873 "VBNET.ATG"
+#line 1876 "VBNET.ATG"
XmlExpression child;
XmlNestedContent(
-#line 1873 "VBNET.ATG"
+#line 1876 "VBNET.ATG"
out child);
-#line 1873 "VBNET.ATG"
+#line 1876 "VBNET.ATG"
el.Children.Add(child);
}
Expect(15);
@@ -4827,73 +4835,73 @@ out child);
}
Expect(11);
-#line 1873 "VBNET.ATG"
+#line 1876 "VBNET.ATG"
el.EndLocation = t.EndLocation;
} else SynErr(291);
-#line 1875 "VBNET.ATG"
+#line 1878 "VBNET.ATG"
expr = el;
}
void XmlNestedContent(
-#line 1845 "VBNET.ATG"
+#line 1848 "VBNET.ATG"
out XmlExpression expr) {
-#line 1846 "VBNET.ATG"
+#line 1849 "VBNET.ATG"
XmlExpression tmpExpr = null; Location start = la.Location;
switch (la.kind) {
case 16: {
lexer.NextToken();
-#line 1849 "VBNET.ATG"
+#line 1852 "VBNET.ATG"
tmpExpr = new XmlContentExpression(t.val, XmlContentType.Text);
break;
}
case 18: {
lexer.NextToken();
-#line 1850 "VBNET.ATG"
+#line 1853 "VBNET.ATG"
tmpExpr = new XmlContentExpression(t.val, XmlContentType.CData);
break;
}
case 17: {
lexer.NextToken();
-#line 1851 "VBNET.ATG"
+#line 1854 "VBNET.ATG"
tmpExpr = new XmlContentExpression(t.val, XmlContentType.Comment);
break;
}
case 19: {
lexer.NextToken();
-#line 1852 "VBNET.ATG"
+#line 1855 "VBNET.ATG"
tmpExpr = new XmlContentExpression(t.val, XmlContentType.ProcessingInstruction);
break;
}
case 12: {
lexer.NextToken();
-#line 1853 "VBNET.ATG"
+#line 1856 "VBNET.ATG"
Expression innerExpression;
Expr(
-#line 1853 "VBNET.ATG"
+#line 1856 "VBNET.ATG"
out innerExpression);
Expect(13);
-#line 1853 "VBNET.ATG"
+#line 1856 "VBNET.ATG"
tmpExpr = new XmlEmbeddedExpression() { InlineVBExpression = innerExpression };
break;
}
case 10: {
XmlElement(
-#line 1854 "VBNET.ATG"
+#line 1857 "VBNET.ATG"
out tmpExpr);
break;
}
default: SynErr(292); break;
}
-#line 1857 "VBNET.ATG"
+#line 1860 "VBNET.ATG"
if (tmpExpr.StartLocation.IsEmpty)
tmpExpr.StartLocation = start;
if (tmpExpr.EndLocation.IsEmpty)
@@ -4903,401 +4911,401 @@ out tmpExpr);
}
void XmlAttribute(
-#line 1878 "VBNET.ATG"
+#line 1881 "VBNET.ATG"
List attrs) {
-#line 1879 "VBNET.ATG"
+#line 1882 "VBNET.ATG"
Location start = la.Location;
if (StartOf(4)) {
Identifier();
-#line 1881 "VBNET.ATG"
+#line 1884 "VBNET.ATG"
string name = t.val;
Expect(20);
-#line 1882 "VBNET.ATG"
+#line 1885 "VBNET.ATG"
string literalValue = null; Expression expressionValue = null; bool useDoubleQuotes = false;
if (la.kind == 3) {
lexer.NextToken();
-#line 1883 "VBNET.ATG"
+#line 1886 "VBNET.ATG"
literalValue = t.literalValue.ToString(); useDoubleQuotes = t.val[0] == '"';
} else if (la.kind == 12) {
lexer.NextToken();
Expr(
-#line 1883 "VBNET.ATG"
+#line 1886 "VBNET.ATG"
out expressionValue);
Expect(13);
} else SynErr(293);
-#line 1884 "VBNET.ATG"
+#line 1887 "VBNET.ATG"
attrs.Add(new XmlAttributeExpression() { Name = name, ExpressionValue = expressionValue, LiteralValue = literalValue, UseDoubleQuotes = useDoubleQuotes, StartLocation = start, EndLocation = t.EndLocation });
} else if (la.kind == 12) {
lexer.NextToken();
-#line 1886 "VBNET.ATG"
+#line 1889 "VBNET.ATG"
Expression innerExpression;
Expr(
-#line 1886 "VBNET.ATG"
+#line 1889 "VBNET.ATG"
out innerExpression);
Expect(13);
-#line 1887 "VBNET.ATG"
+#line 1890 "VBNET.ATG"
attrs.Add(new XmlEmbeddedExpression() { InlineVBExpression = innerExpression, StartLocation = start, EndLocation = t.EndLocation });
} else SynErr(294);
}
void ArgumentList(
-#line 2639 "VBNET.ATG"
+#line 2642 "VBNET.ATG"
out List arguments) {
-#line 2641 "VBNET.ATG"
+#line 2644 "VBNET.ATG"
arguments = new List();
Expression expr = null;
if (StartOf(24)) {
Argument(
-#line 2644 "VBNET.ATG"
+#line 2647 "VBNET.ATG"
out expr);
}
while (la.kind == 22) {
lexer.NextToken();
-#line 2645 "VBNET.ATG"
+#line 2648 "VBNET.ATG"
arguments.Add(expr ?? Expression.Null); expr = null;
if (StartOf(24)) {
Argument(
-#line 2646 "VBNET.ATG"
+#line 2649 "VBNET.ATG"
out expr);
}
-#line 2647 "VBNET.ATG"
+#line 2650 "VBNET.ATG"
if (expr == null) expr = Expression.Null;
}
-#line 2649 "VBNET.ATG"
+#line 2652 "VBNET.ATG"
if (expr != null) arguments.Add(expr);
}
void ConjunctionExpr(
-#line 1977 "VBNET.ATG"
+#line 1980 "VBNET.ATG"
out Expression outExpr) {
-#line 1979 "VBNET.ATG"
+#line 1982 "VBNET.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
Location startLocation = la.Location;
NotExpr(
-#line 1983 "VBNET.ATG"
+#line 1986 "VBNET.ATG"
out outExpr);
while (la.kind == 60 || la.kind == 61) {
if (la.kind == 60) {
lexer.NextToken();
-#line 1986 "VBNET.ATG"
+#line 1989 "VBNET.ATG"
op = BinaryOperatorType.BitwiseAnd;
} else {
lexer.NextToken();
-#line 1987 "VBNET.ATG"
+#line 1990 "VBNET.ATG"
op = BinaryOperatorType.LogicalAnd;
}
NotExpr(
-#line 1989 "VBNET.ATG"
+#line 1992 "VBNET.ATG"
out expr);
-#line 1989 "VBNET.ATG"
+#line 1992 "VBNET.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
}
}
void NotExpr(
-#line 1993 "VBNET.ATG"
+#line 1996 "VBNET.ATG"
out Expression outExpr) {
-#line 1994 "VBNET.ATG"
+#line 1997 "VBNET.ATG"
UnaryOperatorType uop = UnaryOperatorType.None;
while (la.kind == 164) {
lexer.NextToken();
-#line 1995 "VBNET.ATG"
+#line 1998 "VBNET.ATG"
uop = UnaryOperatorType.Not;
}
ComparisonExpr(
-#line 1996 "VBNET.ATG"
+#line 1999 "VBNET.ATG"
out outExpr);
-#line 1997 "VBNET.ATG"
+#line 2000 "VBNET.ATG"
if (uop != UnaryOperatorType.None)
outExpr = new UnaryOperatorExpression(outExpr, uop);
}
void ComparisonExpr(
-#line 2002 "VBNET.ATG"
+#line 2005 "VBNET.ATG"
out Expression outExpr) {
-#line 2004 "VBNET.ATG"
+#line 2007 "VBNET.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
Location startLocation = la.Location;
ShiftExpr(
-#line 2008 "VBNET.ATG"
+#line 2011 "VBNET.ATG"
out outExpr);
while (StartOf(40)) {
switch (la.kind) {
case 40: {
lexer.NextToken();
-#line 2011 "VBNET.ATG"
+#line 2014 "VBNET.ATG"
op = BinaryOperatorType.LessThan;
break;
}
case 39: {
lexer.NextToken();
-#line 2012 "VBNET.ATG"
+#line 2015 "VBNET.ATG"
op = BinaryOperatorType.GreaterThan;
break;
}
case 43: {
lexer.NextToken();
-#line 2013 "VBNET.ATG"
+#line 2016 "VBNET.ATG"
op = BinaryOperatorType.LessThanOrEqual;
break;
}
case 42: {
lexer.NextToken();
-#line 2014 "VBNET.ATG"
+#line 2017 "VBNET.ATG"
op = BinaryOperatorType.GreaterThanOrEqual;
break;
}
case 41: {
lexer.NextToken();
-#line 2015 "VBNET.ATG"
+#line 2018 "VBNET.ATG"
op = BinaryOperatorType.InEquality;
break;
}
case 20: {
lexer.NextToken();
-#line 2016 "VBNET.ATG"
+#line 2019 "VBNET.ATG"
op = BinaryOperatorType.Equality;
break;
}
case 150: {
lexer.NextToken();
-#line 2017 "VBNET.ATG"
+#line 2020 "VBNET.ATG"
op = BinaryOperatorType.Like;
break;
}
case 144: {
lexer.NextToken();
-#line 2018 "VBNET.ATG"
+#line 2021 "VBNET.ATG"
op = BinaryOperatorType.ReferenceEquality;
break;
}
case 145: {
lexer.NextToken();
-#line 2019 "VBNET.ATG"
+#line 2022 "VBNET.ATG"
op = BinaryOperatorType.ReferenceInequality;
break;
}
}
if (StartOf(41)) {
ShiftExpr(
-#line 2022 "VBNET.ATG"
+#line 2025 "VBNET.ATG"
out expr);
-#line 2022 "VBNET.ATG"
+#line 2025 "VBNET.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
} else if (la.kind == 164) {
-#line 2023 "VBNET.ATG"
+#line 2026 "VBNET.ATG"
Location startLocation2 = la.Location;
lexer.NextToken();
ShiftExpr(
-#line 2025 "VBNET.ATG"
+#line 2028 "VBNET.ATG"
out expr);
-#line 2025 "VBNET.ATG"
+#line 2028 "VBNET.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, new UnaryOperatorExpression(expr, UnaryOperatorType.Not) { StartLocation = startLocation2, EndLocation = t.EndLocation }) { StartLocation = startLocation, EndLocation = t.EndLocation };
} else SynErr(295);
}
}
void ShiftExpr(
-#line 2030 "VBNET.ATG"
+#line 2033 "VBNET.ATG"
out Expression outExpr) {
-#line 2032 "VBNET.ATG"
+#line 2035 "VBNET.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
Location startLocation = la.Location;
ConcatenationExpr(
-#line 2036 "VBNET.ATG"
+#line 2039 "VBNET.ATG"
out outExpr);
while (la.kind == 44 || la.kind == 45) {
if (la.kind == 44) {
lexer.NextToken();
-#line 2039 "VBNET.ATG"
+#line 2042 "VBNET.ATG"
op = BinaryOperatorType.ShiftLeft;
} else {
lexer.NextToken();
-#line 2040 "VBNET.ATG"
+#line 2043 "VBNET.ATG"
op = BinaryOperatorType.ShiftRight;
}
ConcatenationExpr(
-#line 2042 "VBNET.ATG"
+#line 2045 "VBNET.ATG"
out expr);
-#line 2042 "VBNET.ATG"
+#line 2045 "VBNET.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
}
}
void ConcatenationExpr(
-#line 2046 "VBNET.ATG"
+#line 2049 "VBNET.ATG"
out Expression outExpr) {
-#line 2047 "VBNET.ATG"
+#line 2050 "VBNET.ATG"
Expression expr; Location startLocation = la.Location;
AdditiveExpr(
-#line 2049 "VBNET.ATG"
+#line 2052 "VBNET.ATG"
out outExpr);
while (la.kind == 23) {
lexer.NextToken();
AdditiveExpr(
-#line 2049 "VBNET.ATG"
+#line 2052 "VBNET.ATG"
out expr);
-#line 2049 "VBNET.ATG"
+#line 2052 "VBNET.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.Concat, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
}
}
void AdditiveExpr(
-#line 2052 "VBNET.ATG"
+#line 2055 "VBNET.ATG"
out Expression outExpr) {
-#line 2054 "VBNET.ATG"
+#line 2057 "VBNET.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
Location startLocation = la.Location;
ModuloExpr(
-#line 2058 "VBNET.ATG"
+#line 2061 "VBNET.ATG"
out outExpr);
while (la.kind == 30 || la.kind == 31) {
if (la.kind == 31) {
lexer.NextToken();
-#line 2061 "VBNET.ATG"
+#line 2064 "VBNET.ATG"
op = BinaryOperatorType.Add;
} else {
lexer.NextToken();
-#line 2062 "VBNET.ATG"
+#line 2065 "VBNET.ATG"
op = BinaryOperatorType.Subtract;
}
ModuloExpr(
-#line 2064 "VBNET.ATG"
+#line 2067 "VBNET.ATG"
out expr);
-#line 2064 "VBNET.ATG"
+#line 2067 "VBNET.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
}
}
void ModuloExpr(
-#line 2068 "VBNET.ATG"
+#line 2071 "VBNET.ATG"
out Expression outExpr) {
-#line 2069 "VBNET.ATG"
+#line 2072 "VBNET.ATG"
Expression expr; Location startLocation = la.Location;
IntegerDivisionExpr(
-#line 2071 "VBNET.ATG"
+#line 2074 "VBNET.ATG"
out outExpr);
while (la.kind == 154) {
lexer.NextToken();
IntegerDivisionExpr(
-#line 2071 "VBNET.ATG"
+#line 2074 "VBNET.ATG"
out expr);
-#line 2071 "VBNET.ATG"
+#line 2074 "VBNET.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.Modulus, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
}
}
void IntegerDivisionExpr(
-#line 2074 "VBNET.ATG"
+#line 2077 "VBNET.ATG"
out Expression outExpr) {
-#line 2075 "VBNET.ATG"
+#line 2078 "VBNET.ATG"
Expression expr; Location startLocation = la.Location;
MultiplicativeExpr(
-#line 2077 "VBNET.ATG"
+#line 2080 "VBNET.ATG"
out outExpr);
while (la.kind == 25) {
lexer.NextToken();
MultiplicativeExpr(
-#line 2077 "VBNET.ATG"
+#line 2080 "VBNET.ATG"
out expr);
-#line 2077 "VBNET.ATG"
+#line 2080 "VBNET.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.DivideInteger, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
}
}
void MultiplicativeExpr(
-#line 2080 "VBNET.ATG"
+#line 2083 "VBNET.ATG"
out Expression outExpr) {
-#line 2082 "VBNET.ATG"
+#line 2085 "VBNET.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
Location startLocation = la.Location;
UnaryExpr(
-#line 2086 "VBNET.ATG"
+#line 2089 "VBNET.ATG"
out outExpr);
while (la.kind == 24 || la.kind == 34) {
if (la.kind == 34) {
lexer.NextToken();
-#line 2089 "VBNET.ATG"
+#line 2092 "VBNET.ATG"
op = BinaryOperatorType.Multiply;
} else {
lexer.NextToken();
-#line 2090 "VBNET.ATG"
+#line 2093 "VBNET.ATG"
op = BinaryOperatorType.Divide;
}
UnaryExpr(
-#line 2092 "VBNET.ATG"
+#line 2095 "VBNET.ATG"
out expr);
-#line 2092 "VBNET.ATG"
+#line 2095 "VBNET.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
}
}
void UnaryExpr(
-#line 2096 "VBNET.ATG"
+#line 2099 "VBNET.ATG"
out Expression uExpr) {
-#line 2098 "VBNET.ATG"
+#line 2101 "VBNET.ATG"
Expression expr;
UnaryOperatorType uop = UnaryOperatorType.None;
Location startLocation = la.Location;
@@ -5307,25 +5315,25 @@ out Expression uExpr) {
if (la.kind == 31) {
lexer.NextToken();
-#line 2103 "VBNET.ATG"
+#line 2106 "VBNET.ATG"
uop = UnaryOperatorType.Plus; isUOp = true;
} else if (la.kind == 30) {
lexer.NextToken();
-#line 2104 "VBNET.ATG"
+#line 2107 "VBNET.ATG"
uop = UnaryOperatorType.Minus; isUOp = true;
} else {
lexer.NextToken();
-#line 2105 "VBNET.ATG"
+#line 2108 "VBNET.ATG"
uop = UnaryOperatorType.Dereference; isUOp = true;
}
}
ExponentiationExpr(
-#line 2107 "VBNET.ATG"
+#line 2110 "VBNET.ATG"
out expr);
-#line 2109 "VBNET.ATG"
+#line 2112 "VBNET.ATG"
if (isUOp) {
uExpr = new UnaryOperatorExpression(expr, uop) { StartLocation = startLocation, EndLocation = t.EndLocation };
} else {
@@ -5335,107 +5343,107 @@ out expr);
}
void ExponentiationExpr(
-#line 2117 "VBNET.ATG"
+#line 2120 "VBNET.ATG"
out Expression outExpr) {
-#line 2118 "VBNET.ATG"
+#line 2121 "VBNET.ATG"
Expression expr; Location startLocation = la.Location;
SimpleExpr(
-#line 2120 "VBNET.ATG"
+#line 2123 "VBNET.ATG"
out outExpr);
while (la.kind == 32) {
lexer.NextToken();
SimpleExpr(
-#line 2120 "VBNET.ATG"
+#line 2123 "VBNET.ATG"
out expr);
-#line 2120 "VBNET.ATG"
+#line 2123 "VBNET.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.Power, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
}
}
void NormalOrReDimArgumentList(
-#line 2653 "VBNET.ATG"
+#line 2656 "VBNET.ATG"
out List arguments, out bool canBeNormal, out bool canBeRedim) {
-#line 2655 "VBNET.ATG"
+#line 2658 "VBNET.ATG"
arguments = new List();
canBeNormal = true; canBeRedim = !IsNamedAssign();
Expression expr = null;
if (StartOf(24)) {
Argument(
-#line 2660 "VBNET.ATG"
+#line 2663 "VBNET.ATG"
out expr);
if (la.kind == 216) {
lexer.NextToken();
-#line 2661 "VBNET.ATG"
+#line 2664 "VBNET.ATG"
EnsureIsZero(expr); canBeNormal = false;
Expr(
-#line 2662 "VBNET.ATG"
+#line 2665 "VBNET.ATG"
out expr);
}
}
while (la.kind == 22) {
lexer.NextToken();
-#line 2665 "VBNET.ATG"
+#line 2668 "VBNET.ATG"
if (expr == null) canBeRedim = false;
-#line 2666 "VBNET.ATG"
+#line 2669 "VBNET.ATG"
arguments.Add(expr ?? Expression.Null); expr = null;
-#line 2667 "VBNET.ATG"
+#line 2670 "VBNET.ATG"
canBeRedim &= !IsNamedAssign();
if (StartOf(24)) {
Argument(
-#line 2668 "VBNET.ATG"
+#line 2671 "VBNET.ATG"
out expr);
if (la.kind == 216) {
lexer.NextToken();
-#line 2669 "VBNET.ATG"
+#line 2672 "VBNET.ATG"
EnsureIsZero(expr); canBeNormal = false;
Expr(
-#line 2670 "VBNET.ATG"
+#line 2673 "VBNET.ATG"
out expr);
}
}
-#line 2672 "VBNET.ATG"
+#line 2675 "VBNET.ATG"
if (expr == null) { canBeRedim = false; expr = Expression.Null; }
}
-#line 2674 "VBNET.ATG"
+#line 2677 "VBNET.ATG"
if (expr != null) arguments.Add(expr); else canBeRedim = false;
}
void ArrayTypeModifiers(
-#line 2784 "VBNET.ATG"
+#line 2787 "VBNET.ATG"
out ArrayList arrayModifiers) {
-#line 2786 "VBNET.ATG"
+#line 2789 "VBNET.ATG"
arrayModifiers = new ArrayList();
int i = 0;
while (
-#line 2789 "VBNET.ATG"
+#line 2792 "VBNET.ATG"
IsDims()) {
Expect(37);
if (la.kind == 22 || la.kind == 38) {
RankList(
-#line 2791 "VBNET.ATG"
+#line 2794 "VBNET.ATG"
out i);
}
-#line 2793 "VBNET.ATG"
+#line 2796 "VBNET.ATG"
arrayModifiers.Add(i);
Expect(38);
}
-#line 2798 "VBNET.ATG"
+#line 2801 "VBNET.ATG"
if(arrayModifiers.Count == 0) {
arrayModifiers = null;
}
@@ -5443,10 +5451,10 @@ out i);
}
void MemberInitializer(
-#line 2620 "VBNET.ATG"
+#line 2623 "VBNET.ATG"
out MemberInitializerExpression memberInitializer) {
-#line 2622 "VBNET.ATG"
+#line 2625 "VBNET.ATG"
memberInitializer = new MemberInitializerExpression();
memberInitializer.StartLocation = la.Location;
Expression initExpr = null;
@@ -5456,19 +5464,19 @@ out MemberInitializerExpression memberInitializer) {
if (la.kind == 147) {
lexer.NextToken();
-#line 2628 "VBNET.ATG"
+#line 2631 "VBNET.ATG"
isKey = true;
}
Expect(26);
IdentifierOrKeyword(
-#line 2629 "VBNET.ATG"
+#line 2632 "VBNET.ATG"
out name);
Expect(20);
Expr(
-#line 2629 "VBNET.ATG"
+#line 2632 "VBNET.ATG"
out initExpr);
-#line 2631 "VBNET.ATG"
+#line 2634 "VBNET.ATG"
memberInitializer.Name = name;
memberInitializer.Expression = initExpr;
memberInitializer.IsKey = isKey;
@@ -5477,10 +5485,10 @@ out initExpr);
}
void SubLambdaExpression(
-#line 2219 "VBNET.ATG"
+#line 2222 "VBNET.ATG"
out LambdaExpression lambda) {
-#line 2221 "VBNET.ATG"
+#line 2224 "VBNET.ATG"
lambda = new LambdaExpression();
lambda.ReturnType = new TypeReference("System.Void", true);
Expression inner = null;
@@ -5492,7 +5500,7 @@ out LambdaExpression lambda) {
lexer.NextToken();
if (StartOf(6)) {
FormalParameterList(
-#line 2228 "VBNET.ATG"
+#line 2231 "VBNET.ATG"
lambda.Parameters);
}
Expect(38);
@@ -5500,20 +5508,20 @@ lambda.Parameters);
if (StartOf(42)) {
if (StartOf(24)) {
Expr(
-#line 2231 "VBNET.ATG"
+#line 2234 "VBNET.ATG"
out inner);
-#line 2233 "VBNET.ATG"
+#line 2236 "VBNET.ATG"
lambda.ExpressionBody = inner;
lambda.EndLocation = t.EndLocation; // la.Location?
lambda.ExtendedEndLocation = la.Location;
} else {
EmbeddedStatement(
-#line 2238 "VBNET.ATG"
+#line 2241 "VBNET.ATG"
out statement);
-#line 2240 "VBNET.ATG"
+#line 2243 "VBNET.ATG"
lambda.StatementBody = statement;
lambda.EndLocation = t.EndLocation;
lambda.ExtendedEndLocation = la.Location;
@@ -5522,12 +5530,12 @@ out statement);
} else if (la.kind == 1) {
lexer.NextToken();
Block(
-#line 2247 "VBNET.ATG"
+#line 2250 "VBNET.ATG"
out statement);
Expect(113);
Expect(210);
-#line 2250 "VBNET.ATG"
+#line 2253 "VBNET.ATG"
lambda.StatementBody = statement;
lambda.EndLocation = t.EndLocation;
lambda.ExtendedEndLocation = la.Location;
@@ -5536,10 +5544,10 @@ out statement);
}
void FunctionLambdaExpression(
-#line 2257 "VBNET.ATG"
+#line 2260 "VBNET.ATG"
out LambdaExpression lambda) {
-#line 2259 "VBNET.ATG"
+#line 2262 "VBNET.ATG"
lambda = new LambdaExpression();
TypeReference typeRef = null;
Expression inner = null;
@@ -5551,7 +5559,7 @@ out LambdaExpression lambda) {
lexer.NextToken();
if (StartOf(6)) {
FormalParameterList(
-#line 2266 "VBNET.ATG"
+#line 2269 "VBNET.ATG"
lambda.Parameters);
}
Expect(38);
@@ -5559,29 +5567,29 @@ lambda.Parameters);
if (la.kind == 63) {
lexer.NextToken();
TypeName(
-#line 2267 "VBNET.ATG"
+#line 2270 "VBNET.ATG"
out typeRef);
-#line 2267 "VBNET.ATG"
+#line 2270 "VBNET.ATG"
lambda.ReturnType = typeRef;
}
if (StartOf(42)) {
if (StartOf(24)) {
Expr(
-#line 2270 "VBNET.ATG"
+#line 2273 "VBNET.ATG"
out inner);
-#line 2272 "VBNET.ATG"
+#line 2275 "VBNET.ATG"
lambda.ExpressionBody = inner;
lambda.EndLocation = t.EndLocation;
lambda.ExtendedEndLocation = la.Location;
} else {
EmbeddedStatement(
-#line 2277 "VBNET.ATG"
+#line 2280 "VBNET.ATG"
out statement);
-#line 2279 "VBNET.ATG"
+#line 2282 "VBNET.ATG"
lambda.StatementBody = statement;
lambda.EndLocation = t.EndLocation;
lambda.ExtendedEndLocation = la.Location;
@@ -5590,12 +5598,12 @@ out statement);
} else if (la.kind == 1) {
lexer.NextToken();
Block(
-#line 2286 "VBNET.ATG"
+#line 2289 "VBNET.ATG"
out statement);
Expect(113);
Expect(127);
-#line 2289 "VBNET.ATG"
+#line 2292 "VBNET.ATG"
lambda.StatementBody = statement;
lambda.EndLocation = t.EndLocation;
lambda.ExtendedEndLocation = la.Location;
@@ -5604,10 +5612,10 @@ out statement);
}
void EmbeddedStatement(
-#line 3070 "VBNET.ATG"
+#line 3073 "VBNET.ATG"
out Statement statement) {
-#line 3072 "VBNET.ATG"
+#line 3075 "VBNET.ATG"
Statement embeddedStatement = null;
statement = null;
Expression expr = null;
@@ -5618,224 +5626,224 @@ out Statement statement) {
if (la.kind == 120) {
lexer.NextToken();
-#line 3080 "VBNET.ATG"
+#line 3083 "VBNET.ATG"
ExitType exitType = ExitType.None;
switch (la.kind) {
case 210: {
lexer.NextToken();
-#line 3082 "VBNET.ATG"
+#line 3085 "VBNET.ATG"
exitType = ExitType.Sub;
break;
}
case 127: {
lexer.NextToken();
-#line 3084 "VBNET.ATG"
+#line 3087 "VBNET.ATG"
exitType = ExitType.Function;
break;
}
case 186: {
lexer.NextToken();
-#line 3086 "VBNET.ATG"
+#line 3089 "VBNET.ATG"
exitType = ExitType.Property;
break;
}
case 108: {
lexer.NextToken();
-#line 3088 "VBNET.ATG"
+#line 3091 "VBNET.ATG"
exitType = ExitType.Do;
break;
}
case 124: {
lexer.NextToken();
-#line 3090 "VBNET.ATG"
+#line 3093 "VBNET.ATG"
exitType = ExitType.For;
break;
}
case 218: {
lexer.NextToken();
-#line 3092 "VBNET.ATG"
+#line 3095 "VBNET.ATG"
exitType = ExitType.Try;
break;
}
case 231: {
lexer.NextToken();
-#line 3094 "VBNET.ATG"
+#line 3097 "VBNET.ATG"
exitType = ExitType.While;
break;
}
case 197: {
lexer.NextToken();
-#line 3096 "VBNET.ATG"
+#line 3099 "VBNET.ATG"
exitType = ExitType.Select;
break;
}
default: SynErr(298); break;
}
-#line 3098 "VBNET.ATG"
+#line 3101 "VBNET.ATG"
statement = new ExitStatement(exitType);
} else if (la.kind == 218) {
TryStatement(
-#line 3099 "VBNET.ATG"
+#line 3102 "VBNET.ATG"
out statement);
} else if (la.kind == 89) {
lexer.NextToken();
-#line 3100 "VBNET.ATG"
+#line 3103 "VBNET.ATG"
ContinueType continueType = ContinueType.None;
if (la.kind == 108 || la.kind == 124 || la.kind == 231) {
if (la.kind == 108) {
lexer.NextToken();
-#line 3100 "VBNET.ATG"
+#line 3103 "VBNET.ATG"
continueType = ContinueType.Do;
} else if (la.kind == 124) {
lexer.NextToken();
-#line 3100 "VBNET.ATG"
+#line 3103 "VBNET.ATG"
continueType = ContinueType.For;
} else {
lexer.NextToken();
-#line 3100 "VBNET.ATG"
+#line 3103 "VBNET.ATG"
continueType = ContinueType.While;
}
}
-#line 3100 "VBNET.ATG"
+#line 3103 "VBNET.ATG"
statement = new ContinueStatement(continueType);
} else if (la.kind == 215) {
lexer.NextToken();
if (StartOf(24)) {
Expr(
-#line 3102 "VBNET.ATG"
+#line 3105 "VBNET.ATG"
out expr);
}
-#line 3102 "VBNET.ATG"
+#line 3105 "VBNET.ATG"
statement = new ThrowStatement(expr);
} else if (la.kind == 195) {
lexer.NextToken();
if (StartOf(24)) {
Expr(
-#line 3104 "VBNET.ATG"
+#line 3107 "VBNET.ATG"
out expr);
}
-#line 3104 "VBNET.ATG"
+#line 3107 "VBNET.ATG"
statement = new ReturnStatement(expr);
} else if (la.kind == 211) {
lexer.NextToken();
Expr(
-#line 3106 "VBNET.ATG"
+#line 3109 "VBNET.ATG"
out expr);
EndOfStmt();
Block(
-#line 3106 "VBNET.ATG"
+#line 3109 "VBNET.ATG"
out embeddedStatement);
Expect(113);
Expect(211);
-#line 3107 "VBNET.ATG"
+#line 3110 "VBNET.ATG"
statement = new LockStatement(expr, embeddedStatement);
} else if (la.kind == 189) {
lexer.NextToken();
Identifier();
-#line 3109 "VBNET.ATG"
+#line 3112 "VBNET.ATG"
name = t.val;
if (la.kind == 37) {
lexer.NextToken();
if (StartOf(43)) {
ArgumentList(
-#line 3110 "VBNET.ATG"
+#line 3113 "VBNET.ATG"
out p);
}
Expect(38);
}
-#line 3112 "VBNET.ATG"
+#line 3115 "VBNET.ATG"
statement = new RaiseEventStatement(name, p);
} else if (la.kind == 233) {
WithStatement(
-#line 3115 "VBNET.ATG"
+#line 3118 "VBNET.ATG"
out statement);
} else if (la.kind == 56) {
lexer.NextToken();
-#line 3117 "VBNET.ATG"
+#line 3120 "VBNET.ATG"
Expression handlerExpr = null;
Expr(
-#line 3118 "VBNET.ATG"
+#line 3121 "VBNET.ATG"
out expr);
Expect(22);
Expr(
-#line 3118 "VBNET.ATG"
+#line 3121 "VBNET.ATG"
out handlerExpr);
-#line 3120 "VBNET.ATG"
+#line 3123 "VBNET.ATG"
statement = new AddHandlerStatement(expr, handlerExpr);
} else if (la.kind == 193) {
lexer.NextToken();
-#line 3123 "VBNET.ATG"
+#line 3126 "VBNET.ATG"
Expression handlerExpr = null;
Expr(
-#line 3124 "VBNET.ATG"
+#line 3127 "VBNET.ATG"
out expr);
Expect(22);
Expr(
-#line 3124 "VBNET.ATG"
+#line 3127 "VBNET.ATG"
out handlerExpr);
-#line 3126 "VBNET.ATG"
+#line 3129 "VBNET.ATG"
statement = new RemoveHandlerStatement(expr, handlerExpr);
} else if (la.kind == 231) {
lexer.NextToken();
Expr(
-#line 3129 "VBNET.ATG"
+#line 3132 "VBNET.ATG"
out expr);
EndOfStmt();
Block(
-#line 3130 "VBNET.ATG"
+#line 3133 "VBNET.ATG"
out embeddedStatement);
Expect(113);
Expect(231);
-#line 3132 "VBNET.ATG"
+#line 3135 "VBNET.ATG"
statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.Start);
} else if (la.kind == 108) {
lexer.NextToken();
-#line 3137 "VBNET.ATG"
+#line 3140 "VBNET.ATG"
ConditionType conditionType = ConditionType.None;
if (la.kind == 224 || la.kind == 231) {
WhileOrUntil(
-#line 3140 "VBNET.ATG"
+#line 3143 "VBNET.ATG"
out conditionType);
Expr(
-#line 3140 "VBNET.ATG"
+#line 3143 "VBNET.ATG"
out expr);
EndOfStmt();
Block(
-#line 3141 "VBNET.ATG"
+#line 3144 "VBNET.ATG"
out embeddedStatement);
Expect(152);
-#line 3144 "VBNET.ATG"
+#line 3147 "VBNET.ATG"
statement = new DoLoopStatement(expr,
embeddedStatement,
conditionType == ConditionType.While ? ConditionType.DoWhile : conditionType,
@@ -5844,26 +5852,26 @@ out embeddedStatement);
} else if (la.kind == 1 || la.kind == 21) {
EndOfStmt();
Block(
-#line 3151 "VBNET.ATG"
+#line 3154 "VBNET.ATG"
out embeddedStatement);
Expect(152);
if (la.kind == 224 || la.kind == 231) {
WhileOrUntil(
-#line 3152 "VBNET.ATG"
+#line 3155 "VBNET.ATG"
out conditionType);
Expr(
-#line 3152 "VBNET.ATG"
+#line 3155 "VBNET.ATG"
out expr);
}
-#line 3154 "VBNET.ATG"
+#line 3157 "VBNET.ATG"
statement = new DoLoopStatement(expr, embeddedStatement, conditionType, ConditionPosition.End);
} else SynErr(299);
} else if (la.kind == 124) {
lexer.NextToken();
-#line 3159 "VBNET.ATG"
+#line 3162 "VBNET.ATG"
Expression group = null;
TypeReference typeReference;
string typeName;
@@ -5871,24 +5879,24 @@ out expr);
if (la.kind == 110) {
lexer.NextToken();
LoopControlVariable(
-#line 3165 "VBNET.ATG"
+#line 3168 "VBNET.ATG"
out typeReference, out typeName);
Expect(138);
Expr(
-#line 3166 "VBNET.ATG"
+#line 3169 "VBNET.ATG"
out group);
EndOfStmt();
Block(
-#line 3167 "VBNET.ATG"
+#line 3170 "VBNET.ATG"
out embeddedStatement);
Expect(163);
if (StartOf(24)) {
Expr(
-#line 3168 "VBNET.ATG"
+#line 3171 "VBNET.ATG"
out expr);
}
-#line 3170 "VBNET.ATG"
+#line 3173 "VBNET.ATG"
statement = new ForeachStatement(typeReference,
typeName,
group,
@@ -5900,7 +5908,7 @@ out expr);
} else if (StartOf(44)) {
-#line 3181 "VBNET.ATG"
+#line 3184 "VBNET.ATG"
Expression start = null;
Expression end = null;
Expression step = null;
@@ -5909,59 +5917,59 @@ out expr);
List nextExpressions = null;
if (
-#line 3188 "VBNET.ATG"
+#line 3191 "VBNET.ATG"
IsLoopVariableDeclaration()) {
LoopControlVariable(
-#line 3189 "VBNET.ATG"
+#line 3192 "VBNET.ATG"
out typeReference, out typeName);
} else {
-#line 3191 "VBNET.ATG"
+#line 3194 "VBNET.ATG"
typeReference = null; typeName = null;
SimpleExpr(
-#line 3192 "VBNET.ATG"
+#line 3195 "VBNET.ATG"
out variableExpr);
}
Expect(20);
Expr(
-#line 3194 "VBNET.ATG"
+#line 3197 "VBNET.ATG"
out start);
Expect(216);
Expr(
-#line 3194 "VBNET.ATG"
+#line 3197 "VBNET.ATG"
out end);
if (la.kind == 205) {
lexer.NextToken();
Expr(
-#line 3194 "VBNET.ATG"
+#line 3197 "VBNET.ATG"
out step);
}
EndOfStmt();
Block(
-#line 3195 "VBNET.ATG"
+#line 3198 "VBNET.ATG"
out embeddedStatement);
Expect(163);
if (StartOf(24)) {
Expr(
-#line 3198 "VBNET.ATG"
+#line 3201 "VBNET.ATG"
out nextExpr);
-#line 3200 "VBNET.ATG"
+#line 3203 "VBNET.ATG"
nextExpressions = new List();
nextExpressions.Add(nextExpr);
while (la.kind == 22) {
lexer.NextToken();
Expr(
-#line 3203 "VBNET.ATG"
+#line 3206 "VBNET.ATG"
out nextExpr);
-#line 3203 "VBNET.ATG"
+#line 3206 "VBNET.ATG"
nextExpressions.Add(nextExpr);
}
}
-#line 3206 "VBNET.ATG"
+#line 3209 "VBNET.ATG"
statement = new ForNextStatement {
TypeReference = typeReference,
VariableName = typeName,
@@ -5977,27 +5985,27 @@ out nextExpr);
} else if (la.kind == 118) {
lexer.NextToken();
Expr(
-#line 3219 "VBNET.ATG"
+#line 3222 "VBNET.ATG"
out expr);
-#line 3219 "VBNET.ATG"
+#line 3222 "VBNET.ATG"
statement = new ErrorStatement(expr);
} else if (la.kind == 191) {
lexer.NextToken();
-#line 3221 "VBNET.ATG"
+#line 3224 "VBNET.ATG"
bool isPreserve = false;
if (la.kind == 184) {
lexer.NextToken();
-#line 3221 "VBNET.ATG"
+#line 3224 "VBNET.ATG"
isPreserve = true;
}
ReDimClause(
-#line 3222 "VBNET.ATG"
+#line 3225 "VBNET.ATG"
out expr);
-#line 3224 "VBNET.ATG"
+#line 3227 "VBNET.ATG"
ReDimStatement reDimStatement = new ReDimStatement(isPreserve);
statement = reDimStatement;
SafeAdd(reDimStatement, reDimStatement.ReDimClauses, expr as InvocationExpression);
@@ -6005,48 +6013,48 @@ out expr);
while (la.kind == 22) {
lexer.NextToken();
ReDimClause(
-#line 3228 "VBNET.ATG"
+#line 3231 "VBNET.ATG"
out expr);
-#line 3229 "VBNET.ATG"
+#line 3232 "VBNET.ATG"
SafeAdd(reDimStatement, reDimStatement.ReDimClauses, expr as InvocationExpression);
}
} else if (la.kind == 117) {
lexer.NextToken();
Expr(
-#line 3233 "VBNET.ATG"
+#line 3236 "VBNET.ATG"
out expr);
-#line 3235 "VBNET.ATG"
+#line 3238 "VBNET.ATG"
EraseStatement eraseStatement = new EraseStatement();
if (expr != null) { SafeAdd(eraseStatement, eraseStatement.Expressions, expr);}
while (la.kind == 22) {
lexer.NextToken();
Expr(
-#line 3238 "VBNET.ATG"
+#line 3241 "VBNET.ATG"
out expr);
-#line 3238 "VBNET.ATG"
+#line 3241 "VBNET.ATG"
if (expr != null) { SafeAdd(eraseStatement, eraseStatement.Expressions, expr); }
}
-#line 3239 "VBNET.ATG"
+#line 3242 "VBNET.ATG"
statement = eraseStatement;
} else if (la.kind == 206) {
lexer.NextToken();
-#line 3241 "VBNET.ATG"
+#line 3244 "VBNET.ATG"
statement = new StopStatement();
} else if (
-#line 3243 "VBNET.ATG"
+#line 3246 "VBNET.ATG"
la.kind == Tokens.If) {
Expect(135);
-#line 3244 "VBNET.ATG"
+#line 3247 "VBNET.ATG"
Location ifStartLocation = t.Location;
Expr(
-#line 3244 "VBNET.ATG"
+#line 3247 "VBNET.ATG"
out expr);
if (la.kind == 214) {
lexer.NextToken();
@@ -6054,46 +6062,46 @@ out expr);
if (la.kind == 1 || la.kind == 21) {
EndOfStmt();
Block(
-#line 3247 "VBNET.ATG"
+#line 3250 "VBNET.ATG"
out embeddedStatement);
-#line 3249 "VBNET.ATG"
+#line 3252 "VBNET.ATG"
IfElseStatement ifStatement = new IfElseStatement(expr, embeddedStatement);
ifStatement.StartLocation = ifStartLocation;
Location elseIfStart;
while (la.kind == 112 ||
-#line 3255 "VBNET.ATG"
+#line 3258 "VBNET.ATG"
IsElseIf()) {
if (
-#line 3255 "VBNET.ATG"
+#line 3258 "VBNET.ATG"
IsElseIf()) {
Expect(111);
-#line 3255 "VBNET.ATG"
+#line 3258 "VBNET.ATG"
elseIfStart = t.Location;
Expect(135);
} else {
lexer.NextToken();
-#line 3256 "VBNET.ATG"
+#line 3259 "VBNET.ATG"
elseIfStart = t.Location;
}
-#line 3258 "VBNET.ATG"
+#line 3261 "VBNET.ATG"
Expression condition = null; Statement block = null;
Expr(
-#line 3259 "VBNET.ATG"
+#line 3262 "VBNET.ATG"
out condition);
if (la.kind == 214) {
lexer.NextToken();
}
EndOfStmt();
Block(
-#line 3260 "VBNET.ATG"
+#line 3263 "VBNET.ATG"
out block);
-#line 3262 "VBNET.ATG"
+#line 3265 "VBNET.ATG"
ElseIfSection elseIfSection = new ElseIfSection(condition, block);
elseIfSection.StartLocation = elseIfStart;
elseIfSection.EndLocation = t.Location;
@@ -6107,39 +6115,39 @@ out block);
EndOfStmt();
}
Block(
-#line 3271 "VBNET.ATG"
+#line 3274 "VBNET.ATG"
out embeddedStatement);
-#line 3273 "VBNET.ATG"
+#line 3276 "VBNET.ATG"
ifStatement.FalseStatement.Add(embeddedStatement);
}
Expect(113);
Expect(135);
-#line 3277 "VBNET.ATG"
+#line 3280 "VBNET.ATG"
ifStatement.EndLocation = t.Location;
statement = ifStatement;
} else if (StartOf(45)) {
-#line 3282 "VBNET.ATG"
+#line 3285 "VBNET.ATG"
IfElseStatement ifStatement = new IfElseStatement(expr);
ifStatement.StartLocation = ifStartLocation;
SingleLineStatementList(
-#line 3285 "VBNET.ATG"
+#line 3288 "VBNET.ATG"
ifStatement.TrueStatement);
if (la.kind == 111) {
lexer.NextToken();
if (StartOf(45)) {
SingleLineStatementList(
-#line 3288 "VBNET.ATG"
+#line 3291 "VBNET.ATG"
ifStatement.FalseStatement);
}
}
-#line 3290 "VBNET.ATG"
+#line 3293 "VBNET.ATG"
ifStatement.EndLocation = t.Location; statement = ifStatement;
} else SynErr(301);
} else if (la.kind == 197) {
@@ -6148,82 +6156,82 @@ ifStatement.FalseStatement);
lexer.NextToken();
}
Expr(
-#line 3293 "VBNET.ATG"
+#line 3296 "VBNET.ATG"
out expr);
EndOfStmt();
-#line 3294 "VBNET.ATG"
+#line 3297 "VBNET.ATG"
List selectSections = new List();
Statement block = null;
while (la.kind == 74) {
-#line 3298 "VBNET.ATG"
+#line 3301 "VBNET.ATG"
List caseClauses = null; Location caseLocation = la.Location;
lexer.NextToken();
CaseClauses(
-#line 3299 "VBNET.ATG"
+#line 3302 "VBNET.ATG"
out caseClauses);
if (
-#line 3299 "VBNET.ATG"
+#line 3302 "VBNET.ATG"
IsNotStatementSeparator()) {
lexer.NextToken();
}
EndOfStmt();
-#line 3301 "VBNET.ATG"
+#line 3304 "VBNET.ATG"
SwitchSection selectSection = new SwitchSection(caseClauses);
selectSection.StartLocation = caseLocation;
Block(
-#line 3304 "VBNET.ATG"
+#line 3307 "VBNET.ATG"
out block);
-#line 3306 "VBNET.ATG"
+#line 3309 "VBNET.ATG"
selectSection.Children = block.Children;
selectSection.EndLocation = t.EndLocation;
selectSections.Add(selectSection);
}
-#line 3312 "VBNET.ATG"
+#line 3315 "VBNET.ATG"
statement = new SwitchStatement(expr, selectSections);
Expect(113);
Expect(197);
} else if (la.kind == 171) {
-#line 3315 "VBNET.ATG"
+#line 3318 "VBNET.ATG"
OnErrorStatement onErrorStatement = null;
OnErrorStatement(
-#line 3316 "VBNET.ATG"
+#line 3319 "VBNET.ATG"
out onErrorStatement);
-#line 3316 "VBNET.ATG"
+#line 3319 "VBNET.ATG"
statement = onErrorStatement;
} else if (la.kind == 132) {
-#line 3317 "VBNET.ATG"
+#line 3320 "VBNET.ATG"
GotoStatement goToStatement = null;
GotoStatement(
-#line 3318 "VBNET.ATG"
+#line 3321 "VBNET.ATG"
out goToStatement);
-#line 3318 "VBNET.ATG"
+#line 3321 "VBNET.ATG"
statement = goToStatement;
} else if (la.kind == 194) {
-#line 3319 "VBNET.ATG"
+#line 3322 "VBNET.ATG"
ResumeStatement resumeStatement = null;
ResumeStatement(
-#line 3320 "VBNET.ATG"
+#line 3323 "VBNET.ATG"
out resumeStatement);
-#line 3320 "VBNET.ATG"
+#line 3323 "VBNET.ATG"
statement = resumeStatement;
} else if (StartOf(44)) {
-#line 3323 "VBNET.ATG"
+#line 3326 "VBNET.ATG"
Expression val = null;
AssignmentOperatorType op;
Location startLoc = la.Location;
@@ -6232,28 +6240,28 @@ out resumeStatement);
la.kind == Tokens.Not || la.kind == Tokens.Times;
SimpleExpr(
-#line 3330 "VBNET.ATG"
+#line 3333 "VBNET.ATG"
out expr);
if (StartOf(46)) {
AssignmentOperator(
-#line 3332 "VBNET.ATG"
+#line 3335 "VBNET.ATG"
out op);
Expr(
-#line 3332 "VBNET.ATG"
+#line 3335 "VBNET.ATG"
out val);
-#line 3334 "VBNET.ATG"
+#line 3337 "VBNET.ATG"
expr = new AssignmentExpression(expr, op, val);
expr.StartLocation = startLoc;
expr.EndLocation = t.EndLocation;
} else if (StartOf(47)) {
-#line 3338 "VBNET.ATG"
+#line 3341 "VBNET.ATG"
if (mustBeAssignment) Error("error in assignment.");
} else SynErr(302);
-#line 3341 "VBNET.ATG"
+#line 3344 "VBNET.ATG"
// a field reference expression that stands alone is a
// invocation expression without parantheses and arguments
if(expr is MemberReferenceExpression || expr is IdentifierExpression) {
@@ -6267,58 +6275,58 @@ out val);
} else if (la.kind == 73) {
lexer.NextToken();
SimpleExpr(
-#line 3351 "VBNET.ATG"
+#line 3354 "VBNET.ATG"
out expr);
-#line 3351 "VBNET.ATG"
+#line 3354 "VBNET.ATG"
statement = new ExpressionStatement(expr);
} else if (la.kind == 226) {
lexer.NextToken();
-#line 3353 "VBNET.ATG"
+#line 3356 "VBNET.ATG"
Statement block;
if (
-#line 3354 "VBNET.ATG"
+#line 3357 "VBNET.ATG"
Peek(1).kind == Tokens.As) {
-#line 3355 "VBNET.ATG"
+#line 3358 "VBNET.ATG"
LocalVariableDeclaration resourceAquisition = new LocalVariableDeclaration(Modifiers.None);
VariableDeclarator(
-#line 3356 "VBNET.ATG"
+#line 3359 "VBNET.ATG"
resourceAquisition.Variables);
while (la.kind == 22) {
lexer.NextToken();
VariableDeclarator(
-#line 3358 "VBNET.ATG"
+#line 3361 "VBNET.ATG"
resourceAquisition.Variables);
}
Block(
-#line 3360 "VBNET.ATG"
+#line 3363 "VBNET.ATG"
out block);
-#line 3362 "VBNET.ATG"
+#line 3365 "VBNET.ATG"
statement = new UsingStatement(resourceAquisition, block);
} else if (StartOf(24)) {
Expr(
-#line 3364 "VBNET.ATG"
+#line 3367 "VBNET.ATG"
out expr);
Block(
-#line 3365 "VBNET.ATG"
+#line 3368 "VBNET.ATG"
out block);
-#line 3366 "VBNET.ATG"
+#line 3369 "VBNET.ATG"
statement = new UsingStatement(new ExpressionStatement(expr), block);
} else SynErr(303);
Expect(113);
Expect(226);
} else if (StartOf(48)) {
LocalDeclarationStatement(
-#line 3369 "VBNET.ATG"
+#line 3372 "VBNET.ATG"
out statement);
} else SynErr(304);
-#line 3372 "VBNET.ATG"
+#line 3375 "VBNET.ATG"
if (statement != null) {
statement.StartLocation = startLocation;
statement.EndLocation = t.EndLocation;
@@ -6327,35 +6335,35 @@ out statement);
}
void FromOrAggregateQueryOperator(
-#line 2309 "VBNET.ATG"
+#line 2312 "VBNET.ATG"
List middleClauses) {
-#line 2311 "VBNET.ATG"
+#line 2314 "VBNET.ATG"
QueryExpressionFromClause fromClause = null;
QueryExpressionAggregateClause aggregateClause = null;
if (la.kind == 126) {
FromQueryOperator(
-#line 2314 "VBNET.ATG"
+#line 2317 "VBNET.ATG"
out fromClause);
-#line 2315 "VBNET.ATG"
+#line 2318 "VBNET.ATG"
middleClauses.Add(fromClause);
} else if (la.kind == 58) {
AggregateQueryOperator(
-#line 2316 "VBNET.ATG"
+#line 2319 "VBNET.ATG"
out aggregateClause);
-#line 2317 "VBNET.ATG"
+#line 2320 "VBNET.ATG"
middleClauses.Add(aggregateClause);
} else SynErr(305);
}
void QueryOperator(
-#line 2320 "VBNET.ATG"
+#line 2323 "VBNET.ATG"
List middleClauses) {
-#line 2322 "VBNET.ATG"
+#line 2325 "VBNET.ATG"
QueryExpressionJoinVBClause joinClause = null;
QueryExpressionGroupVBClause groupByClause = null;
QueryExpressionPartitionVBClause partitionClause = null;
@@ -6365,94 +6373,94 @@ List middleClauses) {
if (la.kind == 126) {
FromQueryOperator(
-#line 2329 "VBNET.ATG"
+#line 2332 "VBNET.ATG"
out fromClause);
-#line 2330 "VBNET.ATG"
+#line 2333 "VBNET.ATG"
middleClauses.Add(fromClause);
} else if (la.kind == 58) {
AggregateQueryOperator(
-#line 2331 "VBNET.ATG"
+#line 2334 "VBNET.ATG"
out aggregateClause);
-#line 2332 "VBNET.ATG"
+#line 2335 "VBNET.ATG"
middleClauses.Add(aggregateClause);
} else if (la.kind == 197) {
SelectQueryOperator(
-#line 2333 "VBNET.ATG"
+#line 2336 "VBNET.ATG"
middleClauses);
} else if (la.kind == 107) {
DistinctQueryOperator(
-#line 2334 "VBNET.ATG"
+#line 2337 "VBNET.ATG"
middleClauses);
} else if (la.kind == 230) {
WhereQueryOperator(
-#line 2335 "VBNET.ATG"
+#line 2338 "VBNET.ATG"
middleClauses);
} else if (la.kind == 176) {
OrderByQueryOperator(
-#line 2336 "VBNET.ATG"
+#line 2339 "VBNET.ATG"
middleClauses);
} else if (la.kind == 203 || la.kind == 212) {
PartitionQueryOperator(
-#line 2337 "VBNET.ATG"
+#line 2340 "VBNET.ATG"
out partitionClause);
-#line 2338 "VBNET.ATG"
+#line 2341 "VBNET.ATG"
middleClauses.Add(partitionClause);
} else if (la.kind == 148) {
LetQueryOperator(
-#line 2339 "VBNET.ATG"
+#line 2342 "VBNET.ATG"
middleClauses);
} else if (la.kind == 146) {
JoinQueryOperator(
-#line 2340 "VBNET.ATG"
+#line 2343 "VBNET.ATG"
out joinClause);
-#line 2341 "VBNET.ATG"
+#line 2344 "VBNET.ATG"
middleClauses.Add(joinClause);
} else if (
-#line 2342 "VBNET.ATG"
+#line 2345 "VBNET.ATG"
la.kind == Tokens.Group && Peek(1).kind == Tokens.Join) {
GroupJoinQueryOperator(
-#line 2342 "VBNET.ATG"
+#line 2345 "VBNET.ATG"
out groupJoinClause);
-#line 2343 "VBNET.ATG"
+#line 2346 "VBNET.ATG"
middleClauses.Add(groupJoinClause);
} else if (la.kind == 133) {
GroupByQueryOperator(
-#line 2344 "VBNET.ATG"
+#line 2347 "VBNET.ATG"
out groupByClause);
-#line 2345 "VBNET.ATG"
+#line 2348 "VBNET.ATG"
middleClauses.Add(groupByClause);
} else SynErr(306);
}
void FromQueryOperator(
-#line 2420 "VBNET.ATG"
+#line 2423 "VBNET.ATG"
out QueryExpressionFromClause fromClause) {
-#line 2422 "VBNET.ATG"
+#line 2425 "VBNET.ATG"
fromClause = new QueryExpressionFromClause();
fromClause.StartLocation = la.Location;
Expect(126);
CollectionRangeVariableDeclarationList(
-#line 2425 "VBNET.ATG"
+#line 2428 "VBNET.ATG"
fromClause.Sources);
-#line 2427 "VBNET.ATG"
+#line 2430 "VBNET.ATG"
fromClause.EndLocation = t.EndLocation;
}
void AggregateQueryOperator(
-#line 2489 "VBNET.ATG"
+#line 2492 "VBNET.ATG"
out QueryExpressionAggregateClause aggregateClause) {
-#line 2491 "VBNET.ATG"
+#line 2494 "VBNET.ATG"
aggregateClause = new QueryExpressionAggregateClause();
aggregateClause.IntoVariables = new List();
aggregateClause.StartLocation = la.Location;
@@ -6460,77 +6468,77 @@ out QueryExpressionAggregateClause aggregateClause) {
Expect(58);
CollectionRangeVariableDeclaration(
-#line 2496 "VBNET.ATG"
+#line 2499 "VBNET.ATG"
out source);
-#line 2498 "VBNET.ATG"
+#line 2501 "VBNET.ATG"
aggregateClause.Source = source;
while (StartOf(31)) {
QueryOperator(
-#line 2501 "VBNET.ATG"
+#line 2504 "VBNET.ATG"
aggregateClause.MiddleClauses);
}
Expect(143);
ExpressionRangeVariableDeclarationList(
-#line 2503 "VBNET.ATG"
+#line 2506 "VBNET.ATG"
aggregateClause.IntoVariables);
-#line 2505 "VBNET.ATG"
+#line 2508 "VBNET.ATG"
aggregateClause.EndLocation = t.EndLocation;
}
void SelectQueryOperator(
-#line 2431 "VBNET.ATG"
+#line 2434 "VBNET.ATG"
List middleClauses) {
-#line 2433 "VBNET.ATG"
+#line 2436 "VBNET.ATG"
QueryExpressionSelectVBClause selectClause = new QueryExpressionSelectVBClause();
selectClause.StartLocation = la.Location;
Expect(197);
ExpressionRangeVariableDeclarationList(
-#line 2436 "VBNET.ATG"
+#line 2439 "VBNET.ATG"
selectClause.Variables);
-#line 2438 "VBNET.ATG"
+#line 2441 "VBNET.ATG"
selectClause.EndLocation = t.Location;
middleClauses.Add(selectClause);
}
void DistinctQueryOperator(
-#line 2443 "VBNET.ATG"
+#line 2446 "VBNET.ATG"
List middleClauses) {
-#line 2445 "VBNET.ATG"
+#line 2448 "VBNET.ATG"
QueryExpressionDistinctClause distinctClause = new QueryExpressionDistinctClause();
distinctClause.StartLocation = la.Location;
Expect(107);
-#line 2450 "VBNET.ATG"
+#line 2453 "VBNET.ATG"
distinctClause.EndLocation = t.EndLocation;
middleClauses.Add(distinctClause);
}
void WhereQueryOperator(
-#line 2455 "VBNET.ATG"
+#line 2458 "VBNET.ATG"
List middleClauses) {
-#line 2457 "VBNET.ATG"
+#line 2460 "VBNET.ATG"
QueryExpressionWhereClause whereClause = new QueryExpressionWhereClause();
whereClause.StartLocation = la.Location;
Expression operand = null;
Expect(230);
Expr(
-#line 2461 "VBNET.ATG"
+#line 2464 "VBNET.ATG"
out operand);
-#line 2463 "VBNET.ATG"
+#line 2466 "VBNET.ATG"
whereClause.Condition = operand;
whereClause.EndLocation = t.EndLocation;
@@ -6539,10 +6547,10 @@ out operand);
}
void OrderByQueryOperator(
-#line 2348 "VBNET.ATG"
+#line 2351 "VBNET.ATG"
List middleClauses) {
-#line 2350 "VBNET.ATG"
+#line 2353 "VBNET.ATG"
QueryExpressionOrderClause orderClause = new QueryExpressionOrderClause();
orderClause.StartLocation = la.Location;
List orderings = null;
@@ -6550,10 +6558,10 @@ List middleClauses) {
Expect(176);
Expect(70);
OrderExpressionList(
-#line 2354 "VBNET.ATG"
+#line 2357 "VBNET.ATG"
out orderings);
-#line 2356 "VBNET.ATG"
+#line 2359 "VBNET.ATG"
orderClause.Orderings = orderings;
orderClause.EndLocation = t.EndLocation;
middleClauses.Add(orderClause);
@@ -6561,10 +6569,10 @@ out orderings);
}
void PartitionQueryOperator(
-#line 2470 "VBNET.ATG"
+#line 2473 "VBNET.ATG"
out QueryExpressionPartitionVBClause partitionClause) {
-#line 2472 "VBNET.ATG"
+#line 2475 "VBNET.ATG"
partitionClause = new QueryExpressionPartitionVBClause();
partitionClause.StartLocation = la.Location;
Expression expr = null;
@@ -6572,60 +6580,60 @@ out QueryExpressionPartitionVBClause partitionClause) {
if (la.kind == 212) {
lexer.NextToken();
-#line 2477 "VBNET.ATG"
+#line 2480 "VBNET.ATG"
partitionClause.PartitionType = QueryExpressionPartitionType.Take;
if (la.kind == 231) {
lexer.NextToken();
-#line 2478 "VBNET.ATG"
+#line 2481 "VBNET.ATG"
partitionClause.PartitionType = QueryExpressionPartitionType.TakeWhile;
}
} else if (la.kind == 203) {
lexer.NextToken();
-#line 2479 "VBNET.ATG"
+#line 2482 "VBNET.ATG"
partitionClause.PartitionType = QueryExpressionPartitionType.Skip;
if (la.kind == 231) {
lexer.NextToken();
-#line 2480 "VBNET.ATG"
+#line 2483 "VBNET.ATG"
partitionClause.PartitionType = QueryExpressionPartitionType.SkipWhile;
}
} else SynErr(307);
Expr(
-#line 2482 "VBNET.ATG"
+#line 2485 "VBNET.ATG"
out expr);
-#line 2484 "VBNET.ATG"
+#line 2487 "VBNET.ATG"
partitionClause.Expression = expr;
partitionClause.EndLocation = t.EndLocation;
}
void LetQueryOperator(
-#line 2509 "VBNET.ATG"
+#line 2512 "VBNET.ATG"
List middleClauses) {
-#line 2511 "VBNET.ATG"
+#line 2514 "VBNET.ATG"
QueryExpressionLetVBClause letClause = new QueryExpressionLetVBClause();
letClause.StartLocation = la.Location;
Expect(148);
ExpressionRangeVariableDeclarationList(
-#line 2514 "VBNET.ATG"
+#line 2517 "VBNET.ATG"
letClause.Variables);
-#line 2516 "VBNET.ATG"
+#line 2519 "VBNET.ATG"
letClause.EndLocation = t.EndLocation;
middleClauses.Add(letClause);
}
void JoinQueryOperator(
-#line 2553 "VBNET.ATG"
+#line 2556 "VBNET.ATG"
out QueryExpressionJoinVBClause joinClause) {
-#line 2555 "VBNET.ATG"
+#line 2558 "VBNET.ATG"
joinClause = new QueryExpressionJoinVBClause();
joinClause.StartLocation = la.Location;
CollectionRangeVariable joinVariable = null;
@@ -6635,203 +6643,203 @@ out QueryExpressionJoinVBClause joinClause) {
Expect(146);
CollectionRangeVariableDeclaration(
-#line 2562 "VBNET.ATG"
+#line 2565 "VBNET.ATG"
out joinVariable);
-#line 2563 "VBNET.ATG"
+#line 2566 "VBNET.ATG"
joinClause.JoinVariable = joinVariable;
if (la.kind == 146) {
JoinQueryOperator(
-#line 2565 "VBNET.ATG"
+#line 2568 "VBNET.ATG"
out subJoin);
-#line 2566 "VBNET.ATG"
+#line 2569 "VBNET.ATG"
joinClause.SubJoin = subJoin;
}
Expect(171);
JoinCondition(
-#line 2569 "VBNET.ATG"
+#line 2572 "VBNET.ATG"
out condition);
-#line 2570 "VBNET.ATG"
+#line 2573 "VBNET.ATG"
SafeAdd(joinClause, joinClause.Conditions, condition);
while (la.kind == 60) {
lexer.NextToken();
JoinCondition(
-#line 2572 "VBNET.ATG"
+#line 2575 "VBNET.ATG"
out condition);
-#line 2573 "VBNET.ATG"
+#line 2576 "VBNET.ATG"
SafeAdd(joinClause, joinClause.Conditions, condition);
}
-#line 2576 "VBNET.ATG"
+#line 2579 "VBNET.ATG"
joinClause.EndLocation = t.EndLocation;
}
void GroupJoinQueryOperator(
-#line 2406 "VBNET.ATG"
+#line 2409 "VBNET.ATG"
out QueryExpressionGroupJoinVBClause groupJoinClause) {
-#line 2408 "VBNET.ATG"
+#line 2411 "VBNET.ATG"
groupJoinClause = new QueryExpressionGroupJoinVBClause();
groupJoinClause.StartLocation = la.Location;
QueryExpressionJoinVBClause joinClause = null;
Expect(133);
JoinQueryOperator(
-#line 2412 "VBNET.ATG"
+#line 2415 "VBNET.ATG"
out joinClause);
Expect(143);
ExpressionRangeVariableDeclarationList(
-#line 2413 "VBNET.ATG"
+#line 2416 "VBNET.ATG"
groupJoinClause.IntoVariables);
-#line 2415 "VBNET.ATG"
+#line 2418 "VBNET.ATG"
groupJoinClause.JoinClause = joinClause;
groupJoinClause.EndLocation = t.EndLocation;
}
void GroupByQueryOperator(
-#line 2393 "VBNET.ATG"
+#line 2396 "VBNET.ATG"
out QueryExpressionGroupVBClause groupByClause) {
-#line 2395 "VBNET.ATG"
+#line 2398 "VBNET.ATG"
groupByClause = new QueryExpressionGroupVBClause();
groupByClause.StartLocation = la.Location;
Expect(133);
ExpressionRangeVariableDeclarationList(
-#line 2398 "VBNET.ATG"
+#line 2401 "VBNET.ATG"
groupByClause.GroupVariables);
Expect(70);
ExpressionRangeVariableDeclarationList(
-#line 2399 "VBNET.ATG"
+#line 2402 "VBNET.ATG"
groupByClause.ByVariables);
Expect(143);
ExpressionRangeVariableDeclarationList(
-#line 2400 "VBNET.ATG"
+#line 2403 "VBNET.ATG"
groupByClause.IntoVariables);
-#line 2402 "VBNET.ATG"
+#line 2405 "VBNET.ATG"
groupByClause.EndLocation = t.EndLocation;
}
void OrderExpressionList(
-#line 2362 "VBNET.ATG"
+#line 2365 "VBNET.ATG"
out List orderings) {
-#line 2364 "VBNET.ATG"
+#line 2367 "VBNET.ATG"
orderings = new List();
QueryExpressionOrdering ordering = null;
OrderExpression(
-#line 2367 "VBNET.ATG"
+#line 2370 "VBNET.ATG"
out ordering);
-#line 2368 "VBNET.ATG"
+#line 2371 "VBNET.ATG"
orderings.Add(ordering);
while (la.kind == 22) {
lexer.NextToken();
OrderExpression(
-#line 2370 "VBNET.ATG"
+#line 2373 "VBNET.ATG"
out ordering);
-#line 2371 "VBNET.ATG"
+#line 2374 "VBNET.ATG"
orderings.Add(ordering);
}
}
void OrderExpression(
-#line 2375 "VBNET.ATG"
+#line 2378 "VBNET.ATG"
out QueryExpressionOrdering ordering) {
-#line 2377 "VBNET.ATG"
+#line 2380 "VBNET.ATG"
ordering = new QueryExpressionOrdering();
ordering.StartLocation = la.Location;
ordering.Direction = QueryExpressionOrderingDirection.None;
Expression orderExpr = null;
Expr(
-#line 2382 "VBNET.ATG"
+#line 2385 "VBNET.ATG"
out orderExpr);
-#line 2384 "VBNET.ATG"
+#line 2387 "VBNET.ATG"
ordering.Criteria = orderExpr;
if (la.kind == 64 || la.kind == 104) {
if (la.kind == 64) {
lexer.NextToken();
-#line 2387 "VBNET.ATG"
+#line 2390 "VBNET.ATG"
ordering.Direction = QueryExpressionOrderingDirection.Ascending;
} else {
lexer.NextToken();
-#line 2388 "VBNET.ATG"
+#line 2391 "VBNET.ATG"
ordering.Direction = QueryExpressionOrderingDirection.Descending;
}
}
-#line 2390 "VBNET.ATG"
+#line 2393 "VBNET.ATG"
ordering.EndLocation = t.EndLocation;
}
void ExpressionRangeVariableDeclarationList(
-#line 2521 "VBNET.ATG"
+#line 2524 "VBNET.ATG"
List variables) {
-#line 2523 "VBNET.ATG"
+#line 2526 "VBNET.ATG"
ExpressionRangeVariable variable = null;
ExpressionRangeVariableDeclaration(
-#line 2525 "VBNET.ATG"
+#line 2528 "VBNET.ATG"
out variable);
-#line 2526 "VBNET.ATG"
+#line 2529 "VBNET.ATG"
variables.Add(variable);
while (la.kind == 22) {
lexer.NextToken();
ExpressionRangeVariableDeclaration(
-#line 2527 "VBNET.ATG"
+#line 2530 "VBNET.ATG"
out variable);
-#line 2527 "VBNET.ATG"
+#line 2530 "VBNET.ATG"
variables.Add(variable);
}
}
void CollectionRangeVariableDeclarationList(
-#line 2580 "VBNET.ATG"
+#line 2583 "VBNET.ATG"
List rangeVariables) {
-#line 2581 "VBNET.ATG"
+#line 2584 "VBNET.ATG"
CollectionRangeVariable variableDeclaration;
CollectionRangeVariableDeclaration(
-#line 2583 "VBNET.ATG"
+#line 2586 "VBNET.ATG"
out variableDeclaration);
-#line 2584 "VBNET.ATG"
+#line 2587 "VBNET.ATG"
rangeVariables.Add(variableDeclaration);
while (la.kind == 22) {
lexer.NextToken();
CollectionRangeVariableDeclaration(
-#line 2585 "VBNET.ATG"
+#line 2588 "VBNET.ATG"
out variableDeclaration);
-#line 2585 "VBNET.ATG"
+#line 2588 "VBNET.ATG"
rangeVariables.Add(variableDeclaration);
}
}
void CollectionRangeVariableDeclaration(
-#line 2588 "VBNET.ATG"
+#line 2591 "VBNET.ATG"
out CollectionRangeVariable rangeVariable) {
-#line 2590 "VBNET.ATG"
+#line 2593 "VBNET.ATG"
rangeVariable = new CollectionRangeVariable();
rangeVariable.StartLocation = la.Location;
TypeReference typeName = null;
@@ -6839,71 +6847,71 @@ out CollectionRangeVariable rangeVariable) {
Identifier();
-#line 2595 "VBNET.ATG"
+#line 2598 "VBNET.ATG"
rangeVariable.Identifier = t.val;
if (la.kind == 63) {
lexer.NextToken();
TypeName(
-#line 2596 "VBNET.ATG"
+#line 2599 "VBNET.ATG"
out typeName);
-#line 2596 "VBNET.ATG"
+#line 2599 "VBNET.ATG"
rangeVariable.Type = typeName;
}
Expect(138);
Expr(
-#line 2597 "VBNET.ATG"
+#line 2600 "VBNET.ATG"
out inExpr);
-#line 2599 "VBNET.ATG"
+#line 2602 "VBNET.ATG"
rangeVariable.Expression = inExpr;
rangeVariable.EndLocation = t.EndLocation;
}
void ExpressionRangeVariableDeclaration(
-#line 2530 "VBNET.ATG"
+#line 2533 "VBNET.ATG"
out ExpressionRangeVariable variable) {
-#line 2532 "VBNET.ATG"
+#line 2535 "VBNET.ATG"
variable = new ExpressionRangeVariable();
variable.StartLocation = la.Location;
Expression rhs = null;
TypeReference typeName = null;
if (
-#line 2538 "VBNET.ATG"
+#line 2541 "VBNET.ATG"
IsIdentifiedExpressionRange()) {
Identifier();
-#line 2539 "VBNET.ATG"
+#line 2542 "VBNET.ATG"
variable.Identifier = t.val;
if (la.kind == 63) {
lexer.NextToken();
TypeName(
-#line 2541 "VBNET.ATG"
+#line 2544 "VBNET.ATG"
out typeName);
-#line 2542 "VBNET.ATG"
+#line 2545 "VBNET.ATG"
variable.Type = typeName;
}
Expect(20);
}
Expr(
-#line 2546 "VBNET.ATG"
+#line 2549 "VBNET.ATG"
out rhs);
-#line 2548 "VBNET.ATG"
+#line 2551 "VBNET.ATG"
variable.Expression = rhs;
variable.EndLocation = t.EndLocation;
}
void JoinCondition(
-#line 2604 "VBNET.ATG"
+#line 2607 "VBNET.ATG"
out QueryExpressionJoinConditionVB condition) {
-#line 2606 "VBNET.ATG"
+#line 2609 "VBNET.ATG"
condition = new QueryExpressionJoinConditionVB();
condition.StartLocation = la.Location;
@@ -6911,14 +6919,14 @@ out QueryExpressionJoinConditionVB condition) {
Expression rhs = null;
Expr(
-#line 2612 "VBNET.ATG"
+#line 2615 "VBNET.ATG"
out lhs);
Expect(116);
Expr(
-#line 2612 "VBNET.ATG"
+#line 2615 "VBNET.ATG"
out rhs);
-#line 2614 "VBNET.ATG"
+#line 2617 "VBNET.ATG"
condition.LeftSide = lhs;
condition.RightSide = rhs;
condition.EndLocation = t.EndLocation;
@@ -6926,69 +6934,69 @@ out rhs);
}
void Argument(
-#line 2678 "VBNET.ATG"
+#line 2681 "VBNET.ATG"
out Expression argumentexpr) {
-#line 2680 "VBNET.ATG"
+#line 2683 "VBNET.ATG"
Expression expr;
argumentexpr = null;
string name;
Location startLocation = la.Location;
if (
-#line 2685 "VBNET.ATG"
+#line 2688 "VBNET.ATG"
IsNamedAssign()) {
Identifier();
-#line 2685 "VBNET.ATG"
+#line 2688 "VBNET.ATG"
name = t.val;
Expect(55);
Expr(
-#line 2685 "VBNET.ATG"
+#line 2688 "VBNET.ATG"
out expr);
-#line 2687 "VBNET.ATG"
+#line 2690 "VBNET.ATG"
argumentexpr = new NamedArgumentExpression(name, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
} else if (StartOf(24)) {
Expr(
-#line 2690 "VBNET.ATG"
+#line 2693 "VBNET.ATG"
out argumentexpr);
} else SynErr(308);
}
void QualIdentAndTypeArguments(
-#line 2758 "VBNET.ATG"
+#line 2761 "VBNET.ATG"
out TypeReference typeref, bool canBeUnbound) {
-#line 2759 "VBNET.ATG"
+#line 2762 "VBNET.ATG"
string name; typeref = null;
Qualident(
-#line 2761 "VBNET.ATG"
+#line 2764 "VBNET.ATG"
out name);
-#line 2762 "VBNET.ATG"
+#line 2765 "VBNET.ATG"
typeref = new TypeReference(name);
if (
-#line 2763 "VBNET.ATG"
+#line 2766 "VBNET.ATG"
la.kind == Tokens.OpenParenthesis && Peek(1).kind == Tokens.Of) {
lexer.NextToken();
Expect(169);
if (
-#line 2765 "VBNET.ATG"
+#line 2768 "VBNET.ATG"
canBeUnbound && (la.kind == Tokens.CloseParenthesis || la.kind == Tokens.Comma)) {
-#line 2766 "VBNET.ATG"
+#line 2769 "VBNET.ATG"
typeref.GenericTypes.Add(NullTypeReference.Instance);
while (la.kind == 22) {
lexer.NextToken();
-#line 2767 "VBNET.ATG"
+#line 2770 "VBNET.ATG"
typeref.GenericTypes.Add(NullTypeReference.Instance);
}
} else if (StartOf(8)) {
TypeArgumentList(
-#line 2768 "VBNET.ATG"
+#line 2771 "VBNET.ATG"
typeref.GenericTypes);
} else SynErr(309);
Expect(38);
@@ -6996,24 +7004,24 @@ typeref.GenericTypes);
}
void RankList(
-#line 2805 "VBNET.ATG"
+#line 2808 "VBNET.ATG"
out int i) {
-#line 2806 "VBNET.ATG"
+#line 2809 "VBNET.ATG"
i = 0;
while (la.kind == 22) {
lexer.NextToken();
-#line 2807 "VBNET.ATG"
+#line 2810 "VBNET.ATG"
++i;
}
}
void Attribute(
-#line 2846 "VBNET.ATG"
+#line 2849 "VBNET.ATG"
out ASTAttribute attribute) {
-#line 2848 "VBNET.ATG"
+#line 2851 "VBNET.ATG"
string name;
List positional = new List();
List named = new List();
@@ -7024,43 +7032,43 @@ out ASTAttribute attribute) {
Expect(26);
}
Qualident(
-#line 2854 "VBNET.ATG"
+#line 2857 "VBNET.ATG"
out name);
if (la.kind == 37) {
AttributeArguments(
-#line 2855 "VBNET.ATG"
+#line 2858 "VBNET.ATG"
positional, named);
}
-#line 2857 "VBNET.ATG"
+#line 2860 "VBNET.ATG"
attribute = new ASTAttribute(name, positional, named) { StartLocation = startLocation, EndLocation = t.EndLocation };
}
void AttributeArguments(
-#line 2862 "VBNET.ATG"
+#line 2865 "VBNET.ATG"
List positional, List named) {
-#line 2864 "VBNET.ATG"
+#line 2867 "VBNET.ATG"
bool nameFound = false;
string name = "";
Expression expr;
Expect(37);
if (
-#line 2870 "VBNET.ATG"
+#line 2873 "VBNET.ATG"
IsNotClosingParenthesis()) {
-#line 2871 "VBNET.ATG"
+#line 2874 "VBNET.ATG"
Location startLocation = la.Location;
if (
-#line 2873 "VBNET.ATG"
+#line 2876 "VBNET.ATG"
IsNamedAssign()) {
-#line 2873 "VBNET.ATG"
+#line 2876 "VBNET.ATG"
nameFound = true;
IdentifierOrKeyword(
-#line 2874 "VBNET.ATG"
+#line 2877 "VBNET.ATG"
out name);
if (la.kind == 55) {
lexer.NextToken();
@@ -7069,10 +7077,10 @@ out name);
} else SynErr(310);
}
Expr(
-#line 2876 "VBNET.ATG"
+#line 2879 "VBNET.ATG"
out expr);
-#line 2878 "VBNET.ATG"
+#line 2881 "VBNET.ATG"
if (expr != null) {
if (string.IsNullOrEmpty(name)) { positional.Add(expr); }
else { named.Add(new NamedArgumentExpression(name, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }); name = ""; }
@@ -7081,13 +7089,13 @@ out expr);
while (la.kind == 22) {
lexer.NextToken();
if (
-#line 2886 "VBNET.ATG"
+#line 2889 "VBNET.ATG"
IsNamedAssign()) {
-#line 2886 "VBNET.ATG"
+#line 2889 "VBNET.ATG"
nameFound = true;
IdentifierOrKeyword(
-#line 2887 "VBNET.ATG"
+#line 2890 "VBNET.ATG"
out name);
if (la.kind == 55) {
lexer.NextToken();
@@ -7096,14 +7104,14 @@ out name);
} else SynErr(311);
} else if (StartOf(24)) {
-#line 2889 "VBNET.ATG"
+#line 2892 "VBNET.ATG"
if (nameFound) Error("no positional argument after named argument");
} else SynErr(312);
Expr(
-#line 2890 "VBNET.ATG"
+#line 2893 "VBNET.ATG"
out expr);
-#line 2890 "VBNET.ATG"
+#line 2893 "VBNET.ATG"
if (expr != null) { if(name == "") positional.Add(expr);
else { named.Add(new NamedArgumentExpression(name, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }); name = ""; }
}
@@ -7114,34 +7122,34 @@ out expr);
}
void ParameterModifier(
-#line 3701 "VBNET.ATG"
+#line 3704 "VBNET.ATG"
ParamModifierList m) {
if (la.kind == 72) {
lexer.NextToken();
-#line 3702 "VBNET.ATG"
+#line 3705 "VBNET.ATG"
m.Add(ParameterModifiers.In);
} else if (la.kind == 69) {
lexer.NextToken();
-#line 3703 "VBNET.ATG"
+#line 3706 "VBNET.ATG"
m.Add(ParameterModifiers.Ref);
} else if (la.kind == 174) {
lexer.NextToken();
-#line 3704 "VBNET.ATG"
+#line 3707 "VBNET.ATG"
m.Add(ParameterModifiers.Optional);
} else if (la.kind == 182) {
lexer.NextToken();
-#line 3705 "VBNET.ATG"
+#line 3708 "VBNET.ATG"
m.Add(ParameterModifiers.Params);
} else SynErr(313);
}
void Statement() {
-#line 3017 "VBNET.ATG"
+#line 3020 "VBNET.ATG"
Statement stmt = null;
Location startPos = la.Location;
string label = String.Empty;
@@ -7149,27 +7157,27 @@ ParamModifierList m) {
if (la.kind == 1 || la.kind == 21) {
} else if (
-#line 3023 "VBNET.ATG"
+#line 3026 "VBNET.ATG"
IsLabel()) {
LabelName(
-#line 3023 "VBNET.ATG"
+#line 3026 "VBNET.ATG"
out label);
-#line 3025 "VBNET.ATG"
+#line 3028 "VBNET.ATG"
AddChild(new LabelStatement(t.val));
Expect(21);
Statement();
} else if (StartOf(49)) {
EmbeddedStatement(
-#line 3028 "VBNET.ATG"
+#line 3031 "VBNET.ATG"
out stmt);
-#line 3028 "VBNET.ATG"
+#line 3031 "VBNET.ATG"
AddChild(stmt);
} else SynErr(314);
-#line 3031 "VBNET.ATG"
+#line 3034 "VBNET.ATG"
if (stmt != null) {
stmt.StartLocation = startPos;
stmt.EndLocation = t.Location;
@@ -7178,30 +7186,30 @@ out stmt);
}
void LabelName(
-#line 3471 "VBNET.ATG"
+#line 3474 "VBNET.ATG"
out string name) {
-#line 3473 "VBNET.ATG"
+#line 3476 "VBNET.ATG"
name = String.Empty;
if (StartOf(4)) {
Identifier();
-#line 3475 "VBNET.ATG"
+#line 3478 "VBNET.ATG"
name = t.val;
} else if (la.kind == 5) {
lexer.NextToken();
-#line 3476 "VBNET.ATG"
+#line 3479 "VBNET.ATG"
name = t.val;
} else SynErr(315);
}
void LocalDeclarationStatement(
-#line 3039 "VBNET.ATG"
+#line 3042 "VBNET.ATG"
out Statement statement) {
-#line 3041 "VBNET.ATG"
+#line 3044 "VBNET.ATG"
ModifierList m = new ModifierList();
LocalVariableDeclaration localVariableDeclaration;
bool dimfound = false;
@@ -7210,22 +7218,22 @@ out Statement statement) {
if (la.kind == 88) {
lexer.NextToken();
-#line 3047 "VBNET.ATG"
+#line 3050 "VBNET.ATG"
m.Add(Modifiers.Const, t.Location);
} else if (la.kind == 204) {
lexer.NextToken();
-#line 3048 "VBNET.ATG"
+#line 3051 "VBNET.ATG"
m.Add(Modifiers.Static, t.Location);
} else {
lexer.NextToken();
-#line 3049 "VBNET.ATG"
+#line 3052 "VBNET.ATG"
dimfound = true;
}
}
-#line 3052 "VBNET.ATG"
+#line 3055 "VBNET.ATG"
if(dimfound && (m.Modifier & Modifiers.Const) != 0) {
Error("Dim is not allowed on constants.");
}
@@ -7238,135 +7246,135 @@ out Statement statement) {
localVariableDeclaration.StartLocation = t.Location;
VariableDeclarator(
-#line 3063 "VBNET.ATG"
+#line 3066 "VBNET.ATG"
localVariableDeclaration.Variables);
while (la.kind == 22) {
lexer.NextToken();
VariableDeclarator(
-#line 3064 "VBNET.ATG"
+#line 3067 "VBNET.ATG"
localVariableDeclaration.Variables);
}
-#line 3066 "VBNET.ATG"
+#line 3069 "VBNET.ATG"
statement = localVariableDeclaration;
}
void TryStatement(
-#line 3589 "VBNET.ATG"
+#line 3592 "VBNET.ATG"
out Statement tryStatement) {
-#line 3591 "VBNET.ATG"
+#line 3594 "VBNET.ATG"
Statement blockStmt = null, finallyStmt = null;List catchClauses = null;
Expect(218);
EndOfStmt();
Block(
-#line 3594 "VBNET.ATG"
+#line 3597 "VBNET.ATG"
out blockStmt);
if (la.kind == 75 || la.kind == 113 || la.kind == 123) {
CatchClauses(
-#line 3595 "VBNET.ATG"
+#line 3598 "VBNET.ATG"
out catchClauses);
}
if (la.kind == 123) {
lexer.NextToken();
EndOfStmt();
Block(
-#line 3596 "VBNET.ATG"
+#line 3599 "VBNET.ATG"
out finallyStmt);
}
Expect(113);
Expect(218);
-#line 3599 "VBNET.ATG"
+#line 3602 "VBNET.ATG"
tryStatement = new TryCatchStatement(blockStmt, catchClauses, finallyStmt);
}
void WithStatement(
-#line 3569 "VBNET.ATG"
+#line 3572 "VBNET.ATG"
out Statement withStatement) {
-#line 3571 "VBNET.ATG"
+#line 3574 "VBNET.ATG"
Statement blockStmt = null;
Expression expr = null;
Expect(233);
-#line 3574 "VBNET.ATG"
+#line 3577 "VBNET.ATG"
Location start = t.Location;
Expr(
-#line 3575 "VBNET.ATG"
+#line 3578 "VBNET.ATG"
out expr);
EndOfStmt();
-#line 3577 "VBNET.ATG"
+#line 3580 "VBNET.ATG"
withStatement = new WithStatement(expr);
withStatement.StartLocation = start;
Block(
-#line 3580 "VBNET.ATG"
+#line 3583 "VBNET.ATG"
out blockStmt);
-#line 3582 "VBNET.ATG"
+#line 3585 "VBNET.ATG"
((WithStatement)withStatement).Body = (BlockStatement)blockStmt;
Expect(113);
Expect(233);
-#line 3585 "VBNET.ATG"
+#line 3588 "VBNET.ATG"
withStatement.EndLocation = t.Location;
}
void WhileOrUntil(
-#line 3562 "VBNET.ATG"
+#line 3565 "VBNET.ATG"
out ConditionType conditionType) {
-#line 3563 "VBNET.ATG"
+#line 3566 "VBNET.ATG"
conditionType = ConditionType.None;
if (la.kind == 231) {
lexer.NextToken();
-#line 3564 "VBNET.ATG"
+#line 3567 "VBNET.ATG"
conditionType = ConditionType.While;
} else if (la.kind == 224) {
lexer.NextToken();
-#line 3565 "VBNET.ATG"
+#line 3568 "VBNET.ATG"
conditionType = ConditionType.Until;
} else SynErr(316);
}
void LoopControlVariable(
-#line 3393 "VBNET.ATG"
+#line 3396 "VBNET.ATG"
out TypeReference type, out string name) {
-#line 3394 "VBNET.ATG"
+#line 3397 "VBNET.ATG"
ArrayList arrayModifiers = null;
type = null;
Qualident(
-#line 3398 "VBNET.ATG"
+#line 3401 "VBNET.ATG"
out name);
if (
-#line 3399 "VBNET.ATG"
+#line 3402 "VBNET.ATG"
IsDims()) {
ArrayTypeModifiers(
-#line 3399 "VBNET.ATG"
+#line 3402 "VBNET.ATG"
out arrayModifiers);
}
if (la.kind == 63) {
lexer.NextToken();
TypeName(
-#line 3400 "VBNET.ATG"
+#line 3403 "VBNET.ATG"
out type);
-#line 3400 "VBNET.ATG"
+#line 3403 "VBNET.ATG"
if (name.IndexOf('.') > 0) { Error("No type def for 'for each' member indexer allowed."); }
}
-#line 3402 "VBNET.ATG"
+#line 3405 "VBNET.ATG"
if (type != null) {
if(type.RankSpecifier != null && arrayModifiers != null) {
Error("array rank only allowed one time");
@@ -7378,34 +7386,34 @@ out type);
}
void ReDimClause(
-#line 3480 "VBNET.ATG"
+#line 3483 "VBNET.ATG"
out Expression expr) {
SimpleNonInvocationExpression(
-#line 3482 "VBNET.ATG"
+#line 3485 "VBNET.ATG"
out expr);
ReDimClauseInternal(
-#line 3483 "VBNET.ATG"
+#line 3486 "VBNET.ATG"
ref expr);
}
void SingleLineStatementList(
-#line 3379 "VBNET.ATG"
+#line 3382 "VBNET.ATG"
List list) {
-#line 3380 "VBNET.ATG"
+#line 3383 "VBNET.ATG"
Statement embeddedStatement = null;
if (la.kind == 113) {
lexer.NextToken();
-#line 3382 "VBNET.ATG"
+#line 3385 "VBNET.ATG"
embeddedStatement = new EndStatement() { StartLocation = t.Location, EndLocation = t.EndLocation };
} else if (StartOf(49)) {
EmbeddedStatement(
-#line 3383 "VBNET.ATG"
+#line 3386 "VBNET.ATG"
out embeddedStatement);
} else SynErr(317);
-#line 3384 "VBNET.ATG"
+#line 3387 "VBNET.ATG"
if (embeddedStatement != null) list.Add(embeddedStatement);
while (la.kind == 21) {
lexer.NextToken();
@@ -7415,49 +7423,49 @@ out embeddedStatement);
if (la.kind == 113) {
lexer.NextToken();
-#line 3386 "VBNET.ATG"
+#line 3389 "VBNET.ATG"
embeddedStatement = new EndStatement() { StartLocation = t.Location, EndLocation = t.EndLocation };
} else if (StartOf(49)) {
EmbeddedStatement(
-#line 3387 "VBNET.ATG"
+#line 3390 "VBNET.ATG"
out embeddedStatement);
} else SynErr(318);
-#line 3388 "VBNET.ATG"
+#line 3391 "VBNET.ATG"
if (embeddedStatement != null) list.Add(embeddedStatement);
}
}
void CaseClauses(
-#line 3522 "VBNET.ATG"
+#line 3525 "VBNET.ATG"
out List caseClauses) {
-#line 3524 "VBNET.ATG"
+#line 3527 "VBNET.ATG"
caseClauses = new List();
CaseLabel caseClause = null;
CaseClause(
-#line 3527 "VBNET.ATG"
+#line 3530 "VBNET.ATG"
out caseClause);
-#line 3527 "VBNET.ATG"
+#line 3530 "VBNET.ATG"
if (caseClause != null) { caseClauses.Add(caseClause); }
while (la.kind == 22) {
lexer.NextToken();
CaseClause(
-#line 3528 "VBNET.ATG"
+#line 3531 "VBNET.ATG"
out caseClause);
-#line 3528 "VBNET.ATG"
+#line 3531 "VBNET.ATG"
if (caseClause != null) { caseClauses.Add(caseClause); }
}
}
void OnErrorStatement(
-#line 3413 "VBNET.ATG"
+#line 3416 "VBNET.ATG"
out OnErrorStatement stmt) {
-#line 3415 "VBNET.ATG"
+#line 3418 "VBNET.ATG"
stmt = null;
Location startLocation = la.Location;
GotoStatement goToStatement = null;
@@ -7465,13 +7473,13 @@ out OnErrorStatement stmt) {
Expect(171);
Expect(118);
if (
-#line 3422 "VBNET.ATG"
+#line 3425 "VBNET.ATG"
IsNegativeLabelName()) {
Expect(132);
Expect(30);
Expect(5);
-#line 3424 "VBNET.ATG"
+#line 3427 "VBNET.ATG"
long intLabel = Int64.Parse(t.val);
if(intLabel != 1) {
Error("invalid label in on error statement.");
@@ -7480,10 +7488,10 @@ IsNegativeLabelName()) {
} else if (la.kind == 132) {
GotoStatement(
-#line 3430 "VBNET.ATG"
+#line 3433 "VBNET.ATG"
out goToStatement);
-#line 3432 "VBNET.ATG"
+#line 3435 "VBNET.ATG"
string val = goToStatement.Label;
// if value is numeric, make sure that is 0
@@ -7500,12 +7508,12 @@ out goToStatement);
lexer.NextToken();
Expect(163);
-#line 3446 "VBNET.ATG"
+#line 3449 "VBNET.ATG"
stmt = new OnErrorStatement(new ResumeStatement(true));
} else SynErr(319);
-#line 3450 "VBNET.ATG"
+#line 3453 "VBNET.ATG"
if (stmt != null) {
stmt.StartLocation = startLocation;
stmt.EndLocation = t.EndLocation;
@@ -7514,17 +7522,17 @@ out goToStatement);
}
void GotoStatement(
-#line 3458 "VBNET.ATG"
+#line 3461 "VBNET.ATG"
out GotoStatement goToStatement) {
-#line 3459 "VBNET.ATG"
+#line 3462 "VBNET.ATG"
string label = String.Empty; Location startLocation = la.Location;
Expect(132);
LabelName(
-#line 3461 "VBNET.ATG"
+#line 3464 "VBNET.ATG"
out label);
-#line 3463 "VBNET.ATG"
+#line 3466 "VBNET.ATG"
goToStatement = new GotoStatement(label) {
StartLocation = startLocation,
EndLocation = t.EndLocation
@@ -7533,57 +7541,57 @@ out label);
}
void ResumeStatement(
-#line 3511 "VBNET.ATG"
+#line 3514 "VBNET.ATG"
out ResumeStatement resumeStatement) {
-#line 3513 "VBNET.ATG"
+#line 3516 "VBNET.ATG"
resumeStatement = null;
string label = String.Empty;
if (
-#line 3516 "VBNET.ATG"
+#line 3519 "VBNET.ATG"
IsResumeNext()) {
Expect(194);
Expect(163);
-#line 3517 "VBNET.ATG"
+#line 3520 "VBNET.ATG"
resumeStatement = new ResumeStatement(true);
} else if (la.kind == 194) {
lexer.NextToken();
if (StartOf(50)) {
LabelName(
-#line 3518 "VBNET.ATG"
+#line 3521 "VBNET.ATG"
out label);
}
-#line 3518 "VBNET.ATG"
+#line 3521 "VBNET.ATG"
resumeStatement = new ResumeStatement(label);
} else SynErr(320);
}
void ReDimClauseInternal(
-#line 3486 "VBNET.ATG"
+#line 3489 "VBNET.ATG"
ref Expression expr) {
-#line 3487 "VBNET.ATG"
+#line 3490 "VBNET.ATG"
List arguments; bool canBeNormal; bool canBeRedim; string name; Location startLocation = la.Location;
while (la.kind == 26 ||
-#line 3490 "VBNET.ATG"
+#line 3493 "VBNET.ATG"
la.kind == Tokens.OpenParenthesis && Peek(1).kind == Tokens.Of) {
if (la.kind == 26) {
lexer.NextToken();
IdentifierOrKeyword(
-#line 3489 "VBNET.ATG"
+#line 3492 "VBNET.ATG"
out name);
-#line 3489 "VBNET.ATG"
+#line 3492 "VBNET.ATG"
expr = new MemberReferenceExpression(expr, name) { StartLocation = startLocation, EndLocation = t.EndLocation };
} else {
InvocationExpression(
-#line 3491 "VBNET.ATG"
+#line 3494 "VBNET.ATG"
ref expr);
-#line 3493 "VBNET.ATG"
+#line 3496 "VBNET.ATG"
expr.StartLocation = startLocation;
expr.EndLocation = t.EndLocation;
@@ -7591,11 +7599,11 @@ ref expr);
}
Expect(37);
NormalOrReDimArgumentList(
-#line 3498 "VBNET.ATG"
+#line 3501 "VBNET.ATG"
out arguments, out canBeNormal, out canBeRedim);
Expect(38);
-#line 3500 "VBNET.ATG"
+#line 3503 "VBNET.ATG"
expr = new InvocationExpression(expr, arguments);
if (canBeRedim == false || canBeNormal && (la.kind == Tokens.Dot || la.kind == Tokens.OpenParenthesis)) {
if (this.Errors.Count == 0) {
@@ -7607,10 +7615,10 @@ out arguments, out canBeNormal, out canBeRedim);
}
void CaseClause(
-#line 3532 "VBNET.ATG"
+#line 3535 "VBNET.ATG"
out CaseLabel caseClause) {
-#line 3534 "VBNET.ATG"
+#line 3537 "VBNET.ATG"
Expression expr = null;
Expression sexpr = null;
BinaryOperatorType op = BinaryOperatorType.None;
@@ -7619,7 +7627,7 @@ out CaseLabel caseClause) {
if (la.kind == 111) {
lexer.NextToken();
-#line 3540 "VBNET.ATG"
+#line 3543 "VBNET.ATG"
caseClause = new CaseLabel();
} else if (StartOf(51)) {
if (la.kind == 144) {
@@ -7629,76 +7637,76 @@ out CaseLabel caseClause) {
case 40: {
lexer.NextToken();
-#line 3544 "VBNET.ATG"
+#line 3547 "VBNET.ATG"
op = BinaryOperatorType.LessThan;
break;
}
case 39: {
lexer.NextToken();
-#line 3545 "VBNET.ATG"
+#line 3548 "VBNET.ATG"
op = BinaryOperatorType.GreaterThan;
break;
}
case 43: {
lexer.NextToken();
-#line 3546 "VBNET.ATG"
+#line 3549 "VBNET.ATG"
op = BinaryOperatorType.LessThanOrEqual;
break;
}
case 42: {
lexer.NextToken();
-#line 3547 "VBNET.ATG"
+#line 3550 "VBNET.ATG"
op = BinaryOperatorType.GreaterThanOrEqual;
break;
}
case 20: {
lexer.NextToken();
-#line 3548 "VBNET.ATG"
+#line 3551 "VBNET.ATG"
op = BinaryOperatorType.Equality;
break;
}
case 41: {
lexer.NextToken();
-#line 3549 "VBNET.ATG"
+#line 3552 "VBNET.ATG"
op = BinaryOperatorType.InEquality;
break;
}
default: SynErr(321); break;
}
Expr(
-#line 3551 "VBNET.ATG"
+#line 3554 "VBNET.ATG"
out expr);
-#line 3553 "VBNET.ATG"
+#line 3556 "VBNET.ATG"
caseClause = new CaseLabel(op, expr);
} else if (StartOf(24)) {
Expr(
-#line 3555 "VBNET.ATG"
+#line 3558 "VBNET.ATG"
out expr);
if (la.kind == 216) {
lexer.NextToken();
Expr(
-#line 3555 "VBNET.ATG"
+#line 3558 "VBNET.ATG"
out sexpr);
}
-#line 3557 "VBNET.ATG"
+#line 3560 "VBNET.ATG"
caseClause = new CaseLabel(expr, sexpr);
} else SynErr(322);
}
void CatchClauses(
-#line 3604 "VBNET.ATG"
+#line 3607 "VBNET.ATG"
out List catchClauses) {
-#line 3606 "VBNET.ATG"
+#line 3609 "VBNET.ATG"
catchClauses = new List();
TypeReference type = null;
Statement blockStmt = null;
@@ -7710,27 +7718,27 @@ out List catchClauses) {
if (StartOf(4)) {
Identifier();
-#line 3614 "VBNET.ATG"
+#line 3617 "VBNET.ATG"
name = t.val;
if (la.kind == 63) {
lexer.NextToken();
TypeName(
-#line 3614 "VBNET.ATG"
+#line 3617 "VBNET.ATG"
out type);
}
}
if (la.kind == 229) {
lexer.NextToken();
Expr(
-#line 3615 "VBNET.ATG"
+#line 3618 "VBNET.ATG"
out expr);
}
EndOfStmt();
Block(
-#line 3617 "VBNET.ATG"
+#line 3620 "VBNET.ATG"
out blockStmt);
-#line 3618 "VBNET.ATG"
+#line 3621 "VBNET.ATG"
catchClauses.Add(new CatchClause(type, name, blockStmt, expr));
}
}
diff --git a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG
index ed814fad0b..75548a906f 100644
--- a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG
+++ b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG
@@ -1263,6 +1263,7 @@ StructureMemberDecl attributes>
Parameters = parameters,
TypeReference = returnType,
OverloadableOperator = operatorType,
+ Name = GetReflectionNameForOperator(operatorType, opConversionType),
ConversionType = opConversionType,
Body = (BlockStatement)stmt,
StartLocation = m.GetDeclarationLocation(startPos),
@@ -1299,6 +1300,8 @@ OverloadableOperator
|
"Xor" (. operatorType = OverloadableOperatorType.ExclusiveOr; .)
|
+ "Not" (. operatorType = OverloadableOperatorType.BitNot; .)
+ |
"^" (. operatorType = OverloadableOperatorType.Power; .)
|
"<<" (. operatorType = OverloadableOperatorType.ShiftLeft; .)
diff --git a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNetParser.cs b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNetParser.cs
index 2765fa7e74..ca7aca494c 100644
--- a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNetParser.cs
+++ b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNetParser.cs
@@ -300,6 +300,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
// look for attributes
while (tn.kind == Tokens.LessThan) {
while (braceCount > 0 || tn.kind != Tokens.GreaterThan) {
+ if (tn.kind == Tokens.EOF) return false;
tn = lexer.Peek();
if (tn.kind == Tokens.OpenParenthesis)
braceCount++;
@@ -384,5 +385,74 @@ namespace ICSharpCode.NRefactory.Parser.VB
item.Parent = parent;
}
}
+
+ internal static string GetReflectionNameForOperator(OverloadableOperatorType op, ConversionType conversion)
+ {
+ switch (op) {
+ case OverloadableOperatorType.Add:
+ return "op_Addition";
+ case OverloadableOperatorType.BitNot:
+ return "op_OnesComplement";
+ case OverloadableOperatorType.BitwiseAnd:
+ return "op_BitwiseAnd";
+ case OverloadableOperatorType.BitwiseOr:
+ return "op_BitwiseOr";
+ case OverloadableOperatorType.Concat:
+ return "op_Concatenate";
+ case OverloadableOperatorType.CType:
+ switch (conversion) {
+ case ConversionType.Implicit:
+ return "op_Implicit";
+ case ConversionType.Explicit:
+ return "op_Explicit";
+ default:
+ return "op_unknown";
+ }
+ case OverloadableOperatorType.Divide:
+ return "op_Division";
+ case OverloadableOperatorType.DivideInteger:
+ return "op_IntegerDivision";
+ case OverloadableOperatorType.Equality:
+ return "op_Equality";
+ case OverloadableOperatorType.ExclusiveOr:
+ return "op_ExclusiveOr";
+ case OverloadableOperatorType.GreaterThan:
+ return "op_GreaterThan";
+ case OverloadableOperatorType.GreaterThanOrEqual:
+ return "op_GreaterThanOrEqual";
+ case OverloadableOperatorType.InEquality:
+ return "op_Inequality";
+ case OverloadableOperatorType.IsFalse:
+ return "op_False";
+ case OverloadableOperatorType.IsTrue:
+ return "op_True";
+ case OverloadableOperatorType.LessThan:
+ return "op_LessThan";
+ case OverloadableOperatorType.LessThanOrEqual:
+ return "op_LessThanOrEqual";
+ case OverloadableOperatorType.Like:
+ return "op_Like";
+ case OverloadableOperatorType.Modulus:
+ return "op_Modulus";
+ case OverloadableOperatorType.Multiply:
+ return "op_Multiply";
+ case OverloadableOperatorType.Not:
+ return "op_LogicalNot";
+ case OverloadableOperatorType.Power:
+ return "op_Exponent";
+ case OverloadableOperatorType.ShiftLeft:
+ return "op_LeftShift";
+ case OverloadableOperatorType.ShiftRight:
+ return "op_RightShift";
+ case OverloadableOperatorType.Subtract:
+ return "op_Subtraction";
+ case OverloadableOperatorType.UnaryMinus:
+ return "op_UnaryNegation";
+ case OverloadableOperatorType.UnaryPlus:
+ return "op_UnaryPlus";
+ default:
+ return "op_unknown";
+ }
+ }
}
}
diff --git a/src/Libraries/NRefactory/Test/Lexer/CSharp/NumberLexerTest.cs b/src/Libraries/NRefactory/Test/Lexer/CSharp/NumberLexerTest.cs
index c317f51390..43bd4698d1 100644
--- a/src/Libraries/NRefactory/Test/Lexer/CSharp/NumberLexerTest.cs
+++ b/src/Libraries/NRefactory/Test/Lexer/CSharp/NumberLexerTest.cs
@@ -173,5 +173,16 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.CSharp
CheckToken(@"'\x0041'", '\x0041');
CheckToken(@"'\U00000041'", '\U00000041');
}
+
+ [Test]
+ public void TestInvalidStringLiteral2()
+ {
+ ILexer l = GenerateLexer(new StringReader(@"""\u{0}"""));
+ Token t = l.NextToken();
+ Assert.AreEqual(Tokens.Literal, t.Kind);
+ Assert.AreEqual(new Location(1, 1), t.Location);
+ Assert.AreEqual(new Location(8, 1), t.EndLocation);
+ Assert.AreEqual(1, l.Errors.Count);
+ }
}
}
diff --git a/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs b/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs
index 508c5e945f..2812375b11 100644
--- a/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs
+++ b/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
@@ -21,9 +21,10 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
-
using ICSharpCode.NRefactory.CSharp.Resolver;
+using ICSharpCode.NRefactory.CSharp.TypeSystem;
using ICSharpCode.NRefactory.Semantics;
+using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
namespace ICSharpCode.NRefactory.CSharp.Analysis
@@ -112,7 +113,7 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis
/// Gets the try-finally statements that this control flow edge is leaving.
///
public IEnumerable TryFinallyStatements {
- get { return jumpOutOfTryFinally ?? EmptyList.Instance; }
+ get { return jumpOutOfTryFinally ?? Enumerable.Empty(); }
}
}
@@ -156,7 +157,8 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis
}
Statement rootStatement;
- CSharpAstResolver resolver;
+ CSharpTypeResolveContext typeResolveContext;
+ Func resolver;
List nodes;
Dictionary labels;
List gotoStatements;
@@ -164,6 +166,8 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis
public IList BuildControlFlowGraph(Statement statement, CancellationToken cancellationToken = default(CancellationToken))
{
+ if (statement == null)
+ throw new ArgumentNullException("statement");
CSharpResolver r = new CSharpResolver(MinimalCorlib.Instance.CreateCompilation());
return BuildControlFlowGraph(statement, new CSharpAstResolver(r, statement), cancellationToken);
}
@@ -174,7 +178,11 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis
throw new ArgumentNullException("statement");
if (resolver == null)
throw new ArgumentNullException("resolver");
-
+ return BuildControlFlowGraph(statement, resolver.Resolve, resolver.TypeResolveContext, cancellationToken);
+ }
+
+ internal IList BuildControlFlowGraph(Statement statement, Func resolver, CSharpTypeResolveContext typeResolveContext, CancellationToken cancellationToken)
+ {
NodeCreationVisitor nodeCreationVisitor = new NodeCreationVisitor();
nodeCreationVisitor.builder = this;
try {
@@ -183,6 +191,7 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis
this.gotoStatements = new List();
this.rootStatement = statement;
this.resolver = resolver;
+ this.typeResolveContext = typeResolveContext;
this.cancellationToken = cancellationToken;
ControlFlowNode entryPoint = CreateStartNode(statement);
@@ -205,6 +214,7 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis
this.gotoStatements = null;
this.rootStatement = null;
this.resolver = null;
+ this.typeResolveContext = null;
this.cancellationToken = CancellationToken.None;
}
}
@@ -288,7 +298,7 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis
if (!(expr is PrimitiveExpression || expr is NullReferenceExpression))
return null;
}
- return resolver.Resolve(expr, cancellationToken);
+ return resolver(expr, cancellationToken);
}
///
@@ -308,7 +318,7 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis
{
if (c1 == null || c2 == null || !c1.IsCompileTimeConstant || !c2.IsCompileTimeConstant)
return false;
- CSharpResolver r = new CSharpResolver(resolver.TypeResolveContext);
+ CSharpResolver r = new CSharpResolver(typeResolveContext);
ResolveResult c = r.ResolveBinaryOperator(BinaryOperatorType.Equality, c1, c2);
return c.IsCompileTimeConstant && (c.ConstantValue as bool?) == true;
}
@@ -410,7 +420,8 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis
falseEnd = ifElseStatement.FalseStatement.AcceptVisitor(this, falseBegin);
}
ControlFlowNode end = builder.CreateEndNode(ifElseStatement);
- Connect(trueEnd, end);
+ if (trueEnd != null)
+ Connect(trueEnd, end);
if (falseEnd != null) {
Connect(falseEnd, end);
} else if (cond != true) {
diff --git a/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Analysis/DefiniteAssignmentAnalysis.cs b/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Analysis/DefiniteAssignmentAnalysis.cs
index 8d0832bed8..fdcc4d717c 100644
--- a/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Analysis/DefiniteAssignmentAnalysis.cs
+++ b/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Analysis/DefiniteAssignmentAnalysis.cs
@@ -304,54 +304,53 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis
return DefiniteAssignmentStatus.PotentiallyAssigned;
}
- void ChangeNodeStatus(DefiniteAssignmentNode node, DefiniteAssignmentStatus inputStatus)
+ void ChangeNodeStatus (DefiniteAssignmentNode node, DefiniteAssignmentStatus inputStatus)
{
if (node.NodeStatus == inputStatus)
return;
node.NodeStatus = inputStatus;
DefiniteAssignmentStatus outputStatus;
switch (node.Type) {
- case ControlFlowNodeType.StartNode:
- case ControlFlowNodeType.BetweenStatements:
- if (node.NextStatement is IfElseStatement) {
- // Handle if-else as a condition node
+ case ControlFlowNodeType.StartNode:
+ case ControlFlowNodeType.BetweenStatements:
+ if (node.NextStatement is IfElseStatement) {
+ // Handle if-else as a condition node
goto case ControlFlowNodeType.LoopCondition;
- }
- if (inputStatus == DefiniteAssignmentStatus.DefinitelyAssigned) {
- // There isn't any way to un-assign variables, so we don't have to check the expression
- // if the status already is definitely assigned.
- outputStatus = DefiniteAssignmentStatus.DefinitelyAssigned;
- } else {
- outputStatus = CleanSpecialValues(node.NextStatement.AcceptVisitor(visitor, inputStatus));
- }
- break;
- case ControlFlowNodeType.EndNode:
- outputStatus = inputStatus;
- if (node.PreviousStatement.Role == TryCatchStatement.FinallyBlockRole
- && (outputStatus == DefiniteAssignmentStatus.DefinitelyAssigned || outputStatus == DefiniteAssignmentStatus.PotentiallyAssigned))
- {
- TryCatchStatement tryFinally = (TryCatchStatement)node.PreviousStatement.Parent;
- // Changing the status on a finally block potentially changes the status of all edges leaving that finally block:
- foreach (ControlFlowEdge edge in allNodes.SelectMany(n => n.Outgoing)) {
- if (edge.IsLeavingTryFinally && edge.TryFinallyStatements.Contains(tryFinally)) {
- DefiniteAssignmentStatus s = edgeStatus[edge];
- if (s == DefiniteAssignmentStatus.PotentiallyAssigned) {
- ChangeEdgeStatus(edge, outputStatus);
- }
+ }
+ if (inputStatus == DefiniteAssignmentStatus.DefinitelyAssigned) {
+ // There isn't any way to un-assign variables, so we don't have to check the expression
+ // if the status already is definitely assigned.
+ outputStatus = DefiniteAssignmentStatus.DefinitelyAssigned;
+ } else {
+ outputStatus = CleanSpecialValues (node.NextStatement.AcceptVisitor (visitor, inputStatus));
+ }
+ break;
+ case ControlFlowNodeType.EndNode:
+ outputStatus = inputStatus;
+ if (node.PreviousStatement.Role == TryCatchStatement.FinallyBlockRole
+ && (outputStatus == DefiniteAssignmentStatus.DefinitelyAssigned || outputStatus == DefiniteAssignmentStatus.PotentiallyAssigned)) {
+ TryCatchStatement tryFinally = (TryCatchStatement)node.PreviousStatement.Parent;
+ // Changing the status on a finally block potentially changes the status of all edges leaving that finally block:
+ foreach (ControlFlowEdge edge in allNodes.SelectMany(n => n.Outgoing)) {
+ if (edge.IsLeavingTryFinally && edge.TryFinallyStatements.Contains (tryFinally)) {
+ DefiniteAssignmentStatus s = edgeStatus [edge];
+ if (s == DefiniteAssignmentStatus.PotentiallyAssigned) {
+ ChangeEdgeStatus (edge, outputStatus);
}
}
}
+ }
+ break;
+ case ControlFlowNodeType.LoopCondition:
+ ForeachStatement foreachStmt = node.NextStatement as ForeachStatement;
+ if (foreachStmt != null) {
+ outputStatus = CleanSpecialValues (foreachStmt.InExpression.AcceptVisitor (visitor, inputStatus));
+ if (foreachStmt.VariableName == this.variableName)
+ outputStatus = DefiniteAssignmentStatus.DefinitelyAssigned;
break;
- case ControlFlowNodeType.LoopCondition:
- ForeachStatement foreachStmt = node.NextStatement as ForeachStatement;
- if (foreachStmt != null) {
- outputStatus = CleanSpecialValues(foreachStmt.InExpression.AcceptVisitor(visitor, inputStatus));
- if (foreachStmt.VariableName == this.variableName)
- outputStatus = DefiniteAssignmentStatus.DefinitelyAssigned;
- break;
- } else {
- Debug.Assert(node.NextStatement is IfElseStatement || node.NextStatement is WhileStatement || node.NextStatement is ForStatement || node.NextStatement is DoWhileStatement);
- Expression condition = node.NextStatement.GetChildByRole(AstNode.Roles.Condition);
+ } else {
+ Debug.Assert (node.NextStatement is IfElseStatement || node.NextStatement is WhileStatement || node.NextStatement is ForStatement || node.NextStatement is DoWhileStatement);
+ Expression condition = node.NextStatement.GetChildByRole (Roles.Condition);
if (condition.IsNull)
outputStatus = inputStatus;
else
diff --git a/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ReachabilityAnalysis.cs b/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ReachabilityAnalysis.cs
new file mode 100644
index 0000000000..ebb8d419d3
--- /dev/null
+++ b/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ReachabilityAnalysis.cs
@@ -0,0 +1,91 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this
+// software and associated documentation files (the "Software"), to deal in the Software
+// without restriction, including without limitation the rights to use, copy, modify, merge,
+// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+// to whom the Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or
+// substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using ICSharpCode.NRefactory.CSharp.Resolver;
+using ICSharpCode.NRefactory.CSharp.TypeSystem;
+using ICSharpCode.NRefactory.Semantics;
+
+namespace ICSharpCode.NRefactory.CSharp.Analysis
+{
+ ///
+ /// Statement reachability analysis.
+ ///
+ public sealed class ReachabilityAnalysis
+ {
+ HashSet reachableStatements = new HashSet();
+ HashSet reachableEndPoints = new HashSet();
+ HashSet visitedNodes = new HashSet();
+ Stack stack = new Stack();
+
+ private ReachabilityAnalysis() {}
+
+ public static ReachabilityAnalysis Create(Statement statement, CSharpAstResolver resolver = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var cfgBuilder = new ControlFlowGraphBuilder();
+ var cfg = cfgBuilder.BuildControlFlowGraph(statement, resolver, cancellationToken);
+ return Create(cfg, cancellationToken);
+ }
+
+ internal static ReachabilityAnalysis Create(Statement statement, Func resolver, CSharpTypeResolveContext typeResolveContext, CancellationToken cancellationToken)
+ {
+ var cfgBuilder = new ControlFlowGraphBuilder();
+ var cfg = cfgBuilder.BuildControlFlowGraph(statement, resolver, typeResolveContext, cancellationToken);
+ return Create(cfg, cancellationToken);
+ }
+
+ public static ReachabilityAnalysis Create(IList controlFlowGraph, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (controlFlowGraph == null)
+ throw new ArgumentNullException("controlFlowGraph");
+ ReachabilityAnalysis ra = new ReachabilityAnalysis();
+ ra.stack.Push(controlFlowGraph[0]);
+ while (ra.stack.Count > 0) {
+ cancellationToken.ThrowIfCancellationRequested();
+ ra.MarkReachable(ra.stack.Pop());
+ }
+ ra.stack = null;
+ ra.visitedNodes = null;
+ return ra;
+ }
+
+ void MarkReachable(ControlFlowNode node)
+ {
+ if (node.PreviousStatement != null)
+ reachableEndPoints.Add(node.PreviousStatement);
+ if (node.NextStatement != null)
+ reachableStatements.Add(node.NextStatement);
+ foreach (var edge in node.Outgoing) {
+ if (visitedNodes.Add(edge.To))
+ stack.Push(edge.To);
+ }
+ }
+
+ public bool IsReachable(Statement statement)
+ {
+ return reachableStatements.Contains(statement);
+ }
+
+ public bool IsEndpointReachable(Statement statement)
+ {
+ return reachableEndPoints.Contains(statement);
+ }
+ }
+}
diff --git a/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs b/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs
index b7ea446ef4..bc4d27de03 100644
--- a/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs
+++ b/src/Libraries/NewNRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs
@@ -1,4 +1,4 @@
-//
+//
// AstNode.cs
//
// Author:
@@ -33,8 +33,11 @@ using System.Threading;
namespace ICSharpCode.NRefactory.CSharp
{
- public abstract class AstNode : AbstractAnnotatable, PatternMatching.INode
+ public abstract class AstNode : AbstractAnnotatable, ICSharpCode.NRefactory.TypeSystem.IFreezable, PatternMatching.INode
{
+ // the Root role must be available when creating the null nodes, so we can't put it in the Roles class
+ internal static readonly Role RootRole = new Role ("Root");
+
#region Null
public static readonly AstNode Null = new NullAstNode ();
@@ -52,7 +55,16 @@ namespace ICSharpCode.NRefactory.CSharp
}
}
- public override S AcceptVisitor (IAstVisitor visitor, T data = default(T))
+ public override void AcceptVisitor (IAstVisitor visitor)
+ {
+ }
+
+ public override T AcceptVisitor (IAstVisitor visitor)
+ {
+ return default (T);
+ }
+
+ public override S AcceptVisitor (IAstVisitor visitor, T data)
{
return default (S);
}
@@ -83,7 +95,17 @@ namespace ICSharpCode.NRefactory.CSharp
get { return NodeType.Pattern; }
}
- public override S AcceptVisitor (IAstVisitor visitor, T data = default(T))
+ public override void AcceptVisitor (IAstVisitor visitor)
+ {
+ visitor.VisitPatternPlaceholder (this, child);
+ }
+
+ public override T AcceptVisitor (IAstVisitor visitor)
+ {
+ return visitor.VisitPatternPlaceholder (this, child);
+ }
+
+ public override S AcceptVisitor (IAstVisitor visitor, T data)
{
return visitor.VisitPatternPlaceholder (this, child, data);
}
@@ -105,7 +127,42 @@ namespace ICSharpCode.NRefactory.CSharp
AstNode nextSibling;
AstNode firstChild;
AstNode lastChild;
- Role role = RootRole;
+
+ // Flags, from least significant to most significant bits:
+ // - Role.RoleIndexBits: role index
+ // - 1 bit: IsFrozen
+ protected uint flags = RootRole.Index;
+ // Derived classes may also use a few bits,
+ // for example Identifier uses 1 bit for IsVerbatim
+
+ const uint roleIndexMask = (1u << Role.RoleIndexBits) - 1;
+ const uint frozenBit = 1u << Role.RoleIndexBits;
+ protected const int AstNodeFlagsUsedBits = Role.RoleIndexBits + 1;
+
+ protected AstNode()
+ {
+ if (IsNull)
+ Freeze();
+ }
+
+ public bool IsFrozen {
+ get { return (flags & frozenBit) != 0; }
+ }
+
+ public void Freeze()
+ {
+ if (!IsFrozen) {
+ for (AstNode child = firstChild; child != null; child = child.nextSibling)
+ child.Freeze();
+ flags |= frozenBit;
+ }
+ }
+
+ protected void ThrowIfFrozen()
+ {
+ if (IsFrozen)
+ throw new InvalidOperationException("Cannot mutate frozen " + GetType().Name);
+ }
public abstract NodeType NodeType {
get;
@@ -135,12 +192,39 @@ namespace ICSharpCode.NRefactory.CSharp
}
}
+ ///
+ /// Gets the region from StartLocation to EndLocation for this node.
+ /// The file name of the region is set based on the parent CompilationUnit's file name.
+ /// If this node is not connected to a whole compilation, the file name will be null.
+ ///
+ public ICSharpCode.NRefactory.TypeSystem.DomRegion GetRegion()
+ {
+ var cu = (this.Ancestors.LastOrDefault() ?? this) as CompilationUnit;
+ string fileName = (cu != null ? cu.FileName : null);
+ return new ICSharpCode.NRefactory.TypeSystem.DomRegion(fileName, this.StartLocation, this.EndLocation);
+ }
+
public AstNode Parent {
get { return parent; }
}
public Role Role {
- get { return role; }
+ get {
+ return Role.GetByIndex(flags & roleIndexMask);
+ }
+ set {
+ if (value == null)
+ throw new ArgumentNullException("value");
+ if (!value.IsValid(this))
+ throw new ArgumentException("This node is not valid in the new role.");
+ ThrowIfFrozen();
+ SetRole(value);
+ }
+ }
+
+ void SetRole(Role role)
+ {
+ flags = (flags & ~roleIndexMask) | role.Index;
}
public AstNode NextSibling {
@@ -159,6 +243,12 @@ namespace ICSharpCode.NRefactory.CSharp
get { return lastChild; }
}
+ public bool HasChildren {
+ get {
+ return firstChild != null;
+ }
+ }
+
public IEnumerable Children {
get {
AstNode next;
@@ -183,6 +273,17 @@ namespace ICSharpCode.NRefactory.CSharp
}
}
+ ///
+ /// Gets the ancestors of this node (including this node itself)
+ ///
+ public IEnumerable AncestorsAndSelf {
+ get {
+ for (AstNode cur = this; cur != null; cur = cur.parent) {
+ yield return cur;
+ }
+ }
+ }
+
///
/// Gets all descendants of this node (excluding this node itself).
///
@@ -205,17 +306,23 @@ namespace ICSharpCode.NRefactory.CSharp
/// Gets the first child with the specified role.
/// Returns the role's null object if the child is not found.
///
- public T GetChildByRole (Role role) where T : AstNode
+ public T GetChildByRole(Role role) where T : AstNode
{
if (role == null)
throw new ArgumentNullException ("role");
+ uint roleIndex = role.Index;
for (var cur = firstChild; cur != null; cur = cur.nextSibling) {
- if (cur.role == role)
+ if ((cur.flags & roleIndexMask) == roleIndex)
return (T)cur;
}
return role.NullObject;
}
+ public T GetParent() where T : AstNode
+ {
+ return Ancestors.OfType().FirstOrDefault();
+ }
+
public AstNodeCollection GetChildrenByRole (Role role) where T : AstNode
{
return new AstNodeCollection (this, role);
@@ -236,10 +343,11 @@ namespace ICSharpCode.NRefactory.CSharp
throw new ArgumentNullException ("role");
if (child == null || child.IsNull)
return;
- if (this.IsNull)
- throw new InvalidOperationException ("Cannot add children to null nodes");
+ ThrowIfFrozen();
if (child.parent != null)
throw new ArgumentException ("Node is already used in another tree.", "child");
+ if (child.IsFrozen)
+ throw new ArgumentException ("Cannot add a frozen node.", "child");
AddChildUnsafe (child, role);
}
@@ -249,7 +357,7 @@ namespace ICSharpCode.NRefactory.CSharp
void AddChildUnsafe (AstNode child, Role role)
{
child.parent = this;
- child.role = role;
+ child.SetRole(role);
if (firstChild == null) {
lastChild = firstChild = child;
} else {
@@ -258,6 +366,13 @@ namespace ICSharpCode.NRefactory.CSharp
lastChild = child;
}
}
+
+ public void InsertChildsBefore(AstNode nextSibling, Role role, params T[] child) where T : AstNode
+ {
+ foreach (var cur in child) {
+ InsertChildBefore(nextSibling, cur, role);
+ }
+ }
public void InsertChildBefore (AstNode nextSibling, T child, Role role) where T : AstNode
{
@@ -270,8 +385,11 @@ namespace ICSharpCode.NRefactory.CSharp
if (child == null || child.IsNull)
return;
+ ThrowIfFrozen();
if (child.parent != null)
throw new ArgumentException ("Node is already used in another tree.", "child");
+ if (child.IsFrozen)
+ throw new ArgumentException ("Cannot add a frozen node.", "child");
if (nextSibling.parent != this)
throw new ArgumentException ("NextSibling is not a child of this node.", "nextSibling");
// No need to test for "Cannot add children to null nodes",
@@ -282,7 +400,7 @@ namespace ICSharpCode.NRefactory.CSharp
void InsertChildBeforeUnsafe (AstNode nextSibling, AstNode child, Role role)
{
child.parent = this;
- child.role = role;
+ child.SetRole(role);
child.nextSibling = nextSibling;
child.prevSibling = nextSibling.prevSibling;
@@ -307,6 +425,7 @@ namespace ICSharpCode.NRefactory.CSharp
public void Remove ()
{
if (parent != null) {
+ ThrowIfFrozen();
if (prevSibling != null) {
Debug.Assert (prevSibling.nextSibling == this);
prevSibling.nextSibling = nextSibling;
@@ -322,7 +441,6 @@ namespace ICSharpCode.NRefactory.CSharp
parent.lastChild = prevSibling;
}
parent = null;
- role = Roles.Root;
prevSibling = null;
nextSibling = null;
}
@@ -342,10 +460,11 @@ namespace ICSharpCode.NRefactory.CSharp
if (parent == null) {
throw new InvalidOperationException (this.IsNull ? "Cannot replace the null nodes" : "Cannot replace the root node");
}
+ ThrowIfFrozen();
// Because this method doesn't statically check the new node's type with the role,
// we perform a runtime test:
- if (!role.IsValid (newNode)) {
- throw new ArgumentException (string.Format ("The new node '{0}' is not valid in the role {1}", newNode.GetType ().Name, role.ToString ()), "newNode");
+ if (!this.Role.IsValid (newNode)) {
+ throw new ArgumentException (string.Format ("The new node '{0}' is not valid in the role {1}", newNode.GetType ().Name, this.Role.ToString ()), "newNode");
}
if (newNode.parent != null) {
// newNode is used within this tree?
@@ -357,9 +476,11 @@ namespace ICSharpCode.NRefactory.CSharp
throw new ArgumentException ("Node is already used in another tree.", "newNode");
}
}
+ if (newNode.IsFrozen)
+ throw new ArgumentException ("Cannot add a frozen node.", "newNode");
newNode.parent = parent;
- newNode.role = role;
+ newNode.SetRole(this.Role);
newNode.prevSibling = prevSibling;
newNode.nextSibling = nextSibling;
if (parent != null) {
@@ -380,7 +501,6 @@ namespace ICSharpCode.NRefactory.CSharp
parent = null;
prevSibling = null;
nextSibling = null;
- role = Roles.Root;
}
}
@@ -393,7 +513,7 @@ namespace ICSharpCode.NRefactory.CSharp
}
AstNode oldParent = parent;
AstNode oldSuccessor = nextSibling;
- Role oldRole = role;
+ Role oldRole = this.Role;
Remove ();
AstNode replacement = replaceFunction (this);
if (oldSuccessor != null && oldSuccessor.parent != oldParent)
@@ -422,26 +542,28 @@ namespace ICSharpCode.NRefactory.CSharp
AstNode copy = (AstNode)MemberwiseClone ();
// First, reset the shallow pointer copies
copy.parent = null;
- copy.role = Roles.Root;
copy.firstChild = null;
copy.lastChild = null;
copy.prevSibling = null;
copy.nextSibling = null;
+ copy.flags &= ~frozenBit; // unfreeze the copy
// Then perform a deep copy:
for (AstNode cur = firstChild; cur != null; cur = cur.nextSibling) {
- copy.AddChildUnsafe (cur.Clone (), cur.role);
+ copy.AddChildUnsafe (cur.Clone (), cur.Role);
}
// Finally, clone the annotation, if necessary
- ICloneable copiedAnnotations = copy.annotations as ICloneable; // read from copy (for thread-safety)
- if (copiedAnnotations != null)
- copy.annotations = copiedAnnotations.Clone();
+ copy.CloneAnnotations();
return copy;
}
- public abstract S AcceptVisitor (IAstVisitor visitor, T data = default(T));
+ public abstract void AcceptVisitor (IAstVisitor visitor);
+
+ public abstract T AcceptVisitor (IAstVisitor visitor);
+
+ public abstract S AcceptVisitor (IAstVisitor visitor, T data);
#region Pattern Matching
protected static bool MatchString (string pattern, string text)
@@ -491,7 +613,6 @@ namespace ICSharpCode.NRefactory.CSharp
return Parent.GetPrevNode ();
return null;
}
-
// filters all non c# nodes (comments, white spaces or pre processor directives)
public AstNode GetCSharpNodeBefore (AstNode node)
{
@@ -504,11 +625,22 @@ namespace ICSharpCode.NRefactory.CSharp
return null;
}
+ #region GetNodeAt
+ ///
+ /// Gets the node specified by T at the location line, column. This is useful for getting a specific node from the tree. For example searching
+ /// the current method declaration.
+ /// (End exclusive)
+ ///
public AstNode GetNodeAt (int line, int column, Predicate pred = null)
{
return GetNodeAt (new TextLocation (line, column), pred);
}
+ ///
+ /// Gets the node specified by pred at location. This is useful for getting a specific node from the tree. For example searching
+ /// the current method declaration.
+ /// (End exclusive)
+ ///
public AstNode GetNodeAt (TextLocation location, Predicate pred = null)
{
AstNode result = null;
@@ -531,14 +663,20 @@ namespace ICSharpCode.NRefactory.CSharp
return result;
}
+ ///
+ /// Gets the node specified by T at the location line, column. This is useful for getting a specific node from the tree. For example searching
+ /// the current method declaration.
+ /// (End exclusive)
+ ///
public T GetNodeAt (int line, int column) where T : AstNode
{
return GetNodeAt (new TextLocation (line, column));
}
///
- /// Gets the node specified by T at location. This is useful for getting a specific node from the tree. For example searching
+ /// Gets the node specified by T at location. This is useful for getting a specific node from the tree. For example searching
/// the current method declaration.
+ /// (End exclusive)
///
public T GetNodeAt (TextLocation location) where T : AstNode
{
@@ -561,6 +699,97 @@ namespace ICSharpCode.NRefactory.CSharp
}
return result;
}
+
+ #endregion
+
+ #region GetAdjacentNodeAt
+ ///
+ /// Gets the node specified by pred at the location line, column. This is useful for getting a specific node from the tree. For example searching
+ /// the current method declaration.
+ /// (End inclusive)
+ ///
+ public AstNode GetAdjacentNodeAt(int line, int column, Predicate pred = null)
+ {
+ return GetAdjacentNodeAt (new TextLocation (line, column), pred);
+ }
+
+ ///
+ /// Gets the node specified by pred at location. This is useful for getting a specific node from the tree. For example searching
+ /// the current method declaration.
+ /// (End inclusive)
+ ///
+ public AstNode GetAdjacentNodeAt (TextLocation location, Predicate pred = null)
+ {
+ AstNode result = null;
+ AstNode node = this;
+ while (node.FirstChild != null) {
+ var child = node.FirstChild;
+ while (child != null) {
+ if (child.StartLocation <= location && location <= child.EndLocation) {
+ if (pred == null || pred (child))
+ result = child;
+ node = child;
+ break;
+ }
+ child = child.NextSibling;
+ }
+ // found no better child node - therefore the parent is the right one.
+ if (child == null)
+ break;
+ }
+ return result;
+ }
+
+ ///
+ /// Gets the node specified by T at the location line, column. This is useful for getting a specific node from the tree. For example searching
+ /// the current method declaration.
+ /// (End inclusive)
+ ///
+ public T GetAdjacentNodeAt(int line, int column) where T : AstNode
+ {
+ return GetAdjacentNodeAt (new TextLocation (line, column));
+ }
+
+ ///
+ /// Gets the node specified by T at location. This is useful for getting a specific node from the tree. For example searching
+ /// the current method declaration.
+ /// (End inclusive)
+ ///
+ public T GetAdjacentNodeAt (TextLocation location) where T : AstNode
+ {
+ T result = null;
+ AstNode node = this;
+ while (node.FirstChild != null) {
+ var child = node.FirstChild;
+ while (child != null) {
+ if (child.StartLocation <= location && location < child.EndLocation) {
+ if (child is T)
+ result = (T)child;
+ node = child;
+ break;
+ }
+ child = child.NextSibling;
+ }
+ // found no better child node - therefore the parent is the right one.
+ if (child == null)
+ break;
+ }
+ return result;
+ }
+ #endregion
+
+
+ ///
+ /// Gets the node that fully contains the range from startLocation to endLocation.
+ ///
+ public AstNode GetNodeContaining(TextLocation startLocation, TextLocation endLocation)
+ {
+ for (AstNode child = firstChild; child != null; child = child.nextSibling) {
+ if (child.StartLocation <= startLocation && endLocation <= child.EndLocation)
+ return child.GetNodeContaining(startLocation, endLocation);
+ }
+ return this;
+ }
public IEnumerable GetNodesBetween (int startLine, int startColumn, int endLine, int endColumn)
{
@@ -579,7 +808,7 @@ namespace ICSharpCode.NRefactory.CSharp
yield return node;
} else {
if (node.EndLocation <= start) {
- next = node.NextSibling;
+ next = node.NextSibling;
} else {
next = node.FirstChild;
}
@@ -591,16 +820,65 @@ namespace ICSharpCode.NRefactory.CSharp
}
}
+ ///
+ /// Gets the node as formatted C# output.
+ ///
+ ///
+ /// Formatting options.
+ ///
+ public virtual string GetText (CSharpFormattingOptions formattingOptions = null)
+ {
+ if (IsNull)
+ return "";
+ var w = new StringWriter ();
+ AcceptVisitor (new CSharpOutputVisitor (w, formattingOptions ?? FormattingOptionsFactory.CreateMono ()));
+ return w.ToString ();
+ }
+
+ ///
+ /// Returns true, if the given coordinates (line, column) are in the node.
+ ///
+ ///
+ /// True, if the given coordinates are between StartLocation and EndLocation (exclusive); otherwise, false.
+ ///
public bool Contains (int line, int column)
{
return Contains (new TextLocation (line, column));
}
-
+
+ ///
+ /// Returns true, if the given coordinates are in the node.
+ ///
+ ///
+ /// True, if location is between StartLocation and EndLocation (exclusive); otherwise, false.
+ ///
public bool Contains (TextLocation location)
{
return this.StartLocation <= location && location < this.EndLocation;
}
+ ///
+ /// Returns true, if the given coordinates (line, column) are in the node.
+ ///
+ ///
+ /// True, if the given coordinates are between StartLocation and EndLocation (inclusive); otherwise, false.
+ ///
+ public bool IsInside (int line, int column)
+ {
+ return IsInside (new TextLocation (line, column));
+ }
+
+ ///
+ /// Returns true, if the given coordinates are in the node.
+ ///
+ ///
+ /// True, if location is between StartLocation and EndLocation (inclusive); otherwise, false.
+ ///
+ public bool IsInside (TextLocation location)
+ {
+ return this.StartLocation <= location && location <= this.EndLocation;
+ }
+
public override void AddAnnotation (object annotation)
{
if (this.IsNull)
@@ -612,60 +890,12 @@ namespace ICSharpCode.NRefactory.CSharp
{
if (IsNull)
return "Null";
- StringWriter w = new StringWriter();
- AcceptVisitor(new CSharpOutputVisitor(w, new CSharpFormattingOptions()), null);
- string text = w.ToString().TrimEnd().Replace("\t", "").Replace(w.NewLine, " ");
+ string text = GetText();
+ text = text.TrimEnd().Replace("\t", "").Replace(Environment.NewLine, " ");
if (text.Length > 100)
return text.Substring(0, 97) + "...";
else
return text;
}
-
- // the Root role must be available when creating the null nodes, so we can't put it in the Roles class
- static readonly Role RootRole = new Role ("Root");
-
- public static class Roles
- {
- ///
- /// Root of an abstract syntax tree.
- ///
- public static readonly Role Root = RootRole;
-
- // some pre defined constants for common roles
- public static readonly Role Identifier = new Role ("Identifier", CSharp.Identifier.Null);
- public static readonly Role Body = new Role