mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Tested custom char trims
This commit is contained in:
@@ -99,6 +99,11 @@ static int nativeTrim(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments)
|
||||
|
||||
if (arguments->count == 2) {
|
||||
trimCharsLiteral = Toy_popLiteralArray(arguments);
|
||||
|
||||
Toy_Literal trimCharsLiteralIdn = trimCharsLiteral;
|
||||
if (TOY_IS_IDENTIFIER(trimCharsLiteral) && Toy_parseIdentifierToValue(interpreter, &trimCharsLiteral)) {
|
||||
Toy_freeLiteral(trimCharsLiteralIdn);
|
||||
}
|
||||
}
|
||||
else {
|
||||
trimCharsLiteral = TOY_TO_STRING_LITERAL(Toy_createRefString(" \t\n\r"));
|
||||
|
||||
Reference in New Issue
Block a user