From ed7fdfd2b4a730fbd30c3495b3853535c447053a Mon Sep 17 00:00:00 2001 From: axelcl Date: Sun, 15 May 2005 23:32:28 +0000 Subject: [PATCH] Simplified parsing for double quoted strings --- .../phpdt/core/compiler/ITerminalSymbols.java | 10 +- .../phpdt/internal/compiler/parser/Parser.java | 616 ++++++++++---------- .../phpdt/internal/compiler/parser/Scanner.java | 345 +++++------ 3 files changed, 470 insertions(+), 501 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/compiler/ITerminalSymbols.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/compiler/ITerminalSymbols.java index 8b6a74e..7b3cbcd 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/compiler/ITerminalSymbols.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/compiler/ITerminalSymbols.java @@ -1,10 +1,10 @@ /********************************************************************** Copyright (c) 2002 IBM Corp. and others. - All rights reserved.   This program and the accompanying materials + All rights reserved. � This program and the accompanying materials are made available under the terms of the Common Public License v0.5 which accompanies this distribution, and is available at http://www.eclipse.org/legal/cpl-v05.html -   + � Contributors: IBM Corporation - initial API and implementation **********************************************************************/ @@ -100,12 +100,12 @@ public interface ITerminalSymbols { final static int TokenNameobjectCAST = 179; final static int TokenNameunsetCAST = 180; - // ´ + // � final static int TokenNameEncapsedString0 = 190; // ' - final static int TokenNameEncapsedString1 = 191; +// final static int TokenNameEncapsedString1 = 191; // " - final static int TokenNameEncapsedString2 = 192; +// final static int TokenNameEncapsedString2 = 192; final static int TokenNameSTRING = 193; diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java index 8770f4a..fb1b3cc 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java @@ -789,7 +789,7 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI expr(); if (token == TokenNameSEMICOLON) { getNextToken(); - } + } if (token != TokenNameINLINE_HTML) { throwSyntaxError("Missing '?>' for open PHP expression block (''."); - } - // scanner.encapsedStringStack.pop(); - getNextToken(); - } - // else { - // // scanner.encapsedStringStack.pop(); - // int tempToken = TokenNameSTRING; - // if (!scanner.encapsedStringStack.isEmpty() - // && (token == TokenNameEncapsedString0 - // || token == TokenNameEncapsedString1 - // || token == TokenNameEncapsedString2 || token == - // TokenNameERROR)) { - // char encapsedChar = ((Character) - // scanner.encapsedStringStack.peek()) - // .charValue(); - // switch (token) { - // case TokenNameEncapsedString0 : - // if (encapsedChar == '`') { - // tempToken = TokenNameEncapsedString0; - // } - // break; - // case TokenNameEncapsedString1 : - // if (encapsedChar == '\'') { - // tempToken = TokenNameEncapsedString1; - // } - // break; - // case TokenNameEncapsedString2 : - // if (encapsedChar == '"') { - // tempToken = TokenNameEncapsedString2; - // } - // break; - // case TokenNameERROR : - // if (scanner.source[scanner.currentPosition - 1] == '\\') { - // scanner.currentPosition--; - // getNextToken(); - // } - // break; - // } - // } - // token = tempToken; - // } - break; - case TokenNameDOLLAR_LBRACE: - getNextToken(); - if (token == TokenNameDOLLAR_LBRACE) { - encaps_var(); - } else if (token == TokenNameIdentifier) { - getNextToken(); - if (token == TokenNameLBRACKET) { - getNextToken(); - // if (token == TokenNameRBRACKET) { - // getNextToken(); - // } else { - expr(); - if (token != TokenNameRBRACKET) { - throwSyntaxError("']' expected after '${'."); - } - getNextToken(); - // } - } - } else { - expr(); - } - if (token != TokenNameRBRACE) { - throwSyntaxError("'}' expected."); - } - getNextToken(); - break; - case TokenNameLBRACE_DOLLAR: - getNextToken(); - if (token == TokenNameLBRACE_DOLLAR) { - encaps_var(); - } else if (token == TokenNameIdentifier || token > TokenNameKEYWORD) { - getNextToken(); - if (token == TokenNameLBRACKET) { - getNextToken(); - // if (token == TokenNameRBRACKET) { - // getNextToken(); - // } else { - expr(); - if (token != TokenNameRBRACKET) { - throwSyntaxError("']' expected."); - } - getNextToken(); - // } - } else if (token == TokenNameMINUS_GREATER) { - getNextToken(); - if (token != TokenNameIdentifier && token != TokenNameVariable) { - throwSyntaxError("String or Variable token expected."); - } - getNextToken(); - if (token == TokenNameLBRACKET) { - getNextToken(); - // if (token == TokenNameRBRACKET) { - // getNextToken(); - // } else { - expr(); - if (token != TokenNameRBRACKET) { - throwSyntaxError("']' expected after '${'."); - } - getNextToken(); - // } - } - } - // if (token != TokenNameRBRACE) { - // throwSyntaxError("'}' expected after '{$'."); - // } - // // scanner.encapsedStringStack.pop(); - // getNextToken(); - } else { - expr(); - if (token != TokenNameRBRACE) { - throwSyntaxError("'}' expected."); - } - // scanner.encapsedStringStack.pop(); - getNextToken(); - } - break; - } - } + // private void encaps_var() { + // // T_VARIABLE + // // | T_VARIABLE '[' encaps_var_offset ']' + // // | T_VARIABLE T_OBJECT_OPERATOR T_STRING + // // | T_DOLLAR_OPEN_CURLY_BRACES expr '}' + // // | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' + // // | T_CURLY_OPEN variable '}' + // switch (token) { + // case TokenNameVariable: + // getNextToken(); + // if (token == TokenNameLBRACKET) { + // getNextToken(); + // expr(); //encaps_var_offset(); + // if (token != TokenNameRBRACKET) { + // throwSyntaxError("']' expected after variable."); + // } + // // scanner.encapsedStringStack.pop(); + // getNextToken(); + // // } + // } else if (token == TokenNameMINUS_GREATER) { + // getNextToken(); + // if (token != TokenNameIdentifier) { + // throwSyntaxError("Identifier expected after '->'."); + // } + // // scanner.encapsedStringStack.pop(); + // getNextToken(); + // } + // // else { + // // // scanner.encapsedStringStack.pop(); + // // int tempToken = TokenNameSTRING; + // // if (!scanner.encapsedStringStack.isEmpty() + // // && (token == TokenNameEncapsedString0 + // // || token == TokenNameEncapsedString1 + // // || token == TokenNameEncapsedString2 || token == + // // TokenNameERROR)) { + // // char encapsedChar = ((Character) + // // scanner.encapsedStringStack.peek()) + // // .charValue(); + // // switch (token) { + // // case TokenNameEncapsedString0 : + // // if (encapsedChar == '`') { + // // tempToken = TokenNameEncapsedString0; + // // } + // // break; + // // case TokenNameEncapsedString1 : + // // if (encapsedChar == '\'') { + // // tempToken = TokenNameEncapsedString1; + // // } + // // break; + // // case TokenNameEncapsedString2 : + // // if (encapsedChar == '"') { + // // tempToken = TokenNameEncapsedString2; + // // } + // // break; + // // case TokenNameERROR : + // // if (scanner.source[scanner.currentPosition - 1] == '\\') { + // // scanner.currentPosition--; + // // getNextToken(); + // // } + // // break; + // // } + // // } + // // token = tempToken; + // // } + // break; + // case TokenNameDOLLAR_LBRACE: + // getNextToken(); + // if (token == TokenNameDOLLAR_LBRACE) { + // encaps_var(); + // } else if (token == TokenNameIdentifier) { + // getNextToken(); + // if (token == TokenNameLBRACKET) { + // getNextToken(); + // // if (token == TokenNameRBRACKET) { + // // getNextToken(); + // // } else { + // expr(); + // if (token != TokenNameRBRACKET) { + // throwSyntaxError("']' expected after '${'."); + // } + // getNextToken(); + // // } + // } + // } else { + // expr(); + // } + // if (token != TokenNameRBRACE) { + // throwSyntaxError("'}' expected."); + // } + // getNextToken(); + // break; + // case TokenNameLBRACE_DOLLAR: + // getNextToken(); + // if (token == TokenNameLBRACE_DOLLAR) { + // encaps_var(); + // } else if (token == TokenNameIdentifier || token > TokenNameKEYWORD) { + // getNextToken(); + // if (token == TokenNameLBRACKET) { + // getNextToken(); + // // if (token == TokenNameRBRACKET) { + // // getNextToken(); + // // } else { + // expr(); + // if (token != TokenNameRBRACKET) { + // throwSyntaxError("']' expected."); + // } + // getNextToken(); + // // } + // } else if (token == TokenNameMINUS_GREATER) { + // getNextToken(); + // if (token != TokenNameIdentifier && token != TokenNameVariable) { + // throwSyntaxError("String or Variable token expected."); + // } + // getNextToken(); + // if (token == TokenNameLBRACKET) { + // getNextToken(); + // // if (token == TokenNameRBRACKET) { + // // getNextToken(); + // // } else { + // expr(); + // if (token != TokenNameRBRACKET) { + // throwSyntaxError("']' expected after '${'."); + // } + // getNextToken(); + // // } + // } + // } + // // if (token != TokenNameRBRACE) { + // // throwSyntaxError("'}' expected after '{$'."); + // // } + // // // scanner.encapsedStringStack.pop(); + // // getNextToken(); + // } else { + // expr(); + // if (token != TokenNameRBRACE) { + // throwSyntaxError("'}' expected."); + // } + // // scanner.encapsedStringStack.pop(); + // getNextToken(); + // } + // break; + // } + // } private void encaps_var_offset() { // T_STRING @@ -3902,33 +3902,39 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI throwSyntaxError("'`' expected at end of static string."); } break; - case TokenNameEncapsedString1: - try { - scanner.currentCharacter = scanner.source[scanner.currentPosition++]; - while (scanner.currentCharacter != '\'') { - if (scanner.currentCharacter == '\\') { - scanner.currentPosition++; - } - scanner.currentCharacter = scanner.source[scanner.currentPosition++]; - } - getNextToken(); - } catch (IndexOutOfBoundsException e) { - throwSyntaxError("'\'' expected at end of static string."); - } + // case TokenNameEncapsedString1: + // try { + // scanner.currentCharacter = scanner.source[scanner.currentPosition++]; + // while (scanner.currentCharacter != '\'') { + // if (scanner.currentCharacter == '\\') { + // scanner.currentPosition++; + // } + // scanner.currentCharacter = scanner.source[scanner.currentPosition++]; + // } + // getNextToken(); + // } catch (IndexOutOfBoundsException e) { + // throwSyntaxError("'\'' expected at end of static string."); + // } + // break; + // case TokenNameEncapsedString2: + // try { + // scanner.currentCharacter = scanner.source[scanner.currentPosition++]; + // while (scanner.currentCharacter != '"') { + // if (scanner.currentCharacter == '\\') { + // scanner.currentPosition++; + // } + // scanner.currentCharacter = scanner.source[scanner.currentPosition++]; + // } + // getNextToken(); + // } catch (IndexOutOfBoundsException e) { + // throwSyntaxError("'\"' expected at end of static string."); + // } + // break; + case TokenNameStringSingleQuote: + getNextToken(); break; - case TokenNameEncapsedString2: - try { - scanner.currentCharacter = scanner.source[scanner.currentPosition++]; - while (scanner.currentCharacter != '"') { - if (scanner.currentCharacter == '\\') { - scanner.currentPosition++; - } - scanner.currentCharacter = scanner.source[scanner.currentPosition++]; - } - getNextToken(); - } catch (IndexOutOfBoundsException e) { - throwSyntaxError("'\"' expected at end of static string."); - } + case TokenNameStringDoubleQuote: + getNextToken(); break; case TokenNamePLUS: getNextToken(); diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java index 2965347..751e8c0 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java @@ -38,10 +38,10 @@ public class Scanner implements IScanner, ITerminalSymbols { public boolean ignorePHPOneLiner = false; public boolean phpMode = false; - + public boolean phpExpressionTag = false; - - public Stack encapsedStringStack = null; + +// public Stack encapsedStringStack = null; public char currentCharacter; @@ -1103,36 +1103,12 @@ public class Scanner implements IScanner, ITerminalSymbols { public void consumeStringLiteral() throws InvalidInputException { try { + boolean openDollarBrace = false; // consume next character unicodeAsBackSlash = false; currentCharacter = source[currentPosition++]; - // if (((currentCharacter = source[currentPosition++]) == '\\') - // && (source[currentPosition] == 'u')) { - // getNextUnicodeChar(); - // } else { - // if (withoutUnicodePtr != 0) { - // withoutUnicodeBuffer[++withoutUnicodePtr] = - // currentCharacter; - // } - // } - while (currentCharacter != '"') { + while (currentCharacter != '"' || openDollarBrace) { /** ** in PHP \r and \n are valid in string literals *** */ - // if ((currentCharacter == '\n') - // || (currentCharacter == '\r')) { - // // relocate if finding another quote fairly close: thus unicode - // '/u000D' will be fully consumed - // for (int lookAhead = 0; lookAhead < 50; lookAhead++) { - // if (currentPosition + lookAhead == source.length) - // break; - // if (source[currentPosition + lookAhead] == '\n') - // break; - // if (source[currentPosition + lookAhead] == '\"') { - // currentPosition += lookAhead + 1; - // break; - // } - // } - // throw new InvalidInputException(INVALID_CHAR_IN_STRING); - // } if (currentCharacter == '\\') { int escapeSize = currentPosition; boolean backSlashAsUnicodeInString = unicodeAsBackSlash; @@ -1152,6 +1128,12 @@ public class Scanner implements IScanner, ITerminalSymbols { withoutUnicodePtr--; } } + } else if (currentCharacter == '$' && source[currentPosition] == '{') { + openDollarBrace = true; + } else if (currentCharacter == '{' && source[currentPosition] == '$') { + openDollarBrace = true; + } else if (currentCharacter == '}') { + openDollarBrace = false; } else if ((currentCharacter == '\r') || (currentCharacter == '\n')) { if (recordLineSeparator) { pushLineSeparator(); @@ -1160,14 +1142,9 @@ public class Scanner implements IScanner, ITerminalSymbols { // consume next character unicodeAsBackSlash = false; currentCharacter = source[currentPosition++]; - // if (((currentCharacter = source[currentPosition++]) == '\\') - // && (source[currentPosition] == 'u')) { - // getNextUnicodeChar(); - // } else { if (withoutUnicodePtr != 0) { withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter; } - // } } } catch (IndexOutOfBoundsException e) { // reset end position for error reporting @@ -1218,139 +1195,139 @@ public class Scanner implements IScanner, ITerminalSymbols { withoutUnicodePtr = 0; //start with a new token char encapsedChar = ' '; - if (!encapsedStringStack.isEmpty()) { - encapsedChar = ((Character) encapsedStringStack.peek()).charValue(); - } - if (encapsedChar != '$' && encapsedChar != ' ') { - currentCharacter = source[currentPosition++]; - if (currentCharacter == encapsedChar) { - switch (currentCharacter) { - case '`': - return TokenNameEncapsedString0; - case '\'': - return TokenNameEncapsedString1; - case '"': - return TokenNameEncapsedString2; - } - } - while (currentCharacter != encapsedChar) { - /** ** in PHP \r and \n are valid in string literals *** */ - switch (currentCharacter) { - case '\\': - int escapeSize = currentPosition; - boolean backSlashAsUnicodeInString = unicodeAsBackSlash; - //scanEscapeCharacter make a side effect on this value and - // we need the previous value few lines down this one - scanDoubleQuotedEscapeCharacter(); - escapeSize = currentPosition - escapeSize; - if (withoutUnicodePtr == 0) { - //buffer all the entries that have been left aside.... - withoutUnicodePtr = currentPosition - escapeSize - 1 - startPosition; - System.arraycopy(source, startPosition, withoutUnicodeBuffer, 1, withoutUnicodePtr); - withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter; - } else { //overwrite the / in the buffer - withoutUnicodeBuffer[withoutUnicodePtr] = currentCharacter; - if (backSlashAsUnicodeInString) { //there are TWO \ in - withoutUnicodePtr--; - } - } - break; - case '\r': - case '\n': - if (recordLineSeparator) { - pushLineSeparator(); - } - break; - case '$': - if (isPHPIdentifierStart(source[currentPosition]) || source[currentPosition] == '{') { - currentPosition--; - encapsedStringStack.push(new Character('$')); - return TokenNameSTRING; - } - break; - case '{': - if (source[currentPosition] == '$') { // CURLY_OPEN - currentPosition--; - encapsedStringStack.push(new Character('$')); - return TokenNameSTRING; - } - } - // consume next character - unicodeAsBackSlash = false; - currentCharacter = source[currentPosition++]; - if (withoutUnicodePtr != 0) { - withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter; - } - // } - } // end while - currentPosition--; - return TokenNameSTRING; - } + // if (!encapsedStringStack.isEmpty()) { + // encapsedChar = ((Character) encapsedStringStack.peek()).charValue(); + // } + // if (encapsedChar != '$' && encapsedChar != ' ') { + // currentCharacter = source[currentPosition++]; + // if (currentCharacter == encapsedChar) { + // switch (currentCharacter) { + // case '`': + // return TokenNameEncapsedString0; + // case '\'': + // return TokenNameEncapsedString1; + // case '"': + // return TokenNameEncapsedString2; + // } + // } + // while (currentCharacter != encapsedChar) { + // /** ** in PHP \r and \n are valid in string literals *** */ + // switch (currentCharacter) { + // case '\\': + // int escapeSize = currentPosition; + // boolean backSlashAsUnicodeInString = unicodeAsBackSlash; + // //scanEscapeCharacter make a side effect on this value and + // // we need the previous value few lines down this one + // scanDoubleQuotedEscapeCharacter(); + // escapeSize = currentPosition - escapeSize; + // if (withoutUnicodePtr == 0) { + // //buffer all the entries that have been left aside.... + // withoutUnicodePtr = currentPosition - escapeSize - 1 - startPosition; + // System.arraycopy(source, startPosition, withoutUnicodeBuffer, 1, withoutUnicodePtr); + // withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter; + // } else { //overwrite the / in the buffer + // withoutUnicodeBuffer[withoutUnicodePtr] = currentCharacter; + // if (backSlashAsUnicodeInString) { //there are TWO \ in + // withoutUnicodePtr--; + // } + // } + // break; + // case '\r': + // case '\n': + // if (recordLineSeparator) { + // pushLineSeparator(); + // } + // break; + // case '$': + // if (isPHPIdentifierStart(source[currentPosition]) || source[currentPosition] == '{') { + // currentPosition--; + // encapsedStringStack.push(new Character('$')); + // return TokenNameSTRING; + // } + // break; + // case '{': + // if (source[currentPosition] == '$') { // CURLY_OPEN + // currentPosition--; + // encapsedStringStack.push(new Character('$')); + // return TokenNameSTRING; + // } + // } + // // consume next character + // unicodeAsBackSlash = false; + // currentCharacter = source[currentPosition++]; + // if (withoutUnicodePtr != 0) { + // withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter; + // } + // // } + // } // end while + // currentPosition--; + // return TokenNameSTRING; + // } // ---------Consume white space and handles startPosition--------- int whiteStart = currentPosition; startPosition = currentPosition; currentCharacter = source[currentPosition++]; - if (encapsedChar == '$') { - switch (currentCharacter) { - case '\\': - currentCharacter = source[currentPosition++]; - return TokenNameSTRING; - case '{': - if (encapsedChar == '$') { - if (getNextChar('$')) - return TokenNameLBRACE_DOLLAR; - } - return TokenNameLBRACE; - case '}': - return TokenNameRBRACE; - case '[': - return TokenNameLBRACKET; - case ']': - return TokenNameRBRACKET; - case '\'': - if (tokenizeStrings) { - consumeStringConstant(); - return TokenNameStringSingleQuote; - } - return TokenNameEncapsedString1; - case '"': - return TokenNameEncapsedString2; - case '`': - if (tokenizeStrings) { - consumeStringInterpolated(); - return TokenNameStringInterpolated; - } - return TokenNameEncapsedString0; - case '-': - if (getNextChar('>')) - return TokenNameMINUS_GREATER; - return TokenNameSTRING; - default: - if (currentCharacter == '$') { - int oldPosition = currentPosition; - try { - currentCharacter = source[currentPosition++]; - if (currentCharacter == '{') { - return TokenNameDOLLAR_LBRACE; - } - if (isPHPIdentifierStart(currentCharacter)) { - return scanIdentifierOrKeyword(true); - } else { - currentPosition = oldPosition; - return TokenNameSTRING; - } - } catch (IndexOutOfBoundsException e) { - currentPosition = oldPosition; - return TokenNameSTRING; - } - } - if (isPHPIdentifierStart(currentCharacter)) - return scanIdentifierOrKeyword(false); - if (Character.isDigit(currentCharacter)) - return scanNumber(false); - return TokenNameERROR; - } - } + // if (encapsedChar == '$') { + // switch (currentCharacter) { + // case '\\': + // currentCharacter = source[currentPosition++]; + // return TokenNameSTRING; + // case '{': + // if (encapsedChar == '$') { + // if (getNextChar('$')) + // return TokenNameLBRACE_DOLLAR; + // } + // return TokenNameLBRACE; + // case '}': + // return TokenNameRBRACE; + // case '[': + // return TokenNameLBRACKET; + // case ']': + // return TokenNameRBRACKET; + // case '\'': + // if (tokenizeStrings) { + // consumeStringConstant(); + // return TokenNameStringSingleQuote; + // } + // return TokenNameEncapsedString1; + // case '"': + // return TokenNameEncapsedString2; + // case '`': + // if (tokenizeStrings) { + // consumeStringInterpolated(); + // return TokenNameStringInterpolated; + // } + // return TokenNameEncapsedString0; + // case '-': + // if (getNextChar('>')) + // return TokenNameMINUS_GREATER; + // return TokenNameSTRING; + // default: + // if (currentCharacter == '$') { + // int oldPosition = currentPosition; + // try { + // currentCharacter = source[currentPosition++]; + // if (currentCharacter == '{') { + // return TokenNameDOLLAR_LBRACE; + // } + // if (isPHPIdentifierStart(currentCharacter)) { + // return scanIdentifierOrKeyword(true); + // } else { + // currentPosition = oldPosition; + // return TokenNameSTRING; + // } + // } catch (IndexOutOfBoundsException e) { + // currentPosition = oldPosition; + // return TokenNameSTRING; + // } + // } + // if (isPHPIdentifierStart(currentCharacter)) + // return scanIdentifierOrKeyword(false); + // if (Character.isDigit(currentCharacter)) + // return scanNumber(false); + // return TokenNameERROR; + // } + // } // boolean isWhiteSpace; while ((currentCharacter == ' ') || Character.isWhitespace(currentCharacter)) { @@ -1569,17 +1546,17 @@ public class Scanner implements IScanner, ITerminalSymbols { consumeStringConstant(); return TokenNameStringSingleQuote; case '"': - if (tokenizeStrings) { +// if (tokenizeStrings) { consumeStringLiteral(); return TokenNameStringDoubleQuote; - } - return TokenNameEncapsedString2; +// } +// return TokenNameEncapsedString2; case '`': - if (tokenizeStrings) { +// if (tokenizeStrings) { consumeStringInterpolated(); return TokenNameStringInterpolated; - } - return TokenNameEncapsedString0; +// } +// return TokenNameEncapsedString0; case '#': case '/': { char startChar = currentCharacter; @@ -1875,7 +1852,7 @@ public class Scanner implements IScanner, ITerminalSymbols { if (currentCharacter != '=') { //