Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1047)

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/scanner/AbstractScanner.java

Issue 17601008: Report ILLEGAL_CHARACTER for not 'a'-'z' and 'A'-'Z' letters in identifiers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't allow invalid letters in the middle of identifiers. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/scanner/AbstractScannerTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/scanner/AbstractScanner.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/scanner/AbstractScanner.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/scanner/AbstractScanner.java
index cb7911d0f5442a6435f858bafb70a936ce4109c6..bafa9e41df61ea9f54b5808c55996408b7f60fee 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/scanner/AbstractScanner.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/scanner/AbstractScanner.java
@@ -484,10 +484,6 @@ public abstract class AbstractScanner {
return -1;
}
- if (Character.isLetter(next)) {
- return tokenizeIdentifier(next, getOffset(), true);
- }
-
// The following are non-ASCII characters.
if (next == $NBSP) {
@@ -743,8 +739,7 @@ public abstract class AbstractScanner {
private int tokenizeIdentifier(int next, int start, boolean allowDollar) {
while (('a' <= next && next <= 'z') || ('A' <= next && next <= 'Z')
- || ('0' <= next && next <= '9') || next == '_' || (next == '$' && allowDollar)
- || Character.isLetterOrDigit(next)) {
+ || ('0' <= next && next <= '9') || next == '_' || (next == '$' && allowDollar)) {
next = advance();
}
appendStringToken(TokenType.IDENTIFIER, getString(start, next < 0 ? 0 : -1));
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/scanner/AbstractScannerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698