diff options
| author | Kevin Cantu <me@kevincantu.org> | 2012-02-12 00:14:05 -0800 |
|---|---|---|
| committer | Kevin Cantu <me@kevincantu.org> | 2012-02-12 15:30:20 -0800 |
| commit | 2b4f5136a52041a88fbf3a03f627e9c00869f182 (patch) | |
| tree | f17de603cfa62934ec39da320262297fd865dceb /src/comp/syntax/parse | |
| parent | 944f5a65983e929f63c9867c3e635997f89cbe85 (diff) | |
| download | rust-2b4f5136a52041a88fbf3a03f627e9c00869f182.tar.gz rust-2b4f5136a52041a88fbf3a03f627e9c00869f182.zip | |
(core::str) rename byte_len -> len_bytes and rename char_len -> len
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/lexer.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/comp/syntax/parse/lexer.rs b/src/comp/syntax/parse/lexer.rs index 5a8d72ce01f..300d0a66f1d 100644 --- a/src/comp/syntax/parse/lexer.rs +++ b/src/comp/syntax/parse/lexer.rs @@ -58,7 +58,7 @@ fn new_reader(cm: codemap::codemap, itr: @interner::interner<str>) -> reader { let r = @{cm: cm, span_diagnostic: span_diagnostic, - src: filemap.src, len: str::byte_len(*filemap.src), + src: filemap.src, len: str::len_bytes(*filemap.src), mutable col: 0u, mutable pos: 0u, mutable curr: -1 as char, mutable chpos: filemap.start_pos.ch, mutable strs: [], filemap: filemap, interner: itr}; @@ -157,7 +157,7 @@ fn scan_exponent(rdr: reader) -> option<str> { rdr.bump(); } let exponent = scan_digits(rdr, 10u); - if str::byte_len(exponent) > 0u { + if str::len_bytes(exponent) > 0u { ret some(rslt + exponent); } else { rdr.fatal("scan_exponent: bad fp literal"); } } else { ret none::<str>; } @@ -220,7 +220,7 @@ fn scan_number(c: char, rdr: reader) -> token::token { tp = if signed { either::left(ast::ty_i64) } else { either::right(ast::ty_u64) }; } - if str::byte_len(num_str) == 0u { + if str::len_bytes(num_str) == 0u { rdr.fatal("no valid digits found for number"); } let parsed = u64::from_str(num_str, base as u64); @@ -267,7 +267,7 @@ fn scan_number(c: char, rdr: reader) -> token::token { ret token::LIT_FLOAT(interner::intern(*rdr.interner, num_str), ast::ty_f); } else { - if str::byte_len(num_str) == 0u { + if str::len_bytes(num_str) == 0u { rdr.fatal("no valid digits found for number"); } let parsed = u64::from_str(num_str, base as u64); @@ -604,8 +604,8 @@ fn trim_whitespace_prefix_and_push_line(&lines: [str], s: str, col: uint) unsafe { let s1; if all_whitespace(s, 0u, col) { - if col < str::byte_len(s) { - s1 = str::unsafe::slice_bytes(s, col, str::byte_len(s)); + if col < str::len_bytes(s) { + s1 = str::unsafe::slice_bytes(s, col, str::len_bytes(s)); } else { s1 = ""; } } else { s1 = s; } log(debug, "pushing line: " + s1); @@ -645,7 +645,7 @@ fn read_block_comment(rdr: reader, code_to_the_left: bool) -> cmnt { } } } - if str::byte_len(curr_line) != 0u { + if str::len_bytes(curr_line) != 0u { trim_whitespace_prefix_and_push_line(lines, curr_line, col); } let style = if code_to_the_left { trailing } else { isolated }; |
