(self, chars, head)
Parse and add highlighting tags to a given part of the text.

        `chars` is a string with the text to parse and to which
        highlighting is to be applied.

            `head` is the index in the text widget where the text is found.
Parse and add highlighting tags to a given part of the text.
Parse and add highlighting tags to a given part of the text .
def _add_tags_in_section(self, chars, head):
        """Parse and add highlighting tags to a given part of the text.

        `chars` is a string with the text to parse and to which
        highlighting is to be applied.

            `head` is the index in the text widget where the text is found.
        """
        for m in self.prog.finditer(chars):
            for name, matched_text in matched_named_groups(m):
                a, b = m.span(name)
                self._add_tag(a, b, head, name)
                if matched_text in ("def", "class"):
                    if m1 := self.idprog.match(chars, b):
                        a, b = m1.span(1)
                        self._add_tag(a, b, head, "DEFINITION")
def _add_tags_in_section ( self , chars , head ) : for m in self . prog . finditer ( chars ) : for name , matched_text in matched_named_groups ( m ) : a , b = m . span ( name ) self . _add_tag ( a , b , head , name ) if matched_text in ( "def" , "class" ) : if m1 := self . idprog . match ( chars , b ) : a , b = m1 . span ( 1 ) self . _add_tag ( a , b , head , "DEFINITION" )