Пример #1
0
    def del_fsm_char_pattern(cls, ch):
        """Delete previously registered FSM character pattern.
        
        :Parameters:
            ch : str
                the FSM character
        :Note:

            If it doesn't exist, this method will create empty dictionary
            ``_fsm_char_patterns`` within ``cls`` subclass (as a class
            attribute).
                
        :Note:

            This method may throw exceptions in case the `ch` was not
            registered. For exception specification, see documentation of
            `ezmlex.patterns.del_pattern()`.
        """
        from ezmlex.patterns import del_pattern
        del_pattern(cls.fsm_char_patterns(), ch)
Пример #2
0
    def del_pattern(cls, *args):
        """Delete previously registered helper pattern from the tokenizer.
        
        :Parameters:
            args
                arguments and their meaning are same as for
                `ezmlex.patterns.del_pattern()`,
                except that there must be no ``tab`` argument in 
                ``*args`` list, and the ``*args`` list must start from ``_id``.

        :Note:

            If it doesn't exist, this method will create empty dictionary
            ``_char_classes`` within ``cls`` subclass (as a class attribute).
                
        :Note:

            This method may throw exceptions in case the requested pattern was
            not registered. For exception specification, see documentation of
            `ezmlex.patterns.del_pattern()`.
        """
        from ezmlex.patterns import del_pattern
        del_pattern(cls.patterns(), *args)