jasily/lang/switch.py
def match(self, *args):
        """
        Indicate whether or not to enter a case suite.

        usage:

        ``` py
        for case in switch(value):
            if case('A'):
                pass
            elif case(1, 3):
                pass # for mulit-match.
            else:
                pass # for default.
        ```
        """
        if not args:
            raise SyntaxError('cannot case empty pattern.')

        return self.match_args(self._value, args)
def match(self, *args):
        if not args:
            raise SyntaxError('cannot case empty pattern.')

        return self.match_args(self._value, args)
def match ( self , * args ) : if not args : raise SyntaxError ( 'cannot case empty pattern.' ) return self . match_args ( self . _value , args )
Indicate whether or not to enter a case suite.

        usage:

        ``` py
        for case in switch(value):
            if case('A'):
                pass
            elif case(1, 3):
                pass # for mulit-match.
            else:
                pass # for default.
        ```
Indicate whether or not to enter a case suite .