about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-04-19 23:03:52 -0700
committerbors <bors@rust-lang.org>2013-04-19 23:03:52 -0700
commitce4f73a243de147c2c5b9b9822a71dafbca97a51 (patch)
treed1097cda04b3e4a4f40e673903ebd2200d98decc /src/libsyntax/parse
parente67f1c0fd229ab9f106c17f3b690dc6059eaeef0 (diff)
parent5a3d26f271a39212de90544e7394c29373dc5bab (diff)
downloadrust-ce4f73a243de147c2c5b9b9822a71dafbca97a51.tar.gz
rust-ce4f73a243de147c2c5b9b9822a71dafbca97a51.zip
auto merge of #5945 : graydon/rust/fix-unicode-tables, r=pcwalton
This switches the unicode functions in core to use static character-range tables and a binary search helper rather than open-coded switch statements. It adds about 50k of read only data to the libcore binary but cuts out a similar amount of compiled IR. Would have done it this way in the first place but we didn't have structured statics for a long time.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/lexer.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index bc930515a5d..a9edf12f7fa 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -535,7 +535,7 @@ fn ident_start(c: char) -> bool {
     (c >= 'a' && c <= 'z')
         || (c >= 'A' && c <= 'Z')
         || c == '_'
-        || (c > 'z' && char::is_XID_start(c))
+        || (c > '\x7f' && char::is_XID_start(c))
 }
 
 fn ident_continue(c: char) -> bool {
@@ -543,7 +543,7 @@ fn ident_continue(c: char) -> bool {
         || (c >= 'A' && c <= 'Z')
         || (c >= '0' && c <= '9')
         || c == '_'
-        || (c > 'z' && char::is_XID_continue(c))
+        || (c > '\x7f' && char::is_XID_continue(c))
 }
 
 // return the next token from the string