diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2011-12-13 16:25:51 -0800 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-12-13 16:34:50 -0800 |
| commit | fa9ad984fb2f013baebdbe01a42baa3b9101dd84 (patch) | |
| tree | 49115690e45ca322337b93f25308cd618f85b013 /src/comp/syntax/parse | |
| parent | 32087f5c2a35bf8050067c22a57fd60269633a60 (diff) | |
| download | rust-fa9ad984fb2f013baebdbe01a42baa3b9101dd84.tar.gz rust-fa9ad984fb2f013baebdbe01a42baa3b9101dd84.zip | |
Copy first batch of material from libstd to libcore.
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/eval.rs | 5 | ||||
| -rw-r--r-- | src/comp/syntax/parse/lexer.rs | 11 | ||||
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 7 | ||||
| -rw-r--r-- | src/comp/syntax/parse/token.rs | 2 |
4 files changed, 14 insertions, 11 deletions
diff --git a/src/comp/syntax/parse/eval.rs b/src/comp/syntax/parse/eval.rs index bc8a51e1f34..2b0fcab9b8e 100644 --- a/src/comp/syntax/parse/eval.rs +++ b/src/comp/syntax/parse/eval.rs @@ -1,7 +1,8 @@ import front::attr; -import std::{option, result, io, fs}; -import std::option::{some, none}; +import core::{option, result}; +import std::{io, fs}; +import option::{some, none}; import syntax::ast; import syntax::parse::token; import syntax::parse::parser::{parser, new_parser_from_file, diff --git a/src/comp/syntax/parse/lexer.rs b/src/comp/syntax/parse/lexer.rs index bd841b94051..299a7ecafeb 100644 --- a/src/comp/syntax/parse/lexer.rs +++ b/src/comp/syntax/parse/lexer.rs @@ -1,6 +1,7 @@ -import std::{io, vec, str, option, either}; -import std::option::{some, none}; +import core::{vec, str, option, either}; +import std::io; +import option::{some, none}; import util::interner; import util::interner::intern; import codemap; @@ -180,7 +181,7 @@ fn scan_digits(rdr: reader, radix: uint) -> str { while true { let c = rdr.curr(); if c == '_' { rdr.bump(); cont; } - alt std::char::maybe_digit(c) { + alt char::maybe_digit(c) { some(d) when (d as uint) < radix { str::push_byte(rslt, c as u8); rdr.bump(); @@ -232,7 +233,7 @@ fn scan_number(c: char, rdr: reader) -> token::token { tp = signed ? either::left(ast::ty_i64) : either::right(ast::ty_u64); } - let parsed = std::u64::from_str(num_str, base as u64); + let parsed = u64::from_str(num_str, base as u64); alt tp { either::left(t) { ret token::LIT_INT(parsed as i64, t); } either::right(t) { ret token::LIT_UINT(parsed, t); } @@ -276,7 +277,7 @@ fn scan_number(c: char, rdr: reader) -> token::token { ret token::LIT_FLOAT(interner::intern(*rdr.get_interner(), num_str), ast::ty_f); } else { - let parsed = std::u64::from_str(num_str, base as u64); + let parsed = u64::from_str(num_str, base as u64); ret token::LIT_INT(parsed as i64, ast::ty_i); } } diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 7b8bd726eed..7ff08181e1a 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -1,7 +1,8 @@ -import std::{io, vec, str, option, either, result, fs}; -import std::option::{some, none}; -import std::either::{left, right}; +import core::{vec, str, option, either, result}; +import std::{io, fs}; +import option::{some, none}; +import either::{left, right}; import std::map::{hashmap, new_str_hash}; import token::can_begin_expr; import codemap::span; diff --git a/src/comp/syntax/parse/token.rs b/src/comp/syntax/parse/token.rs index 6740ba74c00..5ff688ecc68 100644 --- a/src/comp/syntax/parse/token.rs +++ b/src/comp/syntax/parse/token.rs @@ -1,6 +1,6 @@ import util::interner; -import std::{int, uint, str}; +import core::{int, uint, str}; type str_num = uint; |
