-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Bind Query Scope and Filter, Effect Target (#105)
* feat: Bind Scope and Filter symbols of a Query part of: Implement Logic in Symbol layer #44 * feat: make characteristics Resources of a Profile * feat: bind Effect.TargetMember * refactor: move around code in Playground Main * fix: bind members in category links * fix: deduplicate characteristics in Profile.Members (fixup) * fix: additional fixes and optimizations for TargetMember binding * refactor: group Playground diagnostics by message * fix: shorten lookup on success when descending * feat: fully bind TargetMember (including link target members) * feat: optimize CategoryEntry binding * feat: optimize type checks (maybe) * feat: optimize lookup in descendants
- Loading branch information
Showing
17 changed files
with
420 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/WarHub.ArmouryModel.Concrete.Extensions/EntryBinder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace WarHub.ArmouryModel.Concrete; | ||
|
||
internal class EntryBinder : Binder | ||
{ | ||
public EntryBinder(EntrySymbol entrySymbol, Binder next) : base(next) | ||
{ | ||
EntrySymbol = entrySymbol; | ||
} | ||
|
||
public EntrySymbol EntrySymbol { get; } | ||
|
||
internal override Symbol? ContainingSymbol => EntrySymbol; | ||
|
||
internal override EntrySymbol? ContainingEntrySymbol => EntrySymbol; | ||
|
||
internal override void LookupSymbolsInSingleBinder(LookupResult result, string symbolId, LookupOptions options, Binder originalBinder, bool diagnose, Symbol? qualifier) | ||
{ | ||
if (qualifier is EntrySymbol entrySymbol && ReferenceEquals(entrySymbol, EntrySymbol)) | ||
{ | ||
LookupSymbolsInQualifyingEntry(entrySymbol, result, symbolId, options, originalBinder, diagnose); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/WarHub.ArmouryModel.Concrete.Extensions/GeneratedCostSymbol.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
namespace WarHub.ArmouryModel.Concrete; | ||
|
||
internal class GeneratedCostSymbol : Symbol, ICostSymbol | ||
{ | ||
public GeneratedCostSymbol(ISymbol? containingSymbol, IResourceDefinitionSymbol type) | ||
{ | ||
ContainingSymbol = containingSymbol; | ||
Type = type; | ||
} | ||
|
||
public override SymbolKind Kind => SymbolKind.ResourceEntry; | ||
|
||
public override string? Id => null; | ||
|
||
public override string Name => Type.Name; | ||
|
||
public override string? Comment => null; | ||
|
||
public override ISymbol? ContainingSymbol { get; } | ||
|
||
public decimal Value => 0m; | ||
|
||
public ResourceKind ResourceKind => ResourceKind.Cost; | ||
|
||
public IResourceDefinitionSymbol Type { get; } | ||
|
||
public IResourceEntrySymbol? ReferencedEntry => null; | ||
|
||
public bool IsHidden => false; | ||
|
||
public bool IsReference => false; | ||
|
||
public IPublicationReferenceSymbol? PublicationReference => null; | ||
|
||
public ImmutableArray<IEffectSymbol> Effects => ImmutableArray<IEffectSymbol>.Empty; | ||
|
||
public ImmutableArray<IResourceEntrySymbol> Resources => ImmutableArray<IResourceEntrySymbol>.Empty; | ||
|
||
IEntrySymbol? IEntrySymbol.ReferencedEntry => null; | ||
|
||
public override void Accept(SymbolVisitor visitor) | ||
{ | ||
visitor.VisitResourceEntry(this); | ||
} | ||
|
||
public override TResult Accept<TResult>(SymbolVisitor<TResult> visitor) | ||
{ | ||
return visitor.VisitResourceEntry(this); | ||
} | ||
|
||
public override TResult Accept<TArgument, TResult>(SymbolVisitor<TArgument, TResult> visitor, TArgument argument) | ||
{ | ||
return visitor.VisitResourceEntry(this, argument); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.