fix parsing of type field in tag

- fix the bug
- add tests for valid and invalid syntaxes of complex jsdoc types

Fixes #7