parameters: (self, ln, p, unused_pb=None)
docstring: Macro definition' stores a subtree with var placeholders (%0, %1...).
docstring_summary: Macro definition' stores a subtree with var placeholders (%0, %1...).
docstring_tokens: Macro definition stores a subtree with var placeholders ( %0 %1 ... ) .
function: def _interface(self, ln, p, unused_pb=None):
      """'Macro definition' stores a subtree with var placeholders (%0, %1...)."""
      assert len(p) > 2, p
      nargs = len(p) - 2  # 0-name, -1-block, [1:-1]-args
      name = p[0]
      self.check_known_name(name)
      args = {name: pos for pos, name in enumerate(p[:-1])}
      if len(args) != nargs+1:
        raise NameError('all interface args must be different '
                        'at line %d, got %s<%s>' % (ln, name, ', '.join(p[1:-1])))
      src = p[-1]
      if nargs:
        for ast in src:
          if ast[0] == 'func':
            for p in ast.params:
              _subst_type_formal(p, args)
            for p in ast.returns:
              _subst_type_formal(p, args)
          elif ast[0] == 'var':
            _subst_type_formal(ast, args)
          else:
            raise NameError('Only def and var allowed in interface,'
                            ' found "%s" at line %d' % (ast[0], ln))
      self._macros[name] = nargs, src, True
function_tokens: def _interface ( self , ln , p , unused_pb = None ) : assert len ( p ) > 2 , p nargs = len ( p ) - 2 # 0-name, -1-block, [1:-1]-args name = p [ 0 ] self . check_known_name ( name ) args = { name : pos for pos , name in enumerate ( p [ : - 1 ] ) } if len ( args ) != nargs + 1 : raise NameError ( 'all interface args must be different ' 'at line %d, got %s<%s>' % ( ln , name , ', ' . join ( p [ 1 : - 1 ] ) ) ) src = p [ - 1 ] if nargs : for ast in src : if ast [ 0 ] == 'func' : for p in ast . params : _subst_type_formal ( p , args ) for p in ast . returns : _subst_type_formal ( p , args ) elif ast [ 0 ] == 'var' : _subst_type_formal ( ast , args ) else : raise NameError ( 'Only def and var allowed in interface,' ' found "%s" at line %d' % ( ast [ 0 ] , ln ) ) self . _macros [ name ] = nargs , src , True