parameters: (*args)
return_statement: return callback
docstring: Callback that yields multiple actions for each group in the match.
docstring_summary: Callback that yields multiple actions for each group in the match.
docstring_tokens: Callback that yields multiple actions for each group in the match .
function: def bygroups(*args):
      """
      Callback that yields multiple actions for each group in the match.
      """
      def callback(lexer, match, ctx=None):
          for i, action in enumerate(args):
              if action is None:
                  continue
              elif type(action) is _TokenType:
                  data = match.group(i + 1)
                  if data:
                      yield match.start(i + 1), action, data
              else:
                  if ctx:
                      ctx.pos = match.start(i + 1)
                  for item in action(lexer, _PseudoMatch(match.start(i + 1),
                                     match.group(i + 1)), ctx):
                      if item:
                          yield item
          if ctx:
              ctx.pos = match.end()
      return callback
function_tokens: def bygroups ( * args ) : def callback ( lexer , match , ctx = None ) : for i , action in enumerate ( args ) : if action is None : continue elif type ( action ) is _TokenType : data = match . group ( i + 1 ) if data : yield match . start ( i + 1 ) , action , data else : if ctx : ctx . pos = match . start ( i + 1 ) for item in action ( lexer , _PseudoMatch ( match . start ( i + 1 ) , match . group ( i + 1 ) ) , ctx ) : if item : yield item if ctx : ctx . pos = match . end ( ) return callback