@@ -122,14 +122,14 @@ def ch_prefix(ix):
122122
123123def emit_bsearch_range_table (f ):
124124 f .write ("""
125- pure fn bsearch_range_table(c: char, r: &[(char,char)]) -> bool {
126- use cmp::{EQ, LT, GT };
127- use vec::bsearch ;
125+ fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool {
126+ use cmp::{Equal, Less, Greater };
127+ use vec::ImmutableVector ;
128128 use option::None;
129- (do bsearch(r) |&(lo,hi)| {
130- if lo <= c && c <= hi { EQ }
131- else if hi < c { LT }
132- else { GT }
129+ (do r.bsearch |&(lo,hi)| {
130+ if lo <= c && c <= hi { Equal }
131+ else if hi < c { Less }
132+ else { Greater }
133133 }) != None
134134 }\n \n
135135""" );
@@ -140,15 +140,15 @@ def emit_property_module(f, mod, tbl):
140140 keys .sort ()
141141 emit_bsearch_range_table (f );
142142 for cat in keys :
143- f .write (" const %s_table : &[(char,char)] = &[\n " % cat )
143+ f .write (" static %s_table : &'static [(char,char)] = &[\n " % cat )
144144 ix = 0
145145 for pair in tbl [cat ]:
146146 f .write (ch_prefix (ix ))
147147 f .write ("(%s, %s)" % (escape_char (pair [0 ]), escape_char (pair [1 ])))
148148 ix += 1
149149 f .write ("\n ];\n \n " )
150150
151- f .write (" pub pure fn %s(c: char) -> bool {\n " % cat )
151+ f .write (" pub fn %s(c: char) -> bool {\n " % cat )
152152 f .write (" bsearch_range_table(c, %s_table)\n " % cat )
153153 f .write (" }\n \n " )
154154 f .write ("}\n " )
@@ -159,7 +159,7 @@ def emit_property_module_old(f, mod, tbl):
159159 keys = tbl .keys ()
160160 keys .sort ()
161161 for cat in keys :
162- f .write (" pure fn %s(c: char) -> bool {\n " % cat )
162+ f .write (" fn %s(c: char) -> bool {\n " % cat )
163163 f .write (" ret alt c {\n " )
164164 prefix = ' '
165165 for pair in tbl [cat ]:
@@ -236,8 +236,22 @@ def emit_decomp_module(f, canon, compat):
236236
237237(canon_decomp , compat_decomp , gencats ) = load_unicode_data ("UnicodeData.txt" )
238238
239- # Explain that the source code was generated by this script.
240- rf .write ('// The following code was generated by "src/etc/unicode.py"\n \n ' )
239+ # Preamble
240+ rf .write ('''// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
241+ // file at the top-level directory of this distribution and at
242+ // http://rust-lang.org/COPYRIGHT.
243+ //
244+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
245+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
246+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
247+ // option. This file may not be copied, modified, or distributed
248+ // except according to those terms.
249+
250+ // The following code was generated by "src/etc/unicode.py"
251+
252+ #[allow(missing_doc)];
253+
254+ ''' )
241255
242256emit_property_module (rf , "general_category" , gencats )
243257
0 commit comments