import re


def _GenerateArg(source):
  """Strips out comments, default arguments, and redundant spaces from a single argument.

  Args:
    source: A string for a single argument.

  Returns:
    Rendered string of the argument.
  """
  # Remove end of line comments before eliminating newlines.
  arg = re.sub(r'//.*', '', source)

  # Remove c-style comments.
  arg = re.sub(r'/\*.*\*/', '', arg)

  # Remove default arguments.
  arg = re.sub(r'=.*', '', arg)

  # Collapse spaces and newlines into a single space.
  arg = re.sub(r'\s+', ' ', arg)
  return arg.strip()