Adding initial type safety check for parser