Skip to content

Commit 7698aab

Browse files
committed
#153 - use name instead of id in symbols
1 parent 879825f commit 7698aab

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Domain/HydraScript.Domain.IR/Impl/Symbols/FunctionSymbol.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void DefineReturnType(Type returnType) =>
2525
_returnType = returnType;
2626

2727
public override string ToString() =>
28-
new StringBuilder($"function {Id}(")
28+
new StringBuilder($"function {Name}(")
2929
.AppendJoin(',', Parameters)
3030
.Append($") => {Type}")
3131
.ToString();

src/Domain/HydraScript.Domain.IR/Impl/Symbols/TypeSymbol.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ public class TypeSymbol(Type type, string? name = null) :
99

1010
public override bool Equals(object? obj) =>
1111
obj is TypeSymbol typeSymbol &&
12-
Id == typeSymbol.Id && Type.Equals(typeSymbol.Type);
12+
Name == typeSymbol.Name && Type.Equals(typeSymbol.Type);
1313

1414
public override int GetHashCode() =>
15-
HashCode.Combine(Id, Type);
15+
HashCode.Combine(Name, Type);
1616

1717
public override string ToString() =>
18-
$"type {Id} = {Type}";
18+
$"type {Name} = {Type}";
1919
}

src/Domain/HydraScript.Domain.IR/Impl/Symbols/VariableSymbol.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ public class VariableSymbol(
1515
public void Initialize() => Initialized = true;
1616

1717
public override string ToString() =>
18-
$"{(ReadOnly ? "const " : "")}{Id}: {Type}";
18+
$"{(ReadOnly ? "const " : "")}{Name}: {Type}";
1919
}

0 commit comments

Comments
 (0)