fix(util/name): bug in Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
8ce6266e6b
commit
e12d6e44cd
1 changed files with 2 additions and 2 deletions
|
@ -508,14 +508,14 @@ static int name_get_prefix(lua_State * L) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int name_get_numeral(lua_State * L) {
|
static int name_get_numeral(lua_State * L) {
|
||||||
if (to_name(L, 1).is_numeral())
|
if (!to_name(L, 1).is_numeral())
|
||||||
throw exception("invalid get_numeral, hierarchical name with numeric head expected");
|
throw exception("invalid get_numeral, hierarchical name with numeric head expected");
|
||||||
lua_pushinteger(L, to_name(L, 1).get_numeral());
|
lua_pushinteger(L, to_name(L, 1).get_numeral());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int name_get_string(lua_State * L) {
|
static int name_get_string(lua_State * L) {
|
||||||
if (to_name(L, 1).is_string())
|
if (!to_name(L, 1).is_string())
|
||||||
throw exception("invalid get_string, hierarchical name with string head expected");
|
throw exception("invalid get_string, hierarchical name with string head expected");
|
||||||
lua_pushstring(L, to_name(L, 1).get_string());
|
lua_pushstring(L, to_name(L, 1).get_string());
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue