pyebnf/primitive.py
def _call_extractor(extractor, text):
  """This method calls an extractor on some text.

  If extractor is just a string, it is passed as the first value to _get_terminal. Otherwise it is
  treated as a callable and text is passed directly to it.

  This makes it so you can have a shorthand of terminal(val) <-> val.
  """
  if isinstance(extractor, str):
    return _get_terminal(extractor, text)
  else:
    return extractor(text)
def _call_extractor(extractor, text):
  """This method calls an extractor on some text.

  If extractor is just a string, it is passed as the first value to _get_terminal. Otherwise it is
  treated as a callable and text is passed directly to it.

  This makes it so you can have a shorthand of terminal(val) <-> val.
  """
  if isinstance(extractor, str):
    return _get_terminal(extractor, text)
  else:
    return extractor(text)
This method calls an extractor on some text.

  If extractor is just a string, it is passed as the first value to _get_terminal. Otherwise it is
  treated as a callable and text is passed directly to it.

  This makes it so you can have a shorthand of terminal(val) <-> val.