Lines 1379-1384
Link Here
|
1379 |
} |
1379 |
} |
1380 |
|
1380 |
|
1381 |
while (this.currentCharacter != '"') { |
1381 |
while (this.currentCharacter != '"') { |
|
|
1382 |
if (this.currentPosition >= this.eofPosition) { |
1383 |
throw new InvalidInputException(UNTERMINATED_STRING); |
1384 |
} |
1382 |
/**** \r and \n are not valid in string literals ****/ |
1385 |
/**** \r and \n are not valid in string literals ****/ |
1383 |
if ((this.currentCharacter == '\n') || (this.currentCharacter == '\r')) { |
1386 |
if ((this.currentCharacter == '\n') || (this.currentCharacter == '\r')) { |
1384 |
// relocate if finding another quote fairly close: thus unicode '/u000D' will be fully consumed |
1387 |
// relocate if finding another quote fairly close: thus unicode '/u000D' will be fully consumed |
Lines 1486-1491
Link Here
|
1486 |
} //jump over the \\ |
1489 |
} //jump over the \\ |
1487 |
boolean isUnicode = false; |
1490 |
boolean isUnicode = false; |
1488 |
while (this.currentCharacter != '\r' && this.currentCharacter != '\n') { |
1491 |
while (this.currentCharacter != '\r' && this.currentCharacter != '\n') { |
|
|
1492 |
if (this.currentPosition >= this.eofPosition) { |
1493 |
this.lastCommentLinePosition = this.currentPosition; |
1494 |
this.currentPosition ++; |
1495 |
// this avoids duplicating the code in the catch(IndexOutOfBoundsException e) |
1496 |
throw new IndexOutOfBoundsException(); |
1497 |
} |
1489 |
this.lastCommentLinePosition = this.currentPosition; |
1498 |
this.lastCommentLinePosition = this.currentPosition; |
1490 |
//get the next char |
1499 |
//get the next char |
1491 |
isUnicode = false; |
1500 |
isUnicode = false; |
Lines 1504-1519
Link Here
|
1504 |
* We need to completely consume the line break |
1513 |
* We need to completely consume the line break |
1505 |
*/ |
1514 |
*/ |
1506 |
if (this.currentCharacter == '\r' |
1515 |
if (this.currentCharacter == '\r' |
1507 |
&& this.eofPosition > this.currentPosition) { |
1516 |
&& this.eofPosition > this.currentPosition) { |
1508 |
if (this.source[this.currentPosition] == '\n') { |
1517 |
if (this.source[this.currentPosition] == '\n') { |
1509 |
this.currentPosition++; |
1518 |
this.currentPosition++; |
1510 |
this.currentCharacter = '\n'; |
1519 |
this.currentCharacter = '\n'; |
1511 |
} else if ((this.source[this.currentPosition] == '\\') |
1520 |
} else if ((this.source[this.currentPosition] == '\\') |
1512 |
&& (this.source[this.currentPosition + 1] == 'u')) { |
1521 |
&& (this.source[this.currentPosition + 1] == 'u')) { |
1513 |
getNextUnicodeChar(); |
1522 |
getNextUnicodeChar(); |
1514 |
isUnicode = true; |
1523 |
isUnicode = true; |
1515 |
} |
1524 |
} |
1516 |
} |
1525 |
} |
1517 |
recordComment(TokenNameCOMMENT_LINE); |
1526 |
recordComment(TokenNameCOMMENT_LINE); |
1518 |
if (this.taskTags != null) checkTaskTag(this.startPosition, this.currentPosition); |
1527 |
if (this.taskTags != null) checkTaskTag(this.startPosition, this.currentPosition); |
1519 |
if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) { |
1528 |
if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) { |
Lines 1601-1606
Link Here
|
1601 |
//loop until end of comment */ |
1610 |
//loop until end of comment */ |
1602 |
int firstTag = 0; |
1611 |
int firstTag = 0; |
1603 |
while ((this.currentCharacter != '/') || (!star)) { |
1612 |
while ((this.currentCharacter != '/') || (!star)) { |
|
|
1613 |
if (this.currentPosition >= this.eofPosition) { |
1614 |
throw new InvalidInputException(UNTERMINATED_COMMENT); |
1615 |
} |
1604 |
if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) { |
1616 |
if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) { |
1605 |
if (this.recordLineSeparator) { |
1617 |
if (this.recordLineSeparator) { |
1606 |
if (isUnicode) { |
1618 |
if (isUnicode) { |
Lines 1865-1877
Link Here
|
1865 |
getNextUnicodeChar(); |
1877 |
getNextUnicodeChar(); |
1866 |
} else { |
1878 |
} else { |
1867 |
if (this.withoutUnicodePtr != 0) { |
1879 |
if (this.withoutUnicodePtr != 0) { |
1868 |
unicodeStore(); |
1880 |
unicodeStore(); |
1869 |
} |
1881 |
} |
1870 |
} |
1882 |
} |
1871 |
} catch (InvalidInputException ex) { |
1883 |
} catch (InvalidInputException ex) { |
1872 |
// ignore |
1884 |
// ignore |
1873 |
} |
1885 |
} |
1874 |
while (this.currentCharacter != '"') { |
1886 |
while (this.currentCharacter != '"') { |
|
|
1887 |
if (this.currentPosition >= this.eofPosition) { |
1888 |
return; |
1889 |
} |
1875 |
if (this.currentCharacter == '\r'){ |
1890 |
if (this.currentCharacter == '\r'){ |
1876 |
if (this.source[this.currentPosition] == '\n') this.currentPosition++; |
1891 |
if (this.source[this.currentPosition] == '\n') this.currentPosition++; |
1877 |
break NextToken; // the string cannot go further that the line |
1892 |
break NextToken; // the string cannot go further that the line |
Lines 1935-1940
Link Here
|
1935 |
} //jump over the \\ |
1950 |
} //jump over the \\ |
1936 |
boolean isUnicode = false; |
1951 |
boolean isUnicode = false; |
1937 |
while (this.currentCharacter != '\r' && this.currentCharacter != '\n') { |
1952 |
while (this.currentCharacter != '\r' && this.currentCharacter != '\n') { |
|
|
1953 |
if (this.currentPosition >= this.eofPosition) { |
1954 |
this.lastCommentLinePosition = this.currentPosition; |
1955 |
this.currentPosition ++; |
1956 |
// this avoids duplicating the code inside the catch(IndexOutOfBoundsException e) below |
1957 |
throw new IndexOutOfBoundsException(); |
1958 |
} |
1938 |
this.lastCommentLinePosition = this.currentPosition; |
1959 |
this.lastCommentLinePosition = this.currentPosition; |
1939 |
//get the next char |
1960 |
//get the next char |
1940 |
isUnicode = false; |
1961 |
isUnicode = false; |
Lines 1953-1968
Link Here
|
1953 |
* We need to completely consume the line break |
1974 |
* We need to completely consume the line break |
1954 |
*/ |
1975 |
*/ |
1955 |
if (this.currentCharacter == '\r' |
1976 |
if (this.currentCharacter == '\r' |
1956 |
&& this.eofPosition > this.currentPosition) { |
1977 |
&& this.eofPosition > this.currentPosition) { |
1957 |
if (this.source[this.currentPosition] == '\n') { |
1978 |
if (this.source[this.currentPosition] == '\n') { |
1958 |
this.currentPosition++; |
1979 |
this.currentPosition++; |
1959 |
this.currentCharacter = '\n'; |
1980 |
this.currentCharacter = '\n'; |
1960 |
} else if ((this.source[this.currentPosition] == '\\') |
1981 |
} else if ((this.source[this.currentPosition] == '\\') |
1961 |
&& (this.source[this.currentPosition + 1] == 'u')) { |
1982 |
&& (this.source[this.currentPosition + 1] == 'u')) { |
1962 |
isUnicode = true; |
1983 |
isUnicode = true; |
1963 |
getNextUnicodeChar(); |
1984 |
getNextUnicodeChar(); |
1964 |
} |
1985 |
} |
1965 |
} |
1986 |
} |
1966 |
recordComment(TokenNameCOMMENT_LINE); |
1987 |
recordComment(TokenNameCOMMENT_LINE); |
1967 |
if (this.recordLineSeparator |
1988 |
if (this.recordLineSeparator |
1968 |
&& ((this.currentCharacter == '\r') || (this.currentCharacter == '\n'))) { |
1989 |
&& ((this.currentCharacter == '\r') || (this.currentCharacter == '\n'))) { |
Lines 2007-2013
Link Here
|
2007 |
} else { |
2028 |
} else { |
2008 |
isUnicode = false; |
2029 |
isUnicode = false; |
2009 |
if (this.withoutUnicodePtr != 0) { |
2030 |
if (this.withoutUnicodePtr != 0) { |
2010 |
unicodeStore(); |
2031 |
unicodeStore(); |
2011 |
} |
2032 |
} |
2012 |
} |
2033 |
} |
2013 |
|
2034 |
|
Lines 2045-2050
Link Here
|
2045 |
//loop until end of comment */ |
2066 |
//loop until end of comment */ |
2046 |
int firstTag = 0; |
2067 |
int firstTag = 0; |
2047 |
while ((this.currentCharacter != '/') || (!star)) { |
2068 |
while ((this.currentCharacter != '/') || (!star)) { |
|
|
2069 |
if (this.currentPosition >= this.eofPosition) { |
2070 |
return; |
2071 |
} |
2048 |
if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) { |
2072 |
if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) { |
2049 |
if (this.recordLineSeparator) { |
2073 |
if (this.recordLineSeparator) { |
2050 |
if (isUnicode) { |
2074 |
if (isUnicode) { |