Skip to content

Commit 8b6c49f

Browse files
add IError to GlobalVariable method
1 parent ddd5d94 commit 8b6c49f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

MethodSystem/Methods/GeneralVariableMethods/GlobalVariableMethod.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@
22
using SER.ArgumentSystem.BaseArguments;
33
using SER.Helpers.Exceptions;
44
using SER.MethodSystem.BaseMethods;
5+
using SER.MethodSystem.MethodDescriptors;
56
using SER.TokenSystem.Tokens.VariableTokens;
67
using SER.VariableSystem;
78

89
namespace SER.MethodSystem.Methods.GeneralVariableMethods;
910

10-
public class GlobalVariableMethod : SynchronousMethod
11+
public class GlobalVariableMethod : SynchronousMethod, ICanError
1112
{
1213
public override string Description => "Makes a provided local variable into a global variable.";
1314

15+
public string[] ErrorReasons =>
16+
[
17+
"Provided variable does not exist."
18+
];
19+
1420
public override Argument[] ExpectedArguments { get; } =
1521
[
1622
new TokenArgument<VariableToken>("variable to make global")
1723
];
18-
24+
1925
public override void Execute()
2026
{
2127
var variableToken = Args.GetToken<VariableToken>("variable to make global");

0 commit comments

Comments
 (0)