Read everything up to the next ';'.

    This is outside the formal grammar.  The InvalidParameter TokenList that is
    returned acts like a Parameter, but the data attributes are None.
351052
def get_invalid_parameter(value):
    
    invalid_parameter = InvalidParameter()
    while value and value[0] != ';':
        if value[0] in PHRASE_ENDS:
            invalid_parameter.append(ValueTerminal(value[0],
                                                   'misplaced-special'))
            value = value[1:]
        else:
            token, value = get_phrase(value)
            invalid_parameter.append(token)
    return invalid_parameter, value
395396
function(context: ParserContext): ?Token {
    if (
      !context.reader.match("<<") ||
      !/[\w'"`-]/.test(context.reader.peekWithOffset(2))
    )
      return null;

    // cannot be preceded by an a number or a string
    const walker = context.getTokenWalker();
    if (walker.hasPrev()) {
      const prevToken = walker.prev();
      if (util.contains(["number", "string"], prevToken.name)) return null;
    }

    // there are still cases where heredocs are falsely detected, because it
    // would require performingstatic analysis

    // e.g. foo <<a
    // if foo is an object that has the "<<" method defined, then it will perform a left shift
    // if foo is a function that takes a string argument, it will interpret it as a heredoc

    // so, we just force you to have whitespace between << and the rhs operand in these ambiguous cases

    // can be between quotes (double, single or back) or not, or preceded by a hyphen
    let value = context.reader.read(2);
    let ident = "";
    let current = context.reader.read();
    if (current === "-") {
      value += current;
      ident += current;
      current = context.reader.read();
    }

    let delimiter = "";
    if (util.contains(['"', "'", "`"], current)) delimiter = current;
    else ident += current;

    value += current;

    while (!context.reader.isEOF()) {
      const peek = context.reader.peek();
      if (peek === "\n" || (delimiter === "" && /\W/.test(peek))) break;
      value += context.reader.read();
      if (peek === delimiter) break;
      ident += peek;
    }

    if (Array.isArray(context.items.heredocQueue))
      context.items.heredocQueue.push(ident);
    else
      logger.errorInvalidValue(
        `context.items.heredocQueue is not an array.`,
        context.items.heredocQueue
      );

    return context.createToken("heredocDeclaration", value);
  }
226491
def parse_tokens(data)
      tokens = {}
      data.split("\n").each do |t|
        tokens.merge!({ t.split('=').first.downcase.to_sym => t.split('=').last })
      end
      return tokens
    end
428050
def read_token(fd):
    
    out = ''
    # Skip initial whitespace.

    while 1:
        ch = fd.read(1)
        if ch.isspace(): continue
        elif len(ch) == 0: return out
        else: break

    while not ch.isspace():
        out = out + ch
        ch = fd.read(1)
        if len(ch) == 0: break

    return out
25338
private void readSourceDeclaration(LineNumberReader reader) throws IOException {
        String line;
        dataSourceProperties  = new Properties();

        while (!(line = reader.readLine()).isEmpty()) {
            int lineNumber = reader.getLineNumber();
            String[] tokens = line.split("[\t| ]+", 2);

            final String parameter = tokens[0].trim();
            final String inputParameter = tokens[1].trim();

            if (parameter.equals(Label.sourceUri.name())) {
                dataSourceProperties.put(OntopSQLCoreSettings.JDBC_NAME, inputParameter);
            } else if (parameter.equals(Label.connectionUrl.name())) {
                dataSourceProperties.put(OntopSQLCoreSettings.JDBC_URL, inputParameter);
            } else if (parameter.equals(Label.username.name())) {
                dataSourceProperties.put(OntopSQLCredentialSettings.JDBC_USER, inputParameter);
            } else if (parameter.equals(Label.password.name())) {
                dataSourceProperties.put(OntopSQLCredentialSettings.JDBC_PASSWORD, inputParameter);
            } else if (parameter.equals(Label.driverClass.name())) {
                dataSourceProperties.put(OntopSQLCoreSettings.JDBC_DRIVER, inputParameter);

            } else {
                String msg = String.format("Unknown parameter name \"%s\" at line: %d.", parameter, lineNumber);
                throw new IOException(msg);
            }
        }

    }
43539
private void parseElementDecl() throws Exception {
        String name;

        requireWhitespace();
        // Read the element type name.
        name = readNmtoken(true);

        requireWhitespace();
        // Read the content model.
        parseContentspec(name);

        skipWhitespace();
        require('>');
    }
471211
void readRegExp(int startToken)
        throws IOException
    {
        int start = tokenBeg;
        stringBufferTop = 0;
        if (startToken == Token.ASSIGN_DIV) {
            // Miss-scanned /=
            addToString('=');
        } else {
            if (startToken != Token.DIV) Kit.codeBug();
        }

        boolean inCharSet = false; // true if inside a '['..']' pair
        int c;
        while ((c = getChar()) != '/' || inCharSet) {
            if (c == '\n' || c == EOF_CHAR) {
                ungetChar(c);
                tokenEnd = cursor - 1;
                this.string = new String(stringBuffer, 0, stringBufferTop);
                parser.reportError("msg.unterminated.re.lit");
                return;
            }
            if (c == '\\') {
                addToString(c);
                c = getChar();
            } else if (c == '[') {
                inCharSet = true;
            } else if (c == ']') {
                inCharSet = false;
            }
            addToString(c);
        }
        int reEnd = stringBufferTop;

        while (true) {
            if (matchChar('g'))
                addToString('g');
            else if (matchChar('i'))
                addToString('i');
            else if (matchChar('m'))
                addToString('m');
            else if (matchChar('y'))  // FireFox 3
                addToString('y');
            else
                break;
        }
        tokenEnd = start + stringBufferTop + 2;  // include slashes

        if (isAlpha(peekChar())) {
            parser.reportError("msg.invalid.re.flag");
        }

        this.string = new String(stringBuffer, 0, reEnd);
        this.regExpFlags = new String(stringBuffer, reEnd,
                                      stringBufferTop - reEnd);
    }
102382
def read_validate_params(self, request):
        
        self.client = self.client_authenticator.by_identifier_secret(request)

        self.password = request.post_param("password")
        self.username = request.post_param("username")

        self.scope_handler.parse(request=request, source="body")

        return True
1257702
function readInit(message, tokens) {
	var i;
	message.parameters = {};
	for (i = 0; i < tokens.length; i = i + 4) {
		message.parameters[protocol.decodeString(tokens[i + 1])] = protocol.decodeString(tokens[i + 3]);
	}
}
1028376
private JsonToken readLiteral() throws IOException {
        value = nextLiteral(true);
        if (valueLength == 0) {
            throw syntaxError("Expected literal value");
        }
        token = decodeLiteral();
        if (token == JsonToken.STRING) {
            checkLenient();
        }
        return token;
    }
767694
public function readToken(): Token
    {
        // List of types is reverse-sorted by frequency for typical locator.
        $typeList = [
            Token::TYPE_UNESCAPED,
            Token::TYPE_SLASH,
            Token::TYPE_ESCAPED,
        ];
        $token = $this->matchNextToken($typeList);
        if (null === $token) {
            // Checking for known syntax errors.
            $errorTypeList = [
                Token::TYPE_ERROR_INVALID_ESCAPE,
            ];
            $token = $this->matchNextToken($errorTypeList);
        }
        if (null === $token) {
            throw new UnknownSyntaxException("Unknown syntax error in source text");
        }
        return $token;
    }
1357843
function readKey ( parser ) {
  	var token;

  	if ( token = readStringLiteral( parser ) ) {
  		return identifier.test( token.v ) ? token.v : '"' + token.v.replace( /"/g, '\\"' ) + '"';
  	}

  	if ( token = readNumberLiteral$1( parser ) ) {
  		return token.v;
  	}

  	if ( token = parser.matchPattern( namePattern ) ) {
  		return token;
  	}

  	return null;
  }
1329160
def tokenlist(item, sep, suppress=True):
    """"""
    if suppress:
        sep = sep.suppress()
    return item + ZeroOrMore(sep + item) + Optional(sep)
717116
function readParameters(obj, scope) {
    var result = {},
      attrs = obj.$attr,
      option, value;

    for (var key in attrs) {
      option = lcfirst(key.substr(attrName.length));
      value = obj[key];
      // Check if the given key is a valid string type, not empty and starts with the attribute name
      if ((option.length > 0) && (key.substring(0, attrName.length) === attrName)) {
        result[option] = value;
        if (typeof scope[value] === 'function') {
          result[option] = scope[value];
        }
      }
    }

    return result;
  }
221779
def read_name(self, start: int, line: int, col: int, prev: Token) -> Token:
        """"""
        body = self.source.body
        body_length = len(body)
        position = start + 1
        while position < body_length:
            char = body[position]
            if not (
                char == "_"
                or "0" <= char <= "9"
                or "A" <= char <= "Z"
                or "a" <= char <= "z"
            ):
                break
            position += 1
        return Token(
            TokenKind.NAME, start, position, line, col, prev, body[start:position]
        )
254061
function parseArgumentList() {
                    var token, expr, args = [];

                    while (true) {
                        expr = parseExpression();
                        if (typeof expr === 'undefined') {
                            break;
                        }
                        args.push(expr);
                        token = lexer.peek();
                        if (!matchOp(token, ',')) {
                            break;
                        }
                        lexer.next();
                    }

                    return args;
                }
818456
private void checkForUnknownVariables(TokenList tokens) {
        TokenList.Token t = tokens.getFirst();
        while( t != null ) {
            if( t.getType() == Type.WORD )
                throw new ParseError("Unknown variable on right side. "+t.getWord());
            t = t.next;
        }
    }