def update_syntax_highlight_data(self):
        """Map and store syntax highlight data for text."""
        ### try mapping the syntax, generating data to help
        ### identify different parts of the text
        try:
            self.highlight_data = self.get_syntax_map(self.get_text())

        ### if the syntax mapping fails, for instance, due
        ### to a syntax error, create data that maps all
        ### contents as if they were normal text;
        ###
        ### this serves as an indicator for the user that
        ### the text has a syntax error;
        ###
        ### additionally, this error might also be caused by
        ### a bug in the syntax mapping function, so if
        ### the error occurs with text known to have no
        ### syntax errors, the mapping function should be
        ### checked;

        except SyntaxMappingError:

            self.highlight_data = {
                ## store a dict item where the line index is
                ## the key and another dict is the value
                line_index: {
                    ## in this dict, an interval representing
                    ## the indices of all items of the line
                    ## (character objects) is used as the
                    ## key, while the 'normal' string is used
                    ## as value, indicating that all content
                    ## must be considered normal text
                    (0, len(line)): "normal"
                }
                ## for each line_index and respective line
                for line_index, line in enumerate(self.lines)
                ## but only if the line isn't empty
                if line
            }
Map and store syntax highlight data for text.
nodezator/textman/editor/cursor/syntaxhigh.py