public void consumeStringLiteral() throws InvalidInputException {
try {
- boolean openDollarBrace = false;
+ int openDollarBrace = 0;
// consume next character
unicodeAsBackSlash = false;
currentCharacter = source[currentPosition++];
- while (currentCharacter != '"' || openDollarBrace) {
+ while (currentCharacter != '"' || openDollarBrace>0) {
/** ** in PHP \r and \n are valid in string literals *** */
if (currentCharacter == '\\') {
int escapeSize = currentPosition;
}
}
} else if (currentCharacter == '$' && source[currentPosition] == '{') {
- openDollarBrace = true;
+ openDollarBrace++;
} else if (currentCharacter == '{' && source[currentPosition] == '$') {
- openDollarBrace = true;
+ openDollarBrace++;
} else if (currentCharacter == '}') {
- openDollarBrace = false;
+ openDollarBrace--;
} else if ((currentCharacter == '\r') || (currentCharacter == '\n')) {
if (recordLineSeparator) {
pushLineSeparator();