parsers: change parser.parse to accept a buffer