cursor-type ( cursor -- string )


Vocabulary
libclang

Inputs
cursoran object


Outputs
stringan object


Definition


:: cursor-type ( cursor -- string )
cursor clang_getCursorType clang_getTypeSpelling
clang-get-cstring "const" ?head drop [ 42 = ] cut-tail
[ [ trim-blanks ] dip append ] when* dup :> type {
{
[ dup "struct " head? ]
[
" " split1-last nip
clang-state> unnamed-table>> ?at or
]
}
{
[ dup "union " head? ]
[
" " split1-last nip
clang-state> unnamed-table>> ?at or
]
}
{ [ dup "_Bool" = ] [ drop "bool" ] }
{ [ "int8_t" ?head ] [ trim-blanks "char" prepend ] }
{ [ "int16_t" ?head ] [ trim-blanks "short" prepend ] }
{ [ "int32_t" ?head ] [ trim-blanks "int" prepend ] }
{
[ "int64_t" ?head ]
[ trim-blanks "longlong" prepend ]
}
{ [ "uint8_t" ?head ] [ trim-blanks "uchar" prepend ] }
{
[ "uint16_t" ?head ]
[ trim-blanks "ushort" prepend ]
}
{ [ "uint32_t" ?head ] [ trim-blanks "uint" prepend ] }
{
[ "uint64_t" ?head ]
[ trim-blanks "ulonglong" prepend ]
}
{
[ "signed char" ?head ]
[ trim-blanks "char" prepend ]
}
{
[ "signed short" ?head ]
[ trim-blanks "short" prepend ]
}
{ [ "signed int" ?head ] [ trim-blanks "int" prepend ] }
{
[ "signed long" ?head ]
[ trim-blanks "long" prepend ]
}
{
[ "unsigned char" ?head ]
[ trim-blanks "uchar" prepend ]
}
{
[ "unsigned short" ?head ]
[ trim-blanks "ushort" prepend ]
}
{
[ "unsigned int" ?head ]
[ trim-blanks "uint" prepend ]
}
{
[ "unsigned long" ?head ]
[ trim-blanks "ulong" prepend ]
}
{ [ dup "(*)" swap subseq? ] [ drop "void*" ] }
[ ]
} cond ;