(self, node)
Walk a function call node.

        Args:
            node: A parser.FunctionCall node that may or may not be a require()
                call

        Yields:
            A tuple (require_path, use_game_loop, require_token).

            require_path: the string value passed to require()
            use_game_loop: the boolean option passed to require()'s options
                table
            require_token: the lexer.Token for the require() statement, for
                error messages
Walk a function call node.
Walk a function call node .
def _walk_FunctionCall(self, node):
        """Walk a function call node.

        Args:
            node: A parser.FunctionCall node that may or may not be a require()
                call

        Yields:
            A tuple (require_path, use_game_loop, require_token).

            require_path: the string value passed to require()
            use_game_loop: the boolean option passed to require()'s options
                table
            require_token: the lexer.Token for the require() statement, for
                error messages
        """
        if (isinstance(node.exp_prefix, parser.VarName) and
                node.exp_prefix.name == lexer.TokName(b'require')):
            arg_exps = node.args.explist.exps if node.args.explist else []
            if len(arg_exps) < 1 or len(arg_exps) > 2:
                self._error_at_node('require() has {} args, should have 1 or 2'
                                    .format(len(arg_exps)), node)
            if (not isinstance(arg_exps[0], parser.ExpValue) or
                    not isinstance(arg_exps[0].value, lexer.TokString)):
                self._error_at_node('require() first argument must be a '
                                    'string literal', node)
            require_path = arg_exps[0].value.value

            use_game_loop = False
            if len(arg_exps) == 2:
                if (not isinstance(arg_exps[1], parser.ExpValue) or
                        not isinstance(arg_exps[1].value, parser.TableConstructor)):  # noqa: E501
                    self._error_at_node('require() second argument must be a '
                                        'table literal', node)
                # require() only has one valid option for now, so hard-code
                # this expectation
                if (len(arg_exps[1].value.fields) != 1 or
                    arg_exps[1].value.fields[0].key_name != lexer.TokName(b'use_game_loop') or  # noqa: E501
                        type(arg_exps[1].value.fields[0].exp.value) != bool):
                    self._error_at_node(
                        'Invalid require() options; did '
                        'you mean {use_game_loop=true} ?', node)
                use_game_loop = arg_exps[1].value.fields[0].exp.value

            yield (require_path, use_game_loop, self._tokens[node.start_pos])
def _walk_FunctionCall ( self , node ) : if ( isinstance ( node . exp_prefix , parser . VarName ) and node . exp_prefix . name == lexer . TokName ( b'require' ) ) : arg_exps = node . args . explist . exps if node . args . explist else [ ] if len ( arg_exps ) < 1 or len ( arg_exps ) > 2 : self . _error_at_node ( 'require() has {} args, should have 1 or 2' . format ( len ( arg_exps ) ) , node ) if ( not isinstance ( arg_exps [ 0 ] , parser . ExpValue ) or not isinstance ( arg_exps [ 0 ] . value , lexer . TokString ) ) : self . _error_at_node ( 'require() first argument must be a ' 'string literal' , node ) require_path = arg_exps [ 0 ] . value . value use_game_loop = False if len ( arg_exps ) == 2 : if ( not isinstance ( arg_exps [ 1 ] , parser . ExpValue ) or not isinstance ( arg_exps [ 1 ] . value , parser . TableConstructor ) ) : # noqa: E501 self . _error_at_node ( 'require() second argument must be a ' 'table literal' , node ) # require() only has one valid option for now, so hard-code # this expectation if ( len ( arg_exps [ 1 ] . value . fields ) != 1 or arg_exps [ 1 ] . value . fields [ 0 ] . key_name != lexer . TokName ( b'use_game_loop' ) or # noqa: E501 type ( arg_exps [ 1 ] . value . fields [ 0 ] . exp . value ) != bool ) : self . _error_at_node ( 'Invalid require() options; did ' 'you mean {use_game_loop=true} ?' , node ) use_game_loop = arg_exps [ 1 ] . value . fields [ 0 ] . exp . value yield ( require_path , use_game_loop , self . _tokens [ node . start_pos ] )