diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-06-25 14:43:50 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-06-25 14:50:31 -0700 |
| commit | 38afa9e7bc7eacc021f8805f607368a05751e3c3 (patch) | |
| tree | 803b0a8d9a06a7d6f7c4df408437017ae21a883e /src/WixToolset.Core/Link | |
| parent | 8968578d50858721317d410549a9f9b5c62bf1f7 (diff) | |
| download | wix-38afa9e7bc7eacc021f8805f607368a05751e3c3.tar.gz wix-38afa9e7bc7eacc021f8805f607368a05751e3c3.tar.bz2 wix-38afa9e7bc7eacc021f8805f607368a05751e3c3.zip | |
The Great Tuple to Symbol Rename (tm)
Diffstat (limited to 'src/WixToolset.Core/Link')
6 files changed, 106 insertions, 106 deletions
diff --git a/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs b/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs index 31cbf0b8..1c2ca8eb 100644 --- a/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs +++ b/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs | |||
| @@ -31,17 +31,17 @@ namespace WixToolset.Core.Link | |||
| 31 | /// <summary> | 31 | /// <summary> |
| 32 | /// Gets the collection of loaded symbols. | 32 | /// Gets the collection of loaded symbols. |
| 33 | /// </summary> | 33 | /// </summary> |
| 34 | public IDictionary<string, TupleWithSection> TuplesByName { get; private set; } | 34 | public IDictionary<string, SymbolWithSection> SymbolsByName { get; private set; } |
| 35 | 35 | ||
| 36 | /// <summary> | 36 | /// <summary> |
| 37 | /// Gets the collection of possibly conflicting symbols. | 37 | /// Gets the collection of possibly conflicting symbols. |
| 38 | /// </summary> | 38 | /// </summary> |
| 39 | public IEnumerable<TupleWithSection> PossibleConflicts { get; private set; } | 39 | public IEnumerable<SymbolWithSection> PossibleConflicts { get; private set; } |
| 40 | 40 | ||
| 41 | public void Execute() | 41 | public void Execute() |
| 42 | { | 42 | { |
| 43 | var tuplesByName = new Dictionary<string, TupleWithSection>(); | 43 | var symbolsByName = new Dictionary<string, SymbolWithSection>(); |
| 44 | var possibleConflicts = new HashSet<TupleWithSection>(); | 44 | var possibleConflicts = new HashSet<SymbolWithSection>(); |
| 45 | 45 | ||
| 46 | if (!Enum.TryParse(this.ExpectedOutputType.ToString(), out SectionType expectedEntrySectionType)) | 46 | if (!Enum.TryParse(this.ExpectedOutputType.ToString(), out SectionType expectedEntrySectionType)) |
| 47 | { | 47 | { |
| @@ -66,44 +66,44 @@ namespace WixToolset.Core.Link | |||
| 66 | } | 66 | } |
| 67 | else | 67 | else |
| 68 | { | 68 | { |
| 69 | this.Messaging.Write(ErrorMessages.MultipleEntrySections(this.EntrySection.Tuples.FirstOrDefault()?.SourceLineNumbers, this.EntrySection.Id, section.Id)); | 69 | this.Messaging.Write(ErrorMessages.MultipleEntrySections(this.EntrySection.Symbols.FirstOrDefault()?.SourceLineNumbers, this.EntrySection.Id, section.Id)); |
| 70 | this.Messaging.Write(ErrorMessages.MultipleEntrySections2(section.Tuples.FirstOrDefault()?.SourceLineNumbers)); | 70 | this.Messaging.Write(ErrorMessages.MultipleEntrySections2(section.Symbols.FirstOrDefault()?.SourceLineNumbers)); |
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | // Load all the symbols from the section's tables that create symbols. | 74 | // Load all the symbols from the section's tables that create symbols. |
| 75 | foreach (var tuple in section.Tuples.Where(t => t.Id != null)) | 75 | foreach (var symbol in section.Symbols.Where(t => t.Id != null)) |
| 76 | { | 76 | { |
| 77 | var symbol = new TupleWithSection(section, tuple); | 77 | var symbolWithSection = new SymbolWithSection(section, symbol); |
| 78 | 78 | ||
| 79 | if (!tuplesByName.TryGetValue(symbol.Name, out var existingSymbol)) | 79 | if (!symbolsByName.TryGetValue(symbolWithSection.Name, out var existingSymbol)) |
| 80 | { | 80 | { |
| 81 | tuplesByName.Add(symbol.Name, symbol); | 81 | symbolsByName.Add(symbolWithSection.Name, symbolWithSection); |
| 82 | } | 82 | } |
| 83 | else // uh-oh, duplicate symbols. | 83 | else // uh-oh, duplicate symbols. |
| 84 | { | 84 | { |
| 85 | // If the duplicate symbols are both private directories, there is a chance that they | 85 | // If the duplicate symbols are both private directories, there is a chance that they |
| 86 | // point to identical tuples. Identical directory tuples are redundant and will not cause | 86 | // point to identical symbols. Identical directory symbols are redundant and will not cause |
| 87 | // conflicts. | 87 | // conflicts. |
| 88 | if (AccessModifier.Private == existingSymbol.Access && AccessModifier.Private == symbol.Access && | 88 | if (AccessModifier.Private == existingSymbol.Access && AccessModifier.Private == symbolWithSection.Access && |
| 89 | TupleDefinitionType.Directory == existingSymbol.Tuple.Definition.Type && existingSymbol.Tuple.IsIdentical(symbol.Tuple)) | 89 | SymbolDefinitionType.Directory == existingSymbol.Symbol.Definition.Type && existingSymbol.Symbol.IsIdentical(symbolWithSection.Symbol)) |
| 90 | { | 90 | { |
| 91 | // Ensure identical symbol's tuple is marked redundant to ensure (should the tuple be | 91 | // Ensure identical symbol's symbol is marked redundant to ensure (should the symbol be |
| 92 | // referenced into the final output) it will not add duplicate primary keys during | 92 | // referenced into the final output) it will not add duplicate primary keys during |
| 93 | // the .IDT importing. | 93 | // the .IDT importing. |
| 94 | //symbol.Row.Redundant = true; - TODO: remove this | 94 | //symbol.Row.Redundant = true; - TODO: remove this |
| 95 | existingSymbol.AddRedundant(symbol); | 95 | existingSymbol.AddRedundant(symbolWithSection); |
| 96 | } | 96 | } |
| 97 | else | 97 | else |
| 98 | { | 98 | { |
| 99 | existingSymbol.AddPossibleConflict(symbol); | 99 | existingSymbol.AddPossibleConflict(symbolWithSection); |
| 100 | possibleConflicts.Add(existingSymbol); | 100 | possibleConflicts.Add(existingSymbol); |
| 101 | } | 101 | } |
| 102 | } | 102 | } |
| 103 | } | 103 | } |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | this.TuplesByName = tuplesByName; | 106 | this.SymbolsByName = symbolsByName; |
| 107 | this.PossibleConflicts = possibleConflicts; | 107 | this.PossibleConflicts = possibleConflicts; |
| 108 | } | 108 | } |
| 109 | } | 109 | } |
diff --git a/src/WixToolset.Core/Link/IntermediateTupleExtensions.cs b/src/WixToolset.Core/Link/IntermediateTupleExtensions.cs index c4c12e81..db53f1ce 100644 --- a/src/WixToolset.Core/Link/IntermediateTupleExtensions.cs +++ b/src/WixToolset.Core/Link/IntermediateTupleExtensions.cs | |||
| @@ -4,12 +4,12 @@ namespace WixToolset.Core.Link | |||
| 4 | { | 4 | { |
| 5 | using WixToolset.Data; | 5 | using WixToolset.Data; |
| 6 | 6 | ||
| 7 | internal static class IntermediateTupleExtensions | 7 | internal static class IntermediateSymbolExtensions |
| 8 | { | 8 | { |
| 9 | public static bool IsIdentical(this IntermediateTuple first, IntermediateTuple second) | 9 | public static bool IsIdentical(this IntermediateSymbol first, IntermediateSymbol second) |
| 10 | { | 10 | { |
| 11 | var identical = (first.Definition.Type == second.Definition.Type && | 11 | var identical = (first.Definition.Type == second.Definition.Type && |
| 12 | first.Definition.Name == second.Definition.Name && | 12 | first.Definition.Name == second.Definition.Name && |
| 13 | first.Definition.FieldDefinitions.Length == second.Definition.FieldDefinitions.Length); | 13 | first.Definition.FieldDefinitions.Length == second.Definition.FieldDefinitions.Length); |
| 14 | 14 | ||
| 15 | for (int i = 0; identical && i < first.Definition.FieldDefinitions.Length; ++i) | 15 | for (int i = 0; identical && i < first.Definition.FieldDefinitions.Length; ++i) |
diff --git a/src/WixToolset.Core/Link/ReportConflictingTuplesCommand.cs b/src/WixToolset.Core/Link/ReportConflictingTuplesCommand.cs index ff01f573..ace2e19d 100644 --- a/src/WixToolset.Core/Link/ReportConflictingTuplesCommand.cs +++ b/src/WixToolset.Core/Link/ReportConflictingTuplesCommand.cs | |||
| @@ -7,9 +7,9 @@ namespace WixToolset.Core.Link | |||
| 7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
| 8 | using WixToolset.Extensibility.Services; | 8 | using WixToolset.Extensibility.Services; |
| 9 | 9 | ||
| 10 | internal class ReportConflictingTuplesCommand | 10 | internal class ReportConflictingSymbolsCommand |
| 11 | { | 11 | { |
| 12 | public ReportConflictingTuplesCommand(IMessaging messaging, IEnumerable<TupleWithSection> possibleConflicts, IEnumerable<IntermediateSection> resolvedSections) | 12 | public ReportConflictingSymbolsCommand(IMessaging messaging, IEnumerable<SymbolWithSection> possibleConflicts, IEnumerable<IntermediateSection> resolvedSections) |
| 13 | { | 13 | { |
| 14 | this.Messaging = messaging; | 14 | this.Messaging = messaging; |
| 15 | this.PossibleConflicts = possibleConflicts; | 15 | this.PossibleConflicts = possibleConflicts; |
| @@ -18,18 +18,18 @@ namespace WixToolset.Core.Link | |||
| 18 | 18 | ||
| 19 | private IMessaging Messaging { get; } | 19 | private IMessaging Messaging { get; } |
| 20 | 20 | ||
| 21 | private IEnumerable<TupleWithSection> PossibleConflicts { get; } | 21 | private IEnumerable<SymbolWithSection> PossibleConflicts { get; } |
| 22 | 22 | ||
| 23 | private IEnumerable<IntermediateSection> ResolvedSections { get; } | 23 | private IEnumerable<IntermediateSection> ResolvedSections { get; } |
| 24 | 24 | ||
| 25 | public void Execute() | 25 | public void Execute() |
| 26 | { | 26 | { |
| 27 | // Do a quick check if there are any possibly conflicting symbols that don't come from tables that allow | 27 | // Do a quick check if there are any possibly conflicting symbols that don't come from tables that allow |
| 28 | // overriding. Hopefully the tuples with possible conflicts list is usually very short list (empty should | 28 | // overriding. Hopefully the symbols with possible conflicts list is usually very short list (empty should |
| 29 | // be the most common). If we find any matches, we'll do a more costly check to see if the possible conflicting | 29 | // be the most common). If we find any matches, we'll do a more costly check to see if the possible conflicting |
| 30 | // tuples are in sections we actually referenced. From the resulting set, show an error for each duplicate | 30 | // symbols are in sections we actually referenced. From the resulting set, show an error for each duplicate |
| 31 | // (aka: conflicting) tuple. | 31 | // (aka: conflicting) symbol. |
| 32 | var illegalDuplicates = this.PossibleConflicts.Where(s => s.Tuple.Definition.Type != TupleDefinitionType.WixAction && s.Tuple.Definition.Type != TupleDefinitionType.WixVariable).ToList(); | 32 | var illegalDuplicates = this.PossibleConflicts.Where(s => s.Symbol.Definition.Type != SymbolDefinitionType.WixAction && s.Symbol.Definition.Type != SymbolDefinitionType.WixVariable).ToList(); |
| 33 | if (0 < illegalDuplicates.Count) | 33 | if (0 < illegalDuplicates.Count) |
| 34 | { | 34 | { |
| 35 | var referencedSections = new HashSet<IntermediateSection>(this.ResolvedSections); | 35 | var referencedSections = new HashSet<IntermediateSection>(this.ResolvedSections); |
| @@ -40,11 +40,11 @@ namespace WixToolset.Core.Link | |||
| 40 | 40 | ||
| 41 | if (actuallyReferencedDuplicates.Any()) | 41 | if (actuallyReferencedDuplicates.Any()) |
| 42 | { | 42 | { |
| 43 | this.Messaging.Write(ErrorMessages.DuplicateSymbol(referencedDuplicate.Tuple.SourceLineNumbers, referencedDuplicate.Name)); | 43 | this.Messaging.Write(ErrorMessages.DuplicateSymbol(referencedDuplicate.Symbol.SourceLineNumbers, referencedDuplicate.Name)); |
| 44 | 44 | ||
| 45 | foreach (var duplicate in actuallyReferencedDuplicates) | 45 | foreach (var duplicate in actuallyReferencedDuplicates) |
| 46 | { | 46 | { |
| 47 | this.Messaging.Write(ErrorMessages.DuplicateSymbol2(duplicate.Tuple.SourceLineNumbers)); | 47 | this.Messaging.Write(ErrorMessages.DuplicateSymbol2(duplicate.Symbol.SourceLineNumbers)); |
| 48 | } | 48 | } |
| 49 | } | 49 | } |
| 50 | } | 50 | } |
diff --git a/src/WixToolset.Core/Link/ResolveReferencesCommand.cs b/src/WixToolset.Core/Link/ResolveReferencesCommand.cs index 4ffb5443..d2be0699 100644 --- a/src/WixToolset.Core/Link/ResolveReferencesCommand.cs +++ b/src/WixToolset.Core/Link/ResolveReferencesCommand.cs | |||
| @@ -6,7 +6,7 @@ namespace WixToolset.Core.Link | |||
| 6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| 7 | using System.Linq; | 7 | using System.Linq; |
| 8 | using WixToolset.Data; | 8 | using WixToolset.Data; |
| 9 | using WixToolset.Data.Tuples; | 9 | using WixToolset.Data.Symbols; |
| 10 | using WixToolset.Extensibility.Services; | 10 | using WixToolset.Extensibility.Services; |
| 11 | 11 | ||
| 12 | /// <summary> | 12 | /// <summary> |
| @@ -15,19 +15,19 @@ namespace WixToolset.Core.Link | |||
| 15 | internal class ResolveReferencesCommand | 15 | internal class ResolveReferencesCommand |
| 16 | { | 16 | { |
| 17 | private readonly IntermediateSection entrySection; | 17 | private readonly IntermediateSection entrySection; |
| 18 | private readonly IDictionary<string, TupleWithSection> tuplesWithSections; | 18 | private readonly IDictionary<string, SymbolWithSection> symbolsWithSections; |
| 19 | private HashSet<TupleWithSection> referencedTuples; | 19 | private HashSet<SymbolWithSection> referencedSymbols; |
| 20 | private HashSet<IntermediateSection> resolvedSections; | 20 | private HashSet<IntermediateSection> resolvedSections; |
| 21 | 21 | ||
| 22 | public ResolveReferencesCommand(IMessaging messaging, IntermediateSection entrySection, IDictionary<string, TupleWithSection> tuplesWithSections) | 22 | public ResolveReferencesCommand(IMessaging messaging, IntermediateSection entrySection, IDictionary<string, SymbolWithSection> symbolsWithSections) |
| 23 | { | 23 | { |
| 24 | this.Messaging = messaging; | 24 | this.Messaging = messaging; |
| 25 | this.entrySection = entrySection; | 25 | this.entrySection = entrySection; |
| 26 | this.tuplesWithSections = tuplesWithSections; | 26 | this.symbolsWithSections = symbolsWithSections; |
| 27 | this.BuildingMergeModule = (SectionType.Module == entrySection.Type); | 27 | this.BuildingMergeModule = (SectionType.Module == entrySection.Type); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | public IEnumerable<TupleWithSection> ReferencedTupleWithSections => this.referencedTuples; | 30 | public IEnumerable<SymbolWithSection> ReferencedSymbolWithSections => this.referencedSymbols; |
| 31 | 31 | ||
| 32 | public IEnumerable<IntermediateSection> ResolvedSections => this.resolvedSections; | 32 | public IEnumerable<IntermediateSection> ResolvedSections => this.resolvedSections; |
| 33 | 33 | ||
| @@ -41,7 +41,7 @@ namespace WixToolset.Core.Link | |||
| 41 | public void Execute() | 41 | public void Execute() |
| 42 | { | 42 | { |
| 43 | this.resolvedSections = new HashSet<IntermediateSection>(); | 43 | this.resolvedSections = new HashSet<IntermediateSection>(); |
| 44 | this.referencedTuples = new HashSet<TupleWithSection>(); | 44 | this.referencedSymbols = new HashSet<SymbolWithSection>(); |
| 45 | 45 | ||
| 46 | this.RecursivelyResolveReferences(this.entrySection); | 46 | this.RecursivelyResolveReferences(this.entrySection); |
| 47 | } | 47 | } |
| @@ -60,10 +60,10 @@ namespace WixToolset.Core.Link | |||
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | // Process all of the references contained in this section using the collection of | 62 | // Process all of the references contained in this section using the collection of |
| 63 | // tuples provided. Then recursively call this method to process the | 63 | // symbols provided. Then recursively call this method to process the |
| 64 | // located tuple's section. All in all this is a very simple depth-first | 64 | // located symbol's section. All in all this is a very simple depth-first |
| 65 | // search of the references per-section. | 65 | // search of the references per-section. |
| 66 | foreach (var wixSimpleReferenceRow in section.Tuples.OfType<WixSimpleReferenceTuple>()) | 66 | foreach (var wixSimpleReferenceRow in section.Symbols.OfType<WixSimpleReferenceSymbol>()) |
| 67 | { | 67 | { |
| 68 | // If we're building a Merge Module, ignore all references to the Media table | 68 | // If we're building a Merge Module, ignore all references to the Media table |
| 69 | // because Merge Modules don't have Media tables. | 69 | // because Merge Modules don't have Media tables. |
| @@ -72,44 +72,44 @@ namespace WixToolset.Core.Link | |||
| 72 | continue; | 72 | continue; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | if (!this.tuplesWithSections.TryGetValue(wixSimpleReferenceRow.SymbolicName, out var tupleWithSection)) | 75 | if (!this.symbolsWithSections.TryGetValue(wixSimpleReferenceRow.SymbolicName, out var symbolWithSection)) |
| 76 | { | 76 | { |
| 77 | this.Messaging.Write(ErrorMessages.UnresolvedReference(wixSimpleReferenceRow.SourceLineNumbers, wixSimpleReferenceRow.SymbolicName)); | 77 | this.Messaging.Write(ErrorMessages.UnresolvedReference(wixSimpleReferenceRow.SourceLineNumbers, wixSimpleReferenceRow.SymbolicName)); |
| 78 | } | 78 | } |
| 79 | else // see if the tuple (and any of its duplicates) are appropriately accessible. | 79 | else // see if the symbol (and any of its duplicates) are appropriately accessible. |
| 80 | { | 80 | { |
| 81 | var accessible = this.DetermineAccessibleTuples(section, tupleWithSection); | 81 | var accessible = this.DetermineAccessibleSymbols(section, symbolWithSection); |
| 82 | if (!accessible.Any()) | 82 | if (!accessible.Any()) |
| 83 | { | 83 | { |
| 84 | this.Messaging.Write(ErrorMessages.UnresolvedReference(wixSimpleReferenceRow.SourceLineNumbers, wixSimpleReferenceRow.SymbolicName, tupleWithSection.Access)); | 84 | this.Messaging.Write(ErrorMessages.UnresolvedReference(wixSimpleReferenceRow.SourceLineNumbers, wixSimpleReferenceRow.SymbolicName, symbolWithSection.Access)); |
| 85 | } | 85 | } |
| 86 | else if (1 == accessible.Count) | 86 | else if (1 == accessible.Count) |
| 87 | { | 87 | { |
| 88 | var accessibleTuple = accessible[0]; | 88 | var accessibleSymbol = accessible[0]; |
| 89 | this.referencedTuples.Add(accessibleTuple); | 89 | this.referencedSymbols.Add(accessibleSymbol); |
| 90 | 90 | ||
| 91 | if (null != accessibleTuple.Section) | 91 | if (null != accessibleSymbol.Section) |
| 92 | { | 92 | { |
| 93 | this.RecursivelyResolveReferences(accessibleTuple.Section); | 93 | this.RecursivelyResolveReferences(accessibleSymbol.Section); |
| 94 | } | 94 | } |
| 95 | } | 95 | } |
| 96 | else // display errors for the duplicate tuples. | 96 | else // display errors for the duplicate symbols. |
| 97 | { | 97 | { |
| 98 | var accessibleTuple = accessible[0]; | 98 | var accessibleSymbol = accessible[0]; |
| 99 | var referencingSourceLineNumber = wixSimpleReferenceRow.SourceLineNumbers?.ToString(); | 99 | var referencingSourceLineNumber = wixSimpleReferenceRow.SourceLineNumbers?.ToString(); |
| 100 | 100 | ||
| 101 | if (String.IsNullOrEmpty(referencingSourceLineNumber)) | 101 | if (String.IsNullOrEmpty(referencingSourceLineNumber)) |
| 102 | { | 102 | { |
| 103 | this.Messaging.Write(ErrorMessages.DuplicateSymbol(accessibleTuple.Tuple.SourceLineNumbers, accessibleTuple.Name)); | 103 | this.Messaging.Write(ErrorMessages.DuplicateSymbol(accessibleSymbol.Symbol.SourceLineNumbers, accessibleSymbol.Name)); |
| 104 | } | 104 | } |
| 105 | else | 105 | else |
| 106 | { | 106 | { |
| 107 | this.Messaging.Write(ErrorMessages.DuplicateSymbol(accessibleTuple.Tuple.SourceLineNumbers, accessibleTuple.Name, referencingSourceLineNumber)); | 107 | this.Messaging.Write(ErrorMessages.DuplicateSymbol(accessibleSymbol.Symbol.SourceLineNumbers, accessibleSymbol.Name, referencingSourceLineNumber)); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | foreach (var accessibleDuplicate in accessible.Skip(1)) | 110 | foreach (var accessibleDuplicate in accessible.Skip(1)) |
| 111 | { | 111 | { |
| 112 | this.Messaging.Write(ErrorMessages.DuplicateSymbol2(accessibleDuplicate.Tuple.SourceLineNumbers)); | 112 | this.Messaging.Write(ErrorMessages.DuplicateSymbol2(accessibleDuplicate.Symbol.SourceLineNumbers)); |
| 113 | } | 113 | } |
| 114 | } | 114 | } |
| 115 | } | 115 | } |
| @@ -117,67 +117,67 @@ namespace WixToolset.Core.Link | |||
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | /// <summary> | 119 | /// <summary> |
| 120 | /// Determine if the tuple and any of its duplicates are accessbile by referencing section. | 120 | /// Determine if the symbol and any of its duplicates are accessbile by referencing section. |
| 121 | /// </summary> | 121 | /// </summary> |
| 122 | /// <param name="referencingSection">Section referencing the tuple.</param> | 122 | /// <param name="referencingSection">Section referencing the symbol.</param> |
| 123 | /// <param name="tupleWithSection">Tuple being referenced.</param> | 123 | /// <param name="symbolWithSection">Symbol being referenced.</param> |
| 124 | /// <returns>List of tuples accessible by referencing section.</returns> | 124 | /// <returns>List of symbols accessible by referencing section.</returns> |
| 125 | private List<TupleWithSection> DetermineAccessibleTuples(IntermediateSection referencingSection, TupleWithSection tupleWithSection) | 125 | private List<SymbolWithSection> DetermineAccessibleSymbols(IntermediateSection referencingSection, SymbolWithSection symbolWithSection) |
| 126 | { | 126 | { |
| 127 | var accessibleTuples = new List<TupleWithSection>(); | 127 | var accessibleSymbols = new List<SymbolWithSection>(); |
| 128 | 128 | ||
| 129 | if (this.AccessibleTuple(referencingSection, tupleWithSection)) | 129 | if (this.AccessibleSymbol(referencingSection, symbolWithSection)) |
| 130 | { | 130 | { |
| 131 | accessibleTuples.Add(tupleWithSection); | 131 | accessibleSymbols.Add(symbolWithSection); |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | foreach (var dupe in tupleWithSection.PossiblyConflicts) | 134 | foreach (var dupe in symbolWithSection.PossiblyConflicts) |
| 135 | { | 135 | { |
| 136 | // don't count overridable WixActionTuples | 136 | // don't count overridable WixActionSymbols |
| 137 | var tupleAction = tupleWithSection.Tuple as WixActionTuple; | 137 | var symbolAction = symbolWithSection.Symbol as WixActionSymbol; |
| 138 | var dupeAction = dupe.Tuple as WixActionTuple; | 138 | var dupeAction = dupe.Symbol as WixActionSymbol; |
| 139 | if (tupleAction?.Overridable != dupeAction?.Overridable) | 139 | if (symbolAction?.Overridable != dupeAction?.Overridable) |
| 140 | { | 140 | { |
| 141 | continue; | 141 | continue; |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | if (this.AccessibleTuple(referencingSection, dupe)) | 144 | if (this.AccessibleSymbol(referencingSection, dupe)) |
| 145 | { | 145 | { |
| 146 | accessibleTuples.Add(dupe); | 146 | accessibleSymbols.Add(dupe); |
| 147 | } | 147 | } |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | foreach (var dupe in tupleWithSection.Redundants) | 150 | foreach (var dupe in symbolWithSection.Redundants) |
| 151 | { | 151 | { |
| 152 | if (this.AccessibleTuple(referencingSection, dupe)) | 152 | if (this.AccessibleSymbol(referencingSection, dupe)) |
| 153 | { | 153 | { |
| 154 | accessibleTuples.Add(dupe); | 154 | accessibleSymbols.Add(dupe); |
| 155 | } | 155 | } |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | return accessibleTuples; | 158 | return accessibleSymbols; |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | /// <summary> | 161 | /// <summary> |
| 162 | /// Determine if a single tuple is accessible by the referencing section. | 162 | /// Determine if a single symbol is accessible by the referencing section. |
| 163 | /// </summary> | 163 | /// </summary> |
| 164 | /// <param name="referencingSection">Section referencing the tuple.</param> | 164 | /// <param name="referencingSection">Section referencing the symbol.</param> |
| 165 | /// <param name="tupleWithSection">Tuple being referenced.</param> | 165 | /// <param name="symbolWithSection">Symbol being referenced.</param> |
| 166 | /// <returns>True if tuple is accessible.</returns> | 166 | /// <returns>True if symbol is accessible.</returns> |
| 167 | private bool AccessibleTuple(IntermediateSection referencingSection, TupleWithSection tupleWithSection) | 167 | private bool AccessibleSymbol(IntermediateSection referencingSection, SymbolWithSection symbolWithSection) |
| 168 | { | 168 | { |
| 169 | switch (tupleWithSection.Access) | 169 | switch (symbolWithSection.Access) |
| 170 | { | 170 | { |
| 171 | case AccessModifier.Public: | 171 | case AccessModifier.Public: |
| 172 | return true; | 172 | return true; |
| 173 | case AccessModifier.Internal: | 173 | case AccessModifier.Internal: |
| 174 | return tupleWithSection.Section.CompilationId.Equals(referencingSection.CompilationId) || (null != tupleWithSection.Section.LibraryId && tupleWithSection.Section.LibraryId.Equals(referencingSection.LibraryId)); | 174 | return symbolWithSection.Section.CompilationId.Equals(referencingSection.CompilationId) || (null != symbolWithSection.Section.LibraryId && symbolWithSection.Section.LibraryId.Equals(referencingSection.LibraryId)); |
| 175 | case AccessModifier.Protected: | 175 | case AccessModifier.Protected: |
| 176 | return tupleWithSection.Section.CompilationId.Equals(referencingSection.CompilationId); | 176 | return symbolWithSection.Section.CompilationId.Equals(referencingSection.CompilationId); |
| 177 | case AccessModifier.Private: | 177 | case AccessModifier.Private: |
| 178 | return referencingSection == tupleWithSection.Section; | 178 | return referencingSection == symbolWithSection.Section; |
| 179 | default: | 179 | default: |
| 180 | throw new ArgumentOutOfRangeException(nameof(tupleWithSection.Access)); | 180 | throw new ArgumentOutOfRangeException(nameof(symbolWithSection.Access)); |
| 181 | } | 181 | } |
| 182 | } | 182 | } |
| 183 | } | 183 | } |
diff --git a/src/WixToolset.Core/Link/WixComplexReferenceTupleExtensions.cs b/src/WixToolset.Core/Link/WixComplexReferenceTupleExtensions.cs index 80cafa50..1702d3ca 100644 --- a/src/WixToolset.Core/Link/WixComplexReferenceTupleExtensions.cs +++ b/src/WixToolset.Core/Link/WixComplexReferenceTupleExtensions.cs | |||
| @@ -3,17 +3,17 @@ | |||
| 3 | namespace WixToolset.Core.Link | 3 | namespace WixToolset.Core.Link |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using WixToolset.Data.Tuples; | 6 | using WixToolset.Data.Symbols; |
| 7 | 7 | ||
| 8 | internal static class WixComplexReferenceTupleExtensions | 8 | internal static class WixComplexReferenceSymbolExtensions |
| 9 | { | 9 | { |
| 10 | /// <summary> | 10 | /// <summary> |
| 11 | /// Creates a shallow copy of the ComplexReference. | 11 | /// Creates a shallow copy of the ComplexReference. |
| 12 | /// </summary> | 12 | /// </summary> |
| 13 | /// <returns>A shallow copy of the ComplexReference.</returns> | 13 | /// <returns>A shallow copy of the ComplexReference.</returns> |
| 14 | public static WixComplexReferenceTuple Clone(this WixComplexReferenceTuple source) | 14 | public static WixComplexReferenceSymbol Clone(this WixComplexReferenceSymbol source) |
| 15 | { | 15 | { |
| 16 | var clone = new WixComplexReferenceTuple(source.SourceLineNumbers, source.Id); | 16 | var clone = new WixComplexReferenceSymbol(source.SourceLineNumbers, source.Id); |
| 17 | clone.ParentType = source.ParentType; | 17 | clone.ParentType = source.ParentType; |
| 18 | clone.Parent = source.Parent; | 18 | clone.Parent = source.Parent; |
| 19 | clone.ParentLanguage = source.ParentLanguage; | 19 | clone.ParentLanguage = source.ParentLanguage; |
| @@ -29,23 +29,23 @@ namespace WixToolset.Core.Link | |||
| 29 | /// </summary> | 29 | /// </summary> |
| 30 | /// <param name="obj">Complex reference to compare to.</param> | 30 | /// <param name="obj">Complex reference to compare to.</param> |
| 31 | /// <returns>Zero if the objects are equivalent, negative number if the provided object is less, positive if greater.</returns> | 31 | /// <returns>Zero if the objects are equivalent, negative number if the provided object is less, positive if greater.</returns> |
| 32 | public static int CompareToWithoutConsideringPrimary(this WixComplexReferenceTuple tuple, WixComplexReferenceTuple other) | 32 | public static int CompareToWithoutConsideringPrimary(this WixComplexReferenceSymbol symbol, WixComplexReferenceSymbol other) |
| 33 | { | 33 | { |
| 34 | var comparison = tuple.ChildType - other.ChildType; | 34 | var comparison = symbol.ChildType - other.ChildType; |
| 35 | if (0 == comparison) | 35 | if (0 == comparison) |
| 36 | { | 36 | { |
| 37 | comparison = String.Compare(tuple.Child, other.Child, StringComparison.Ordinal); | 37 | comparison = String.Compare(symbol.Child, other.Child, StringComparison.Ordinal); |
| 38 | if (0 == comparison) | 38 | if (0 == comparison) |
| 39 | { | 39 | { |
| 40 | comparison = tuple.ParentType - other.ParentType; | 40 | comparison = symbol.ParentType - other.ParentType; |
| 41 | if (0 == comparison) | 41 | if (0 == comparison) |
| 42 | { | 42 | { |
| 43 | string thisParentLanguage = null == tuple.ParentLanguage ? String.Empty : tuple.ParentLanguage; | 43 | string thisParentLanguage = null == symbol.ParentLanguage ? String.Empty : symbol.ParentLanguage; |
| 44 | string otherParentLanguage = null == other.ParentLanguage ? String.Empty : other.ParentLanguage; | 44 | string otherParentLanguage = null == other.ParentLanguage ? String.Empty : other.ParentLanguage; |
| 45 | comparison = String.Compare(thisParentLanguage, otherParentLanguage, StringComparison.Ordinal); | 45 | comparison = String.Compare(thisParentLanguage, otherParentLanguage, StringComparison.Ordinal); |
| 46 | if (0 == comparison) | 46 | if (0 == comparison) |
| 47 | { | 47 | { |
| 48 | comparison = String.Compare(tuple.Parent, other.Parent, StringComparison.Ordinal); | 48 | comparison = String.Compare(symbol.Parent, other.Parent, StringComparison.Ordinal); |
| 49 | } | 49 | } |
| 50 | } | 50 | } |
| 51 | } | 51 | } |
| @@ -58,15 +58,15 @@ namespace WixToolset.Core.Link | |||
| 58 | /// Changes all of the parent references to point to the passed in parent reference. | 58 | /// Changes all of the parent references to point to the passed in parent reference. |
| 59 | /// </summary> | 59 | /// </summary> |
| 60 | /// <param name="parent">New parent complex reference.</param> | 60 | /// <param name="parent">New parent complex reference.</param> |
| 61 | public static void Reparent(this WixComplexReferenceTuple tuple, WixComplexReferenceTuple parent) | 61 | public static void Reparent(this WixComplexReferenceSymbol symbol, WixComplexReferenceSymbol parent) |
| 62 | { | 62 | { |
| 63 | tuple.Parent = parent.Parent; | 63 | symbol.Parent = parent.Parent; |
| 64 | tuple.ParentLanguage = parent.ParentLanguage; | 64 | symbol.ParentLanguage = parent.ParentLanguage; |
| 65 | tuple.ParentType = parent.ParentType; | 65 | symbol.ParentType = parent.ParentType; |
| 66 | 66 | ||
| 67 | if (!tuple.IsPrimary) | 67 | if (!symbol.IsPrimary) |
| 68 | { | 68 | { |
| 69 | tuple.IsPrimary = parent.IsPrimary; | 69 | symbol.IsPrimary = parent.IsPrimary; |
| 70 | } | 70 | } |
| 71 | } | 71 | } |
| 72 | } | 72 | } |
diff --git a/src/WixToolset.Core/Link/WixGroupingOrdering.cs b/src/WixToolset.Core/Link/WixGroupingOrdering.cs index 7e0030ca..a7013062 100644 --- a/src/WixToolset.Core/Link/WixGroupingOrdering.cs +++ b/src/WixToolset.Core/Link/WixGroupingOrdering.cs | |||
| @@ -10,7 +10,7 @@ namespace WixToolset.Core.Link | |||
| 10 | using System.Linq; | 10 | using System.Linq; |
| 11 | using System.Text; | 11 | using System.Text; |
| 12 | using WixToolset.Data; | 12 | using WixToolset.Data; |
| 13 | using WixToolset.Data.Tuples; | 13 | using WixToolset.Data.Symbols; |
| 14 | using WixToolset.Extensibility.Services; | 14 | using WixToolset.Extensibility.Services; |
| 15 | using WixToolset.Data.Burn; | 15 | using WixToolset.Data.Burn; |
| 16 | 16 | ||
| @@ -155,7 +155,7 @@ namespace WixToolset.Core.Link | |||
| 155 | foreach (int rowIndex in sortedIndexes) | 155 | foreach (int rowIndex in sortedIndexes) |
| 156 | { | 156 | { |
| 157 | //wixGroupTable.Rows.RemoveAt(rowIndex); | 157 | //wixGroupTable.Rows.RemoveAt(rowIndex); |
| 158 | this.EntrySection.Tuples.RemoveAt(rowIndex); | 158 | this.EntrySection.Symbols.RemoveAt(rowIndex); |
| 159 | } | 159 | } |
| 160 | } | 160 | } |
| 161 | 161 | ||
| @@ -173,7 +173,7 @@ namespace WixToolset.Core.Link | |||
| 173 | // groups to read from that table instead. | 173 | // groups to read from that table instead. |
| 174 | foreach (var item in orderedItems) | 174 | foreach (var item in orderedItems) |
| 175 | { | 175 | { |
| 176 | this.EntrySection.AddTuple(new WixGroupTuple(item.Row.SourceLineNumbers) | 176 | this.EntrySection.AddSymbol(new WixGroupSymbol(item.Row.SourceLineNumbers) |
| 177 | { | 177 | { |
| 178 | ParentId = parentId, | 178 | ParentId = parentId, |
| 179 | ParentType = (ComplexReferenceParentType)Enum.Parse(typeof(ComplexReferenceParentType), parentType), | 179 | ParentType = (ComplexReferenceParentType)Enum.Parse(typeof(ComplexReferenceParentType), parentType), |
| @@ -238,9 +238,9 @@ namespace WixToolset.Core.Link | |||
| 238 | //} | 238 | //} |
| 239 | 239 | ||
| 240 | // Collect all of the groups | 240 | // Collect all of the groups |
| 241 | for (int rowIndex = 0; rowIndex < this.EntrySection.Tuples.Count; ++rowIndex) | 241 | for (int rowIndex = 0; rowIndex < this.EntrySection.Symbols.Count; ++rowIndex) |
| 242 | { | 242 | { |
| 243 | if (this.EntrySection.Tuples[rowIndex] is WixGroupTuple row) | 243 | if (this.EntrySection.Symbols[rowIndex] is WixGroupSymbol row) |
| 244 | { | 244 | { |
| 245 | var rowParentName = row.ParentId; | 245 | var rowParentName = row.ParentId; |
| 246 | var rowParentType = row.ParentType.ToString(); | 246 | var rowParentType = row.ParentType.ToString(); |
| @@ -357,7 +357,7 @@ namespace WixToolset.Core.Link | |||
| 357 | // return; | 357 | // return; |
| 358 | //} | 358 | //} |
| 359 | 359 | ||
| 360 | foreach (var row in this.EntrySection.Tuples.OfType<WixOrderingTuple>()) | 360 | foreach (var row in this.EntrySection.Symbols.OfType<WixOrderingSymbol>()) |
| 361 | { | 361 | { |
| 362 | var rowItemType = row.ItemType.ToString(); | 362 | var rowItemType = row.ItemType.ToString(); |
| 363 | var rowItemName = row.ItemIdRef; | 363 | var rowItemName = row.ItemIdRef; |
| @@ -513,7 +513,7 @@ namespace WixToolset.Core.Link | |||
| 513 | private readonly ItemCollection beforeItems; // for checking for circular references | 513 | private readonly ItemCollection beforeItems; // for checking for circular references |
| 514 | private bool flattenedAfterItems; | 514 | private bool flattenedAfterItems; |
| 515 | 515 | ||
| 516 | public Item(IntermediateTuple row, string type, string id) | 516 | public Item(IntermediateSymbol row, string type, string id) |
| 517 | { | 517 | { |
| 518 | this.Row = row; | 518 | this.Row = row; |
| 519 | this.Type = type; | 519 | this.Type = type; |
| @@ -526,7 +526,7 @@ namespace WixToolset.Core.Link | |||
| 526 | this.flattenedAfterItems = false; | 526 | this.flattenedAfterItems = false; |
| 527 | } | 527 | } |
| 528 | 528 | ||
| 529 | public IntermediateTuple Row { get; private set; } | 529 | public IntermediateSymbol Row { get; private set; } |
| 530 | public string Type { get; private set; } | 530 | public string Type { get; private set; } |
| 531 | public string Id { get; private set; } | 531 | public string Id { get; private set; } |
| 532 | public string Key { get; private set; } | 532 | public string Key { get; private set; } |
