Skip to content

Commit 12914f7

Browse files
author
lyon
committed
support True and False for literal
1 parent 11dd3c1 commit 12914f7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/package/pikascript/pikascript-core/dataArgs.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,19 @@ uint8_t args_setLiteral(Args *self, char *targetArgName, char *literal)
399399
err = 0;
400400
goto exit;
401401
}
402+
/* match bool */
403+
if (strEque(literal, "True"))
404+
{
405+
args_setInt(self, targetArgName, 1);
406+
err = 0;
407+
goto exit;
408+
}
409+
if (strEque(literal, "False"))
410+
{
411+
args_setInt(self, targetArgName, 0);
412+
err = 0;
413+
goto exit;
414+
}
402415
/* match num */
403416
if ((literal[0] >= '0') && (literal[0] <= '9'))
404417
{

0 commit comments

Comments
 (0)