src/share/classes/com/sun/tools/javac/parser/Scanner.java

changeset 674
584365f256a7
parent 597
d2b7ecf33b35
child 695
3c9b64e55c5d
equal deleted inserted replaced
673:7ae4016c5938 674:584365f256a7
106 106
107 /** Allow underscores in literals. 107 /** Allow underscores in literals.
108 */ 108 */
109 private boolean allowUnderscoresInLiterals; 109 private boolean allowUnderscoresInLiterals;
110 110
111 /** Allow exotic identifiers.
112 */
113 private boolean allowExoticIdentifiers;
114
111 /** The source language setting. 115 /** The source language setting.
112 */ 116 */
113 private Source source; 117 private Source source;
114 118
115 /** The token's position, 0-based offset from beginning of text. 119 /** The token's position, 0-based offset from beginning of text.
179 keywords = fac.keywords; 183 keywords = fac.keywords;
180 source = fac.source; 184 source = fac.source;
181 allowBinaryLiterals = source.allowBinaryLiterals(); 185 allowBinaryLiterals = source.allowBinaryLiterals();
182 allowHexFloats = source.allowHexFloats(); 186 allowHexFloats = source.allowHexFloats();
183 allowUnderscoresInLiterals = source.allowBinaryLiterals(); 187 allowUnderscoresInLiterals = source.allowBinaryLiterals();
188 allowExoticIdentifiers = source.allowExoticIdentifiers(); // for invokedynamic
184 } 189 }
185 190
186 private static final boolean hexFloatsWork = hexFloatsWork(); 191 private static final boolean hexFloatsWork = hexFloatsWork();
187 private static boolean hexFloatsWork() { 192 private static boolean hexFloatsWork() {
188 try { 193 try {
1008 } 1013 }
1009 return; 1014 return;
1010 case '#': 1015 case '#':
1011 scanChar(); 1016 scanChar();
1012 if (ch == '\"') { 1017 if (ch == '\"') {
1018 if (!allowExoticIdentifiers) {
1019 lexError("unsupported.exotic.id", source.name);
1020 allowExoticIdentifiers = true;
1021 }
1013 scanChar(); 1022 scanChar();
1014 if (ch == '\"') 1023 if (ch == '\"')
1015 lexError(pos, "empty.bytecode.ident"); 1024 lexError(pos, "empty.bytecode.ident");
1016 while (ch != '\"' && ch != CR && ch != LF && bp < buflen) { 1025 while (ch != '\"' && ch != CR && ch != LF && bp < buflen) {
1017 scanBytecodeNameChar(); 1026 scanBytecodeNameChar();

mercurial