wikitextparser/_parser_function.py
def arguments(self) -> List[Argument]:
        """Parse template content. Create self.name and self.arguments."""
        shadow = self._shadow
        split_spans = self._args_matcher(shadow).spans('arg')
        if not split_spans:
            return []
        arguments = []
        arguments_append = arguments.append
        type_to_spans = self._type_to_spans
        ss, se = span = self._span
        type_ = id(span)
        lststr = self._lststr
        string = lststr[0]
        arg_spans = type_to_spans.setdefault(type_, [])
        span_tuple_to_span_get = {(s[0], s[1]): s for s in arg_spans}.get
        for arg_self_start, arg_self_end in split_spans:
            s, e = arg_span = [ss + arg_self_start, ss + arg_self_end]
            old_span = span_tuple_to_span_get((s, e))
            if old_span is None:
                insort(arg_spans, arg_span)
            else:
                arg_span = old_span
            arg = Argument(lststr, type_to_spans, arg_span, type_)
            arg._shadow_cache = (
                string[s:e], shadow[arg_self_start:arg_self_end])
            arguments_append(arg)
        return arguments
def arguments(self) -> List[Argument]:
        """Parse template content. Create self.name and self.arguments."""
        shadow = self._shadow
        split_spans = self._args_matcher(shadow).spans('arg')
        if not split_spans:
            return []
        arguments = []
        arguments_append = arguments.append
        type_to_spans = self._type_to_spans
        ss, se = span = self._span
        type_ = id(span)
        lststr = self._lststr
        string = lststr[0]
        arg_spans = type_to_spans.setdefault(type_, [])
        span_tuple_to_span_get = {(s[0], s[1]): s for s in arg_spans}.get
        for arg_self_start, arg_self_end in split_spans:
            s, e = arg_span = [ss + arg_self_start, ss + arg_self_end]
            old_span = span_tuple_to_span_get((s, e))
            if old_span is None:
                insort(arg_spans, arg_span)
            else:
                arg_span = old_span
            arg = Argument(lststr, type_to_spans, arg_span, type_)
            arg._shadow_cache = (
                string[s:e], shadow[arg_self_start:arg_self_end])
            arguments_append(arg)
        return arguments
def arguments ( self ) -> List [ Argument ] : shadow = self . _shadow split_spans = self . _args_matcher ( shadow ) . spans ( 'arg' ) if not split_spans : return [ ] arguments = [ ] arguments_append = arguments . append type_to_spans = self . _type_to_spans ss , se = span = self . _span type_ = id ( span ) lststr = self . _lststr string = lststr [ 0 ] arg_spans = type_to_spans . setdefault ( type_ , [ ] ) span_tuple_to_span_get = { ( s [ 0 ] , s [ 1 ] ) : s for s in arg_spans } . get for arg_self_start , arg_self_end in split_spans : s , e = arg_span = [ ss + arg_self_start , ss + arg_self_end ] old_span = span_tuple_to_span_get ( ( s , e ) ) if old_span is None : insort ( arg_spans , arg_span ) else : arg_span = old_span arg = Argument ( lststr , type_to_spans , arg_span , type_ ) arg . _shadow_cache = ( string [ s : e ] , shadow [ arg_self_start : arg_self_end ] ) arguments_append ( arg ) return arguments
Parse template content. Create self.name and self.arguments.
Parse template content . Create self . name and self . arguments .