Skip to content

Commit b148c49

Browse files
add ValueType and RawRepr properties to VariableToken
1 parent 0a64fd5 commit b148c49

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

TokenSystem/Tokens/VariableTokens/VariableToken.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ public abstract class VariableToken : BaseToken, IContextableToken
1515
public abstract char Prefix { get; }
1616
public abstract string Name { get; protected set; }
1717
public abstract Type VariableType { get; }
18-
18+
public abstract Type ValueType { get; }
19+
20+
public abstract TryGet<Context> TryGetContext(Script scr);
21+
1922
public TryGet<Variable> TryGetVariable()
2023
{
2124
return Script.TryGetVariable<Variable>(this);
2225
}
23-
24-
public abstract TryGet<Context> TryGetContext(Script scr);
26+
27+
public string RawRepr => $"{Prefix}{Name}";
2528
}
2629

2730
public abstract class VariableToken<TVariable, TValue> : VariableToken, IValueToken
@@ -31,6 +34,7 @@ public abstract class VariableToken<TVariable, TValue> : VariableToken, IValueTo
3134
public override string Name { get; protected set; } = null!;
3235

3336
public override Type VariableType => typeof(TVariable);
37+
public override Type ValueType => typeof(TValue);
3438

3539
public new TryGet<TVariable> TryGetVariable()
3640
{

0 commit comments

Comments
 (0)