Parse a string with the language represented by this parser.

        :param line: A string representing an instance of this parser's language
        :param line_number: The current line number of the parser
193890
def parseString(self, line: str, line_number: int = 0) -> ParseResults:  # noqa: N802
        
        self._line_number = line_number
        return self.language.parseString(line)
1016343
def parse(self, line=None):
        """"""
        args = self.parser.parse_args(args=line)
        return args.func(args)
222127
def find_in_line(line):  # type: (str)->Tuple[Optional[str],Optional[str]]
    
    if not line:
        return None, None
    for version_token in version_tokens:

        by_ast = find_by_ast(line, version_token)
        by_ast = validate_string(by_ast)
        if by_ast:
            return by_ast, version_token

        by_string_lib = find_version_by_string_lib(line, version_token)
        by_string_lib = validate_string(by_string_lib)
        if by_string_lib:
            return by_string_lib, version_token

        by_regex = find_version_by_regex(line, version_token)
        by_regex = validate_string(by_regex)
        if by_regex:
            return by_regex, version_token
    return None, None
242386
def parse (cls, line, lineno, log, cmddict=None):
    
    delay = -1
    token = line.split()[0]
    start = line.find(token)
    pos   = SeqPos(line, lineno, start + 1, start + len(token))

    try:
      delay = float(token)
    except ValueError:
      msg = 'String "%s" could not be interpreted as a numeric time delay.'
      log.error(msg % token, pos)

    return cls(delay, pos)
849341
def parse_line(line):
    
    if not line.startswith(b'PROXY'):
        raise exc.InvalidLine('Missing "PROXY" prefix', line)
    if not line.endswith(CRLF):
        raise exc.InvalidLine('Missing "\\r\\n" terminal', line)
    parts = line[:-len(CRLF)].split(b' ')
    if len(parts) != 6:
        raise exc.InvalidLine('Expected 6 " " delimited parts', line)

    inet, src_addr, dst_addr = parts[1:4]
    if inet == b'TCP4':
        try:
            socket.inet_pton(socket.AF_INET, src_addr)
            socket.inet_pton(socket.AF_INET, dst_addr)
        except socket.error:
            raise exc.InvalidLine('Invalid INET {0} address(es)'.format(inet), line)
    elif inet == b'TCP6':
        try:
            socket.inet_pton(socket.AF_INET6, src_addr)
            socket.inet_pton(socket.AF_INET6, dst_addr)
        except socket.error:
            raise exc.InvalidLine('Invalid INET {0} address(es)'.format(inet), line)
    else:
        raise exc.InvalidLine('Unsupported INET "{0}"'.format(inet), line)
    try:
        src_port = int(parts[4])
        dst_port = int(parts[5])
    except (TypeError, ValueError):
        raise exc.InvalidLine(line, 'Invalid port')

    return ProxyInfo(
        source_address=src_addr,
        source_port=src_port,
        destination_address=dst_addr,
        destination_port=dst_port,
    )
662812
def process_line(line, line_number, filename)
      warnings = all_warnings_for_line(line, line_number, filename)
      fix_input(warnings, line, line_number, filename) if @settings[:fix]
      warnings
    end
315175
def parse_line
      s0 = @current_pos
      s1 = match_regexp(/^[▲△]/)
      if s1 != :failed
        s1 = if s1 == "▲"
               { "color" => 0 }
             else
               { "color" => 1 }
             end
        s2 = parse_fugou
        if s2 != :failed
          s3 = []
          s4 = parse_nl
          s4 = match_space if s4 == :failed
          while s4 != :failed
            s3 << s4
            s4 = parse_nl
            s4 = match_space if s4 == :failed
          end
          @reported_pos = s0
          s0 = s2.merge(s1)
        else
          @current_pos = s0
          s0 = :failed
        end
      else
        @current_pos = s0
        s0 = :failed
      end
      s0
    end
951241
def metadata_and_language_from_option_line(self, line):
        """"""
        if self.start_code_re.match(line):
            self.language, self.metadata = self.options_to_metadata(self.start_code_re.findall(line)[0])
521894
def metadata_and_language_from_option_line(self, line):
        """"""
        if self.start_code_re.match(line):
            self.language, self.metadata = self.options_to_metadata(line[line.find('%%') + 2:])
        elif self.alternative_start_code_re.match(line):
            self.metadata = {}
1215421
def parse_line(self, line_str):
        
        line_str = line_str.rstrip()
        if not line_str:
            return None  # empty line, EOF
        arr = self._split_line(line_str)
        # CHROM
        chrom = arr[0]
        # POS
        pos = int(arr[1])
        # IDS
        if arr[2] == ".":
            ids = []
        else:
            ids = arr[2].split(";")
        # REF
        ref = arr[3]
        # ALT
        alts = []
        if arr[4] != ".":
            for alt in arr[4].split(","):
                alts.append(process_alt(self.header, ref, alt))
        # QUAL
        if arr[5] == ".":
            qual = None
        else:
            try:
                qual = int(arr[5])
            except ValueError:  # try as float
                qual = float(arr[5])
        # FILTER
        if arr[6] == ".":
            filt = []
        else:
            filt = arr[6].split(";")
        self._check_filters(filt, "FILTER")
        # INFO
        info = self._parse_info(arr[7], len(alts))
        if len(arr) == 9:
            raise exceptions.IncorrectVCFFormat("Expected 8 or 10+ columns, got 9!")
        elif len(arr) == 8:
            format_ = None
            calls = None
        else:
            # FORMAT
            format_ = arr[8].split(":")
            # sample/call columns
            calls = self._handle_calls(alts, format_, arr[8], arr)
        return record.Record(chrom, pos, ids, ref, alts, qual, filt, info, format_, calls)
1355309
def p_preprocessor_line_line(p):
    
    p.lexer.lineno = int(p[2]) + p.lexer.lineno - p.lineno(2)
659171
function parse(line) {
  assert_str(line)

  return Either.either(pipe, noop, Right(line).chain(is_inlined).chain(is_native).chain(is_not_inlined))
}
594960
def parse_line(self, line):
        """"""
        # The parser may only need to run until it has seen a specific line.
        # Once that's occurred, it can mark itself as complete, to save
        # being run against later log lines.
        if self.parser.complete:
            return

        # Perf data is stored in a json structure contained in a single line,
        # if the MAX_LINE_LENGTH is applied the data structure could be
        # truncated, preventing it from being ingested.
        if 'PERFHERDER_DATA' not in line:
            line = line[:self.MAX_LINE_LENGTH]

        self.parser.parse_line(line, self.lineno)
        self.lineno += 1
912095
def _parseline(self, line):
        
        sline = line.split(SEPARATOR)
        segment = sline[0]
        handlers = {
            SEGMENT_HEADER: self._handle_header,
            SEGMENT_EOF: self._handle_eof,
            SEGMENT_RESULT: self._handle_result_line,
            SEGMENT_OBSERVATION_ORDER: self._handle_new_record
        }
        handler = handlers.get(segment)
        if handler:
            return handler(sline)
        return 0
1369724
def parse(self, lines):
        ''''''
        if self.type == 'msdos':
            return self.parse_msdos(lines)
        elif self.type == 'unix':
            return self.parse_unix(lines)
        elif self.type == 'nlst':
            return self.parse_nlst(lines)
        else:
            raise UnknownListingError('Unsupported listing type.')
814920
def line_type(self, line_type):
        
        allowed_values = ["linear", "step-before", "step-after", "basis", "cardinal", "monotone"]  # noqa: E501
        if line_type not in allowed_values:
            raise ValueError(
                "Invalid value for `line_type` ({0}), must be one of {1}"  # noqa: E501
                .format(line_type, allowed_values)
            )

        self._line_type = line_type
634601
def parse_line(self, text, fh=None):
        """"""
        match = self.ok.match(text)
        if match:
            return self._parse_result(True, match, fh)

        match = self.not_ok.match(text)
        if match:
            return self._parse_result(False, match, fh)

        if self.diagnostic.match(text):
            return Diagnostic(text)

        match = self.plan.match(text)
        if match:
            return self._parse_plan(match)

        match = self.bail.match(text)
        if match:
            return Bail(match.group("reason"))

        match = self.version.match(text)
        if match:
            return self._parse_version(match)

        return Unknown()