mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
support True and False for literal
This commit is contained in:
parent
11dd3c1951
commit
12914f7978
@ -399,6 +399,19 @@ uint8_t args_setLiteral(Args *self, char *targetArgName, char *literal)
|
||||
err = 0;
|
||||
goto exit;
|
||||
}
|
||||
/* match bool */
|
||||
if (strEque(literal, "True"))
|
||||
{
|
||||
args_setInt(self, targetArgName, 1);
|
||||
err = 0;
|
||||
goto exit;
|
||||
}
|
||||
if (strEque(literal, "False"))
|
||||
{
|
||||
args_setInt(self, targetArgName, 0);
|
||||
err = 0;
|
||||
goto exit;
|
||||
}
|
||||
/* match num */
|
||||
if ((literal[0] >= '0') && (literal[0] <= '9'))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user