2011-12-20 14:29:59 -06:00
|
|
|
// Top-level, visible-everywhere definitions.
|
|
|
|
|
2012-03-02 19:20:00 -06:00
|
|
|
// Export various ubiquitous types, constructors, methods.
|
2011-12-20 14:29:59 -06:00
|
|
|
|
2012-09-21 20:10:45 -05:00
|
|
|
#[legacy_exports];
|
|
|
|
|
2012-09-04 13:12:17 -05:00
|
|
|
use option::{Some, None};
|
|
|
|
use Option = option::Option;
|
|
|
|
use result::{Result, Ok, Err};
|
2012-08-28 16:49:22 -05:00
|
|
|
|
2012-09-04 13:12:17 -05:00
|
|
|
use Path = path::Path;
|
|
|
|
use GenericPath = path::GenericPath;
|
|
|
|
use WindowsPath = path::WindowsPath;
|
|
|
|
use PosixPath = path::PosixPath;
|
2012-08-24 17:28:43 -05:00
|
|
|
|
2012-09-04 13:12:17 -05:00
|
|
|
use tuple::{TupleOps, ExtendedTupleOps};
|
|
|
|
use str::{StrSlice, UniqueStr};
|
|
|
|
use vec::{ConstVector, CopyableVector, ImmutableVector};
|
|
|
|
use vec::{ImmutableEqVector, ImmutableCopyableVector};
|
|
|
|
use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
|
|
|
|
use iter::{CopyableOrderedIter, Times, TimesIx};
|
|
|
|
use num::Num;
|
|
|
|
use ptr::Ptr;
|
|
|
|
use to_str::ToStr;
|
2012-03-17 20:02:45 -05:00
|
|
|
|
2012-08-24 17:28:43 -05:00
|
|
|
export Path, WindowsPath, PosixPath, GenericPath;
|
2012-09-20 16:27:25 -05:00
|
|
|
export Option, Some, None;
|
2012-08-28 22:16:21 -05:00
|
|
|
export Result, Ok, Err;
|
2012-03-16 19:35:38 -05:00
|
|
|
export extensions;
|
2012-06-23 23:05:52 -05:00
|
|
|
// The following exports are the extension impls for numeric types
|
2012-08-14 18:54:13 -05:00
|
|
|
export Num, Times, TimesIx;
|
2012-07-11 17:00:40 -05:00
|
|
|
// The following exports are the common traits
|
2012-08-14 18:54:13 -05:00
|
|
|
export StrSlice, UniqueStr;
|
|
|
|
export ConstVector, CopyableVector, ImmutableVector;
|
2012-08-27 18:26:35 -05:00
|
|
|
export ImmutableEqVector, ImmutableCopyableVector, IterTraitExtensions;
|
|
|
|
export BaseIter, CopyableIter, CopyableOrderedIter, ExtendedIter, EqIter;
|
2012-08-13 18:20:27 -05:00
|
|
|
export TupleOps, ExtendedTupleOps;
|
2012-08-14 18:54:13 -05:00
|
|
|
export Ptr;
|
2012-08-13 18:20:27 -05:00
|
|
|
export ToStr;
|
2012-07-28 16:13:08 -05:00
|
|
|
|
2012-07-25 20:36:18 -05:00
|
|
|
// The following exports are the core operators and kinds
|
2012-07-28 16:13:08 -05:00
|
|
|
// The compiler has special knowlege of these so we must not duplicate them
|
|
|
|
// when compiling for testing
|
|
|
|
#[cfg(notest)]
|
2012-09-04 13:12:17 -05:00
|
|
|
use ops::{Const, Copy, Send, Owned};
|
2012-07-28 16:13:08 -05:00
|
|
|
#[cfg(notest)]
|
2012-09-04 13:12:17 -05:00
|
|
|
use ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
|
2012-07-28 16:13:08 -05:00
|
|
|
#[cfg(notest)]
|
2012-09-04 13:12:17 -05:00
|
|
|
use ops::{Shl, Shr, Index};
|
2012-07-28 16:13:08 -05:00
|
|
|
|
|
|
|
#[cfg(notest)]
|
2012-09-02 20:13:48 -05:00
|
|
|
export Const, Copy, Send, Owned;
|
2012-07-28 16:13:08 -05:00
|
|
|
#[cfg(notest)]
|
2012-09-02 20:13:48 -05:00
|
|
|
export Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor;
|
2012-07-28 16:14:17 -05:00
|
|
|
#[cfg(notest)]
|
2012-09-02 20:13:48 -05:00
|
|
|
export Shl, Shr, Index;
|
2011-12-20 14:29:59 -06:00
|
|
|
|
2012-07-28 18:05:38 -05:00
|
|
|
#[cfg(test)]
|
2012-09-11 19:46:20 -05:00
|
|
|
extern mod coreops(name = "core", vers = "0.4");
|
2012-07-28 18:05:38 -05:00
|
|
|
|
|
|
|
#[cfg(test)]
|
2012-09-04 13:12:17 -05:00
|
|
|
use coreops::ops::{Const, Copy, Send, Owned};
|
2012-07-28 18:05:38 -05:00
|
|
|
#[cfg(test)]
|
2012-09-04 13:12:17 -05:00
|
|
|
use coreops::ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
|
2012-07-28 18:05:38 -05:00
|
|
|
#[cfg(test)]
|
2012-09-04 13:12:17 -05:00
|
|
|
use coreops::ops::{Shl, Shr, Index};
|
2012-07-28 18:05:38 -05:00
|
|
|
|
|
|
|
|
2011-12-20 14:29:59 -06:00
|
|
|
// Export the log levels as global constants. Higher levels mean
|
|
|
|
// more-verbosity. Error is the bottom level, default logging level is
|
|
|
|
// warn-and-below.
|
|
|
|
|
2011-12-22 12:30:04 -06:00
|
|
|
export error, warn, info, debug;
|
2012-01-24 02:54:17 -06:00
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// The error log level
|
2011-12-22 12:30:04 -06:00
|
|
|
const error : u32 = 0_u32;
|
2012-07-04 16:53:12 -05:00
|
|
|
/// The warning log level
|
2011-12-22 12:30:04 -06:00
|
|
|
const warn : u32 = 1_u32;
|
2012-07-04 16:53:12 -05:00
|
|
|
/// The info log level
|
2011-12-22 12:30:04 -06:00
|
|
|
const info : u32 = 2_u32;
|
2012-07-04 16:53:12 -05:00
|
|
|
/// The debug log level
|
2011-12-22 12:30:04 -06:00
|
|
|
const debug : u32 = 3_u32;
|
2011-12-22 16:42:52 -06:00
|
|
|
|
|
|
|
// A curious inner-module that's not exported that contains the binding
|
|
|
|
// 'core' so that macro-expanded references to core::error and such
|
|
|
|
// can be resolved within libcore.
|
2012-09-19 18:52:32 -05:00
|
|
|
#[doc(hidden)] // FIXME #3538
|
2011-12-22 16:42:52 -06:00
|
|
|
mod core {
|
2012-09-21 20:10:45 -05:00
|
|
|
#[legacy_exports];
|
2011-12-22 16:42:52 -06:00
|
|
|
const error : u32 = 0_u32;
|
|
|
|
const warn : u32 = 1_u32;
|
|
|
|
const info : u32 = 2_u32;
|
|
|
|
const debug : u32 = 3_u32;
|
2012-01-17 18:45:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// Similar to above. Some magic to make core testable.
|
|
|
|
#[cfg(test)]
|
|
|
|
mod std {
|
2012-09-21 20:10:45 -05:00
|
|
|
#[legacy_exports];
|
2012-09-11 19:46:20 -05:00
|
|
|
extern mod std(vers = "0.4");
|
2012-09-07 20:08:21 -05:00
|
|
|
use std::test;
|
2012-01-20 10:12:03 -06:00
|
|
|
}
|