Browse Source

idl-api: add idl_type_is_generic()

main
heck 2 years ago
parent
commit
f365db6b93
  1. 10
      idl/idl_api.ysl2

10
idl/idl_api.ysl2

@ -60,11 +60,13 @@ def "func:idl_type_is_of_typekind_struct" {
result "func:exists(//struct[@name=$idltype])";
}
def "func:idl_type_is_of_typekind_list" {
def "func:idl_type_is_generic§" {
param "idltype";
result "false()";
result "contains($idltype,'<') and contains($idltype,'>')"
}
// TODO: generic is actually not a typekid, this should return the generic typekind like list/map/pair
def "func:idl_type_get_typekind_of_type" {
param "idltype";
choose {
@ -76,8 +78,8 @@ def "func:idl_type_get_typekind_of_type" {
result > enum
when "func:idl_type_is_of_typekind_struct($idltype)"
result > struct
when "func:idl_type_is_of_typekind_list($idltype)"
result > list
when "func:idl_type_is_generic($idltype)"
result > generic
otherwise
result "false()";

Loading…
Cancel
Save