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])"; result "func:exists(//struct[@name=$idltype])";
} }
def "func:idl_type_is_of_typekind_list" { def "func:idl_type_is_generic§" {
param "idltype"; 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" { def "func:idl_type_get_typekind_of_type" {
param "idltype"; param "idltype";
choose { choose {
@ -76,8 +78,8 @@ def "func:idl_type_get_typekind_of_type" {
result > enum result > enum
when "func:idl_type_is_of_typekind_struct($idltype)" when "func:idl_type_is_of_typekind_struct($idltype)"
result > struct result > struct
when "func:idl_type_is_of_typekind_list($idltype)" when "func:idl_type_is_generic($idltype)"
result > list result > generic
otherwise otherwise
result "false()"; result "false()";

Loading…
Cancel
Save