File tree Expand file tree Collapse file tree 4 files changed +22
-4
lines changed
Application/HydraScript.Application.StaticAnalysis/Visitors
Domain/HydraScript.Domain.BackEnd
Instructions/WithAssignment Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -268,11 +268,11 @@ public Type Visit(LexicalDeclaration visitable)
268268 {
269269 var assignment = visitable . Assignments [ i ] ;
270270 var registeredSymbol = _symbolTables [ visitable . Scope ] . FindSymbol < VariableSymbol > (
271- assignment . Destination . Id ) ;
271+ assignment . Destination . Id ) ! ;
272272 var sourceType = assignment . Source . Accept ( This ) ;
273273 if ( sourceType . Equals ( undefined ) )
274274 throw new CannotDefineType ( assignment . Source . Segment ) ;
275- if ( ! registeredSymbol ! . Type . Equals ( undefined ) && ! registeredSymbol . Type . Equals ( sourceType ) )
275+ if ( ! registeredSymbol . Type . Equals ( undefined ) && ! registeredSymbol . Type . Equals ( sourceType ) )
276276 throw new IncompatibleTypesOfOperands (
277277 assignment . Segment ,
278278 left : registeredSymbol . Type ,
Original file line number Diff line number Diff line change @@ -2,5 +2,7 @@ namespace HydraScript.Domain.BackEnd;
22
33public interface IAddress : IEquatable < IAddress >
44{
5- IAddress Next { get ; set ; }
5+ public IAddress Next { get ; set ; }
6+
7+ public string Name { get ; }
68}
Original file line number Diff line number Diff line change @@ -3,11 +3,27 @@ namespace HydraScript.Domain.BackEnd.Impl.Addresses;
33public class HashAddress ( int seed ) : IAddress
44{
55 private readonly int _seed = seed ;
6+ private string ? _name ;
67
78 private readonly Guid _id = Guid . NewGuid ( ) ;
89
910 public IAddress Next { get ; set ; } = default ! ;
1011
12+ public string Name
13+ {
14+ get
15+ {
16+ if ( _name is null )
17+ {
18+ var baseName = $ "{ unchecked ( ( uint ) GetHashCode ( ) ) } { _id : N} ";
19+ var nameArray = Random . Shared . GetItems ( baseName . AsSpan ( ) , 10 ) ;
20+ _name = new string ( nameArray ) ;
21+ }
22+
23+ return _name ;
24+ }
25+ }
26+
1127 public bool Equals ( IAddress ? other )
1228 {
1329 if ( other is HashAddress hashed )
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public Simple(
4545 }
4646
4747 protected override void OnSetOfAddress ( IAddress address ) =>
48- Left ??= $ "_t { unchecked ( ( uint ) address . GetHashCode ( ) ) } " ;
48+ Left ??= address . Name ;
4949
5050 public override IAddress Execute ( IExecuteParams executeParams )
5151 {
You can’t perform that action at this time.
0 commit comments