Skip to content

Commit

Permalink
Adds config macro to turn off missing function warning
Browse files Browse the repository at this point in the history
  • Loading branch information
JujuAdams committed Nov 2, 2020
1 parent f6b3702 commit 7f4a0b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions scripts/__chatterbox_config/__chatterbox_config.gml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
#macro CHATTERBOX_ERROR_INVALID_DATATYPE true //Throw an error when a variable returns a datatype that's unsupported (usually arrays)
#macro CHATTERBOX_ERROR_MISMATCHED_DATATYPE false //Throw an error when two values of different datatypes are being compared
#macro CHATTERBOX_ERROR_NONSTANDARD_SYNTAX true //Throws an error when using a reasonable, though technically illegal, syntax e.g. <<end if>> or <<elseif>>
#macro CHATTERBOX_ERROR_MISSING_FUNCTION true //Throw an error if a function name is unrecognised

#endregion
9 changes: 8 additions & 1 deletion scripts/__chatterbox_evaluate/__chatterbox_evaluate.gml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,14 @@ function __chatterbox_evaluate(_local_scope, _filename, _expression)
}
else
{
__chatterbox_error("Function \"", _expression.name, "\" not defined with chatterbox_add_function()");
if (CHATTERBOX_ERROR_MISSING_FUNCTION)
{
__chatterbox_error("Function \"", _expression.name, "\" not defined with chatterbox_add_function()");
}
else
{
__chatterbox_trace("Error! Function \"", _expression.name, "\" not defined with chatterbox_add_function()");
}
}

return undefined;
Expand Down

0 comments on commit 7f4a0b5

Please sign in to comment.