Parse double-quoted argument.

        Raises:
            EndOfInput: If past the end of input.
342249
def dq_argument(self) -> str:
        
        def escape():
            self._escape = True
            return 1
        self._escape = False                 # any escaped chars?
        self.offset += 1
        start = self.offset
        self.dfa([
            {  # state 0: argument
                "": lambda: 0,
                '"': lambda: -1,
                "\\": escape
            },
            {  # state 1: after escape
                "": lambda: 0
            }])
        self._arg += (self.unescape(self.input[start:self.offset])
                      if self._escape else self.input[start:self.offset])
        self.offset += 1
1090856
private void parse(String input) {
        char[] data = input.toCharArray();
        int start = 0;
        int hard_stop = data.length - 1;
        while (start < data.length) {
            if (this.mySep == data[start]) {
                start++;
                continue;
            }
            // look for the '=', end of data, or the separator
            int end = start;
            String key = null;
            boolean insideQuotes = false;
            while (end < data.length) {
                boolean extract = false;
                if ('"' == data[end]) {
                    insideQuotes = !insideQuotes;
                } else if (this.mySep == data[end]) {
                    extract = true;
                    end--;
                } else if ('=' == data[end]) {
                    // found a key
                    key = extractString(data, start, end - 1);
                    end++; // past the '='
                    start = end;
                    continue;
                }
                // if we're on the last character then always extract and quit
                if (end == hard_stop) {
                    extract = true;
                }

                // if we need to, extract the value and continue
                if (extract) {
                    String value = extractString(data, start, end);
                    if (null == key) {
                        addElement(value);
                    } else {
                        addElement(key, value);
                    }
                    // at this point, end is pointing to the last char of the val
                    end = end + 2; // jump past delim
                    start = end;
                    if (!insideQuotes) {
                        break; // out of while
                    }
                    continue;
                }
                end++;
            }
        }
    }
1129601
def _parse_and_return_quoted_string(self):
        
        result = []
        pos = self.pos + 1
        segment_begin = pos
        my_chr = my_unichr if isinstance(self.text, my_unicode) else utf8chr
        while pos < self.end:
            c = self.text[pos]
            if c < ' ' and c != '\t':
                self.skip_to(pos)
                self.error('Encountered a control character that isn\'t allowed in quoted strings.')
            elif c == '"':
                if segment_begin < pos:
                    result.append(self.text[segment_begin:pos])
                pos += 1
                return ''.join(result), True, pos
            elif c == '\\':
                if segment_begin < pos:
                    result.append(self.text[segment_begin:pos])
                pos += 1
                if pos >= self.end:
                    break
                c = self.text[pos]
                if c == 'u':
                    code_point, pos = self._handle_unicode_escape(pos)
                    result.append(my_chr(code_point))
                else:
                    char, pos = self._handle_escape(pos, c)
                    result.append(char)
                segment_begin = pos
            else:
                pos += 1
        self.error('Reached the end of stream while parsing quoted string.')
227954
private void parseComment() throws Exception {
        boolean saved = expandPE;

        expandPE = false;
        parseUntil(endDelimComment);
        require('>');
        expandPE = saved;
        handler.comment(dataBuffer, 0, dataBufferPos);
        dataBufferPos = 0;
    }
841586
def parse_arg(arg: str) -> typing.Tuple[str, typing.Any]:
    
    assert '=' in arg, 'Unrecognized argument `{}`. [name]=[value] expected.'.format(arg)

    key = arg[:arg.index('=')]
    value = yaml.load(arg[arg.index('=') + 1:])

    return key, value
860105
def parse(self, input, **kwargs):
        
        return self._parser.parse(input, lexer=self._lexer, **kwargs)
938293
def get_quoted_strings(quoted_string):
    '''
    
    '''
    try:
        # This regex grabs all quoted data from string.
        # Note that this gets everything in between the first and last double quote.
        # This is intentional, as printed (and quoted) strings from a target file may contain
        # double quotes, and this function should ignore those. However, it also means that any
        # data between two quoted strings (ex: '"quote 1" non-quoted data
        # "quote 2"') will also be included.
        return re.findall(r'\"(.*)\"', quoted_string)[0]
    except KeyboardInterrupt as e:
        raise e
    except Exception:
        return ''
620824
public static Parser<String> quoted(char begin, char end) {
    Pattern beforeClosingQuote =
        Patterns.isChar(begin).next(Patterns.many(CharPredicates.notChar(end)));
    return beforeClosingQuote.toScanner(Character.toString(begin)).next(isChar(end)).source();
  }
1176280
@SuppressWarnings("fallthrough")
    protected DCText quotedString() {
        int pos = bp;
        nextChar();

        loop:
        while (bp < buflen) {
            switch (ch) {
                case '\n': case '\r': case '\f':
                    newline = true;
                    break;

                case ' ': case '\t':
                    break;

                case '"':
                    nextChar();
                    // trim trailing white-space?
                    return m.at(pos).newTextTree(newString(pos, bp));

                case '@':
                    if (newline)
                        break loop;

            }
            nextChar();
        }
        return null;
    }
