def _handle_parameter(self, default):
        """Handle a case where a parameter is at the head of the tokens.

        *default* is the value to use if no parameter name is defined.
        """
        key = None
        showkey = False
        self._push()
        while self._tokens:
            token = self._tokens.pop()
            if isinstance(token, tokens.TemplateParamEquals):
                key = self._pop()
                showkey = True
                self._push()
            elif isinstance(token, (tokens.TemplateParamSeparator,
                                    tokens.TemplateClose)):
                self._tokens.append(token)
                value = self._pop()
                if key is None:
                    key = Wikicode(SmartList([Text(str(default))]))
                return Parameter(key, value, showkey)
            else:
                self._write(self._handle_token(token))
        raise ParserError("_handle_parameter() missed a close token")
def _handle_parameter ( self , default ) : key = None showkey = False self . _push ( ) while self . _tokens : token = self . _tokens . pop ( ) if isinstance ( token , tokens . TemplateParamEquals ) : key = self . _pop ( ) showkey = True self . _push ( ) elif isinstance ( token , ( tokens . TemplateParamSeparator , tokens . TemplateClose ) ) : self . _tokens . append ( token ) value = self . _pop ( ) if key is None : key = Wikicode ( SmartList ( [ Text ( str ( default ) ) ] ) ) return Parameter ( key , value , showkey ) else : self . _write ( self . _handle_token ( token ) ) raise ParserError ( "_handle_parameter() missed a close token" )
Handle a case where a parameter is at the head of the tokens.

        *default* is the value to use if no parameter name is defined.