Skip to content

Commit 4175843

Browse files
allow variables to use underscores
1 parent 963f61d commit 4175843

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

TokenSystem/Tokens/Variables/VariableToken.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ protected override Result InternalParse(Script scr)
5050
}
5151

5252
Name = RawRep.Substring(1);
53-
if (Name.Any(c => !char.IsLetter(c) && !char.IsDigit(c)))
53+
if (Name.Any(c => !char.IsLetter(c) && !char.IsDigit(c) && c != '_'))
5454
{
55-
return "Variable name must only contain letters and digits.";
55+
return "Variable name can only contain letters, digits and underscores.";
5656
}
5757

5858
return true;

0 commit comments

Comments
 (0)