570654
def is_quoted(position, text):
    """"""
    def matching(quotemark1, quotemark2):
        straight = '\"\''
        curly = '“”'
        if quotemark1 in straight and quotemark2 in straight:
            return True
        if quotemark1 in curly and quotemark2 in curly:
            return True
        else:
            return False

    def find_ranges(text):
        s = 0
        q = pc = ''
        start = None
        ranges = []
        seps = " .,:;-\r\n"
        quotes = ['\"', '“', '”', "'"]
        for i, c in enumerate(text + "\n"):
            if s == 0 and c in quotes and pc in seps:
                start = i
                s = 1
                q = c
            elif s == 1 and matching(c, q):
                s = 2
            elif s == 2:
                if c in seps:
                    ranges.append((start+1, i-1))
                    start = None
                    s = 0
                else:
                    s = 1
            pc = c
        return ranges

    def position_in_ranges(ranges, position):
        for start, end in ranges:
            if start <= position < end:
                return True
        return False

    return position_in_ranges(find_ranges(text), position)
546445
def parse(self, ctx, ref, text):
        

        self.ctx = ctx
        self.pos = error.Position(ref)
        self.top = None
        try:
            self.tokenizer = YangTokenizer(text, self.pos, ctx.errors,
                                           ctx.max_line_len, ctx.keep_comments,
                                           not ctx.lax_quote_checks)
            stmt = self._parse_statement(None)
        except error.Abort:
            return None
        except error.Eof as e:
            error.err_add(self.ctx.errors, self.pos, 'EOF_ERROR', ())
            return None
        try:
            # we expect a error.Eof at this point, everything else is an error
            self.tokenizer.peek()
        except error.Eof:
            return stmt
        except:
            pass
        error.err_add(self.ctx.errors, self.pos, 'TRAILING_GARBAGE', ())
        return None
71839
def _parse_filter_arg(self, arg):
        
        statement = arg.rsplit('__', 1)
        if len(statement) == 1:
            return arg, None
        elif len(statement) == 2:
            return statement[0], statement[1]
        else:
            raise QueryException("Can't parse '{}'".format(arg))
131706
def max_end(self):
        
        return max(len(self.input_string), self._max_end) if self.input_string else self._max_end
1365358
def _parse_argument(cls, token):
        
        description = ""
        validator = None

        if " : " in token:
            token, description = tuple(token.split(" : ", 2))

            token = token.strip()

            description = description.strip()

        # Checking validator:
        matches = re.match(r"(.*)\((.*?)\)", token)
        if matches:
            token = matches.group(1).strip()
            validator = matches.group(2).strip()

        if token.endswith("?*"):
            return _argument(
                token.rstrip("?*"),
                Argument.MULTI_VALUED | Argument.OPTIONAL,
                description,
                None,
            )
        elif token.endswith("*"):
            return _argument(
                token.rstrip("*"),
                Argument.MULTI_VALUED | Argument.REQUIRED,
                description,
                None,
            )
        elif token.endswith("?"):
            return _argument(token.rstrip("?"), Argument.OPTIONAL, description, None)

        matches = re.match(r"(.+)=(.+)", token)
        if matches:
            return _argument(
                matches.group(1), Argument.OPTIONAL, description, matches.group(2)
            )

        return _argument(token, Argument.REQUIRED, description, None)
581442
function readQuotedField() {
    // We've already consumed the first quote by the time we get here.
    var start = index;
    var end = null;

    for (var token = nextToken(); token != EOF; token = nextToken()) {
      if (token == '"') {
        end = index - 1;
        token = nextToken();

        // Two double quotes in a row.  Keep scanning.
        if (token == '"') {
          end = null;
          continue;
        }

        // End of field.  Break out.
        if (token == delimiter || token == EOF || token == NEWLINE) {
          if (token == NEWLINE) {
            pushBack(token);
          }
          break;
        }

        if (!opt_ignoreErrors) {
          // Ignoring errors here means keep going in current field after
          // closing quote. E.g. "ab"c,d splits into abc,d
          throw new goog.labs.format.csv.ParseError(
              text, index - 1,
              'Unexpected character "' + token + '" after quote mark');
        } else {
          // Fall back to reading the rest of this field as unquoted.
          // Note: the rest is guaranteed not start with ", as that case is
          // eliminated above.
          var prefix = '"' + text.substring(start, index);
          var suffix = readField();
          if (suffix == EOR) {
            pushBack(NEWLINE);
            return prefix;
          } else {
            return prefix + suffix;
          }
        }
      }
    }

    if (goog.isNull(end)) {
      if (!opt_ignoreErrors) {
        throw new goog.labs.format.csv.ParseError(
            text, text.length - 1, 'Unexpected end of text after open quote');
      } else {
        end = text.length;
      }
    }

    // Take substring, combine double quotes.
    return text.substring(start, end).replace(/""/g, '"');
  }
1193887
final public void Literal() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case TRUE:
    case FALSE:
      Boolean();
      break;
    case FLOATING_POINT_LITERAL:
      FloatingPoint();
      break;
    case INTEGER_LITERAL:
      Integer();
      break;
    case STRING_LITERAL:
      String();
      break;
    case NULL:
      Null();
      break;
    default:
      jj_la1[50] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }
552516
def read_arg(src, c):
    
    content = [c]
    while src.hasNext():
        if src.peek() in ARG_END_TOKENS:
            content.append(next(src))
            break
        else:
            content.append(read_tex(src))
    return Arg.parse(content)