Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2009 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2010 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 21-26
Link Here
|
21 |
* n means completion behind the n-th character |
21 |
* n means completion behind the n-th character |
22 |
*/ |
22 |
*/ |
23 |
import org.eclipse.jdt.core.compiler.*; |
23 |
import org.eclipse.jdt.core.compiler.*; |
|
|
24 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; |
24 |
import org.eclipse.jdt.internal.compiler.parser.Scanner; |
25 |
import org.eclipse.jdt.internal.compiler.parser.Scanner; |
25 |
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper; |
26 |
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper; |
26 |
|
27 |
|
Lines 791-797
Link Here
|
791 |
throw new InvalidInputException("Ctrl-Z"); //$NON-NLS-1$ |
792 |
throw new InvalidInputException("Ctrl-Z"); //$NON-NLS-1$ |
792 |
|
793 |
|
793 |
default : |
794 |
default : |
794 |
if (ScannerHelper.isJavaIdentifierStart(this.currentCharacter)) |
795 |
char c = this.currentCharacter; |
|
|
796 |
if (c < ScannerHelper.MAX_OBVIOUS) { |
797 |
if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[c] & ScannerHelper.C_IDENT_START) != 0) { |
798 |
return scanIdentifierOrKeyword(); |
799 |
} else if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[c] & ScannerHelper.C_DIGIT) != 0) { |
800 |
return scanNumber(false); |
801 |
} else { |
802 |
return TokenNameERROR; |
803 |
} |
804 |
} |
805 |
boolean isJavaIdStart; |
806 |
if (c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE) { |
807 |
if (this.complianceLevel < ClassFileConstants.JDK1_5) { |
808 |
throw new InvalidInputException(INVALID_UNICODE_ESCAPE); |
809 |
} |
810 |
// Unicode 4 detection |
811 |
char low = (char) getNextChar(); |
812 |
if (low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE) { |
813 |
// illegal low surrogate |
814 |
throw new InvalidInputException(INVALID_LOW_SURROGATE); |
815 |
} |
816 |
isJavaIdStart = ScannerHelper.isJavaIdentifierStart(c, low); |
817 |
} |
818 |
else if (c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE) { |
819 |
if (this.complianceLevel < ClassFileConstants.JDK1_5) { |
820 |
throw new InvalidInputException(INVALID_UNICODE_ESCAPE); |
821 |
} |
822 |
throw new InvalidInputException(INVALID_HIGH_SURROGATE); |
823 |
} else { |
824 |
// optimized case already checked |
825 |
isJavaIdStart = Character.isJavaIdentifierStart(c); |
826 |
} |
827 |
if (isJavaIdStart) |
795 |
return scanIdentifierOrKeyword(); |
828 |
return scanIdentifierOrKeyword(); |
796 |
if (ScannerHelper.isDigit(this.currentCharacter)) { |
829 |
if (ScannerHelper.isDigit(this.currentCharacter)) { |
797 |
return scanNumber(false); |
830 |
return scanNumber(false); |