def parse_line_comment(lang, state, keep_tokens=True):
    """
    Returns the single-line comment at the beginning of state.line,
    otherwise the empty string.

    Args:
      lang (Language):
        Syntax description for the language being parsed.
      state (State):
        Parser state
      keep_tokens (bool, default: True):
        If False, comment tokens are filtered out.
        If True, comment tokens are preserved.

    Returns:
      (string, State)
    """
    line = state.line
    line_comment = lang.line_comment
    if line_comment and line.startswith(line_comment):
        state.line = ''
        i = len(line_comment)
        if not keep_tokens:
            line_comment = ' ' * i
        return line_comment + line[i:], state
    else:
        return '', state