function _clearCache(cm) {
        cache = null;
        if (cm) { // event handler
            cm.off("changes", _clearCache);
        }
    }
Functions for iterating through tokens in the current editor buffer. Useful for doing
light parsing that can rely purely on information gathered by the code coloring mechanism.