Skip to content

Commit

Permalink
feat: add type checker for unsigned integers
Browse files Browse the repository at this point in the history
  • Loading branch information
Darxo authored and Darxo committed Feb 17, 2024
1 parent ae48997 commit 7e4e034
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions msu/utils/type_checkers.nut
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@
::MSU.requireTypeArray("integer", vargv);
}

::MSU.requireUnsigned <- function( ... )
{
::MSU.requireInt(vargv);
foreach (value in vargv)
{
if (value < 0)
{
::logError(value + " must have the type: unsigned");
throw ::MSU.Exception.InvalidType(value);
}
}
}

::MSU.requireArray <- function( ... )
{
::MSU.requireTypeArray("array", vargv);
Expand Down

0 comments on commit 7e4e034

Please sign in to comment.