(self, ins, token)
return fn(parse_args(ins))
Parse a function starting with the given token.
Parse a function starting with the given token.
Parse a function starting with the given token .
def _parse_function(self, ins, token):
        """Parse a function starting with the given token."""
        ins.read(len(token))
        if token in self._simple:
            # apply functions
            parse_args = self._simple[token]
        else:
            fndict = self._complex[token]
            presign = ins.skip_blank_read_if(fndict)
            if presign:
                token += presign
            try:
                parse_args = fndict[presign]
            except KeyError:
                raise error.BASICError(error.STX)
        if token == tk.FN:
            fnname = ins.read_name()
            # must not be empty
            error.throw_if(not fnname, error.STX)
            # obtain function
            function = self.user_functions.get(fnname)
            # get syntax
            parse_args = partial(self._gen_parse_arguments, length=function.number_arguments())
            fn = function.evaluate
        else:
            fn = self._callbacks[token]
        return fn(parse_args(ins))
def _parse_function ( self , ins , token ) : ins . read ( len ( token ) ) if token in self . _simple : # apply functions parse_args = self . _simple [ token ] else : fndict = self . _complex [ token ] presign = ins . skip_blank_read_if ( fndict ) if presign : token += presign try : parse_args = fndict [ presign ] except KeyError : raise error . BASICError ( error . STX ) if token == tk . FN : fnname = ins . read_name ( ) # must not be empty error . throw_if ( not fnname , error . STX ) # obtain function function = self . user_functions . get ( fnname ) # get syntax parse_args = partial ( self . _gen_parse_arguments , length = function . number_arguments ( ) ) fn = function . evaluate else : fn = self . _callbacks [ token ] return fn ( parse_args ( ins ) )