WIP: doc generator fix for type extraction

previously we barfed on function type definition with optional arguments
like {function(number=)}

this fixes it
WIP: more annotations