Index: vm/scanner.cc |
=================================================================== |
--- vm/scanner.cc (revision 1714) |
+++ vm/scanner.cc (working copy) |
@@ -117,6 +117,19 @@ |
} |
+bool Scanner::IsIdent(const String& str) { |
+ if (!str.IsOneByteString()) { |
hausner
2011/11/21 19:53:58
Is there a guarantee that strings will always be o
siva
2011/11/21 21:48:04
No they are not guaranteed to be always the smalle
|
+ return false; |
+ } |
+ for (int i = 0; i < str.Length(); i++) { |
+ if (!IsIdentChar(str.CharAt(i))) { |
hausner
2011/11/21 19:53:58
The first character in the string must be checked
siva
2011/11/21 21:48:04
Good catch.
On 2011/11/21 19:53:58, hausner wrote
|
+ return false; |
+ } |
+ } |
+ return true; |
+} |
+ |
+ |
void Scanner::ReadChar() { |
if (lookahead_pos_ < source_length_) { |
if (c0_ == '\n') { |