'Parse the \'filename\' for the given \'ft\' and watch it for changes in
the future.'

def _parse_snippets(self, ft, filename):

    self._file_hashes[filename] = _hash_file(filename)
    file_data = compatibility.open_ascii_file(filename, 'r').read()
    for (event, data) in self._parse_snippet_file(file_data, filename):
        if (event == 'error'):
            (msg, line_index) = data
            filename = _vim.eval(('fnamemodify(%s,    ":~:.")' % _vim.escape(filename)))
            raise SnippetSyntaxError(filename, line_index, msg)
        elif (event == 'clearsnippets'):
            (priority, triggers) = data
            self._snippets[ft].clear_snippets(priority, triggers)
        elif (event == 'extends'):
            (filetypes,) = data
            self.update_extends(ft, filetypes)
        elif (event == 'snippet'):
            (snippet,) = data
            self._snippets[ft].add_snippet(snippet)
        else:
            assert False, ('Unhandled    %s:    %r' % (event, data))
