1436 *
1437 * @return TRUE if is a here string.
1438 */
1439 private boolean scanHereString(final LineInfoReceiver lir) {
1440 assert ch0 == '<' && ch1 == '<';
1441 if (scripting) {
1442 // Record beginning of here string.
1443 final State saved = saveState();
1444
1445 // << or <<<
1446 final boolean excludeLastEOL = ch2 != '<';
1447
1448 if (excludeLastEOL) {
1449 skip(2);
1450 } else {
1451 skip(3);
1452 }
1453
1454 // Scan identifier. It might be quoted, indicating that no string editing should take place.
1455 final char quoteChar = ch0;
1456 final boolean noStringEditing = isStringDelimiter(quoteChar);
1457 if (noStringEditing) {
1458 skip(1);
1459 }
1460 final int identStart = position;
1461 final int identLength = scanIdentifier();
1462 if (noStringEditing) {
1463 if (ch0 != quoteChar) {
1464 error(Lexer.message("here.non.matching.delimiter"), last, position, position);
1465 restoreState(saved);
1466 return false;
1467 }
1468 skip(1);
1469 }
1470
1471 // Check for identifier.
1472 if (identLength == 0) {
1473 // Treat as shift.
1474 restoreState(saved);
1475
1476 return false;
|
1436 *
1437 * @return TRUE if is a here string.
1438 */
1439 private boolean scanHereString(final LineInfoReceiver lir) {
1440 assert ch0 == '<' && ch1 == '<';
1441 if (scripting) {
1442 // Record beginning of here string.
1443 final State saved = saveState();
1444
1445 // << or <<<
1446 final boolean excludeLastEOL = ch2 != '<';
1447
1448 if (excludeLastEOL) {
1449 skip(2);
1450 } else {
1451 skip(3);
1452 }
1453
1454 // Scan identifier. It might be quoted, indicating that no string editing should take place.
1455 final char quoteChar = ch0;
1456 final boolean noStringEditing = quoteChar == '"' || quoteChar == '\'';
1457 if (noStringEditing) {
1458 skip(1);
1459 }
1460 final int identStart = position;
1461 final int identLength = scanIdentifier();
1462 if (noStringEditing) {
1463 if (ch0 != quoteChar) {
1464 error(Lexer.message("here.non.matching.delimiter"), last, position, position);
1465 restoreState(saved);
1466 return false;
1467 }
1468 skip(1);
1469 }
1470
1471 // Check for identifier.
1472 if (identLength == 0) {
1473 // Treat as shift.
1474 restoreState(saved);
1475
1476 return false;
|