Factor imports mindlessly.
This commit is contained in:
parent
71297a5e17
commit
a4815b6742
68 changed files with 253 additions and 746 deletions
|
@ -1,42 +1,20 @@
|
||||||
|
|
||||||
|
|
||||||
// -*- rust -*-
|
// -*- rust -*-
|
||||||
import metadata::creader;
|
import metadata::{creader, cstore};
|
||||||
import metadata::cstore;
|
import syntax::parse::{parser, token};
|
||||||
import syntax::parse::parser;
|
import syntax::{ast, codemap};
|
||||||
import syntax::parse::token;
|
|
||||||
import syntax::ast;
|
|
||||||
import syntax::codemap;
|
|
||||||
import front::attr;
|
import front::attr;
|
||||||
import middle::trans;
|
import middle::{trans, resolve, freevars, kind, ty, typeck};
|
||||||
import middle::resolve;
|
|
||||||
import middle::freevars;
|
|
||||||
import middle::kind;
|
|
||||||
import middle::ty;
|
|
||||||
import middle::typeck;
|
|
||||||
import middle::tstate::ck;
|
import middle::tstate::ck;
|
||||||
import syntax::print::pp;
|
import syntax::print::{pp, pprust};
|
||||||
import syntax::print::pprust;
|
import util::{ppaux, common};
|
||||||
import util::ppaux;
|
|
||||||
import back::link;
|
import back::link;
|
||||||
import lib::llvm;
|
import lib::llvm;
|
||||||
import util::common;
|
import std::{fs, option, str, vec, int, io, run, getopts};
|
||||||
import std::fs;
|
|
||||||
import std::map::mk_hashmap;
|
import std::map::mk_hashmap;
|
||||||
import std::option;
|
import std::option::{some, none};
|
||||||
import std::option::some;
|
import std::getopts::{optopt, optmulti, optflag, optflagopt, opt_present};
|
||||||
import std::option::none;
|
|
||||||
import std::str;
|
|
||||||
import std::vec;
|
|
||||||
import std::int;
|
|
||||||
import std::io;
|
|
||||||
import std::run;
|
|
||||||
import std::getopts;
|
|
||||||
import std::getopts::optopt;
|
|
||||||
import std::getopts::optmulti;
|
|
||||||
import std::getopts::optflag;
|
|
||||||
import std::getopts::optflagopt;
|
|
||||||
import std::getopts::opt_present;
|
|
||||||
import back::link::output_type;
|
import back::link::output_type;
|
||||||
|
|
||||||
tag pp_mode { ppm_normal; ppm_expanded; ppm_typed; ppm_identified; }
|
tag pp_mode { ppm_normal; ppm_expanded; ppm_typed; ppm_identified; }
|
||||||
|
|
|
@ -1,15 +1,10 @@
|
||||||
|
|
||||||
import syntax::ast;
|
import syntax::{ast, codemap};
|
||||||
import syntax::ast::node_id;
|
import syntax::ast::node_id;
|
||||||
import syntax::codemap;
|
|
||||||
import codemap::span;
|
import codemap::span;
|
||||||
import syntax::ast::ty_mach;
|
import syntax::ast::ty_mach;
|
||||||
import std::uint;
|
import std::{uint, map, option, str};
|
||||||
import std::map;
|
import std::option::{some, none};
|
||||||
import std::option;
|
|
||||||
import std::option::some;
|
|
||||||
import std::option::none;
|
|
||||||
import std::str;
|
|
||||||
import syntax::parse::parser::parse_sess;
|
import syntax::parse::parser::parse_sess;
|
||||||
|
|
||||||
tag os { os_win32; os_macos; os_linux; }
|
tag os { os_win32; os_macos; os_linux; }
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
// Functions dealing with attributes and meta_items
|
// Functions dealing with attributes and meta_items
|
||||||
|
|
||||||
import std::vec;
|
import std::{vec, str, map, option};
|
||||||
import std::str;
|
import syntax::{ast, ast_util};
|
||||||
import std::map;
|
|
||||||
import std::option;
|
|
||||||
import syntax::ast;
|
|
||||||
import syntax::ast_util;
|
|
||||||
import util::common;
|
import util::common;
|
||||||
import driver::session;
|
import driver::session;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import std::vec;
|
import std::{vec, option};
|
||||||
import std::option;
|
import syntax::{ast, fold};
|
||||||
import syntax::ast;
|
|
||||||
import syntax::fold;
|
|
||||||
import attr;
|
import attr;
|
||||||
|
|
||||||
export strip_unconfigured_items;
|
export strip_unconfigured_items;
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
// Code that generates a test runner to run all the tests in a crate
|
// Code that generates a test runner to run all the tests in a crate
|
||||||
|
|
||||||
import std::option;
|
import std::{option, vec, str};
|
||||||
import std::vec;
|
import syntax::{ast, ast_util};
|
||||||
import std::str;
|
|
||||||
import syntax::ast;
|
|
||||||
import syntax::ast_util;
|
|
||||||
import syntax::ast_util::*;
|
import syntax::ast_util::*;
|
||||||
//import syntax::ast_util::dummy_sp;
|
//import syntax::ast_util::dummy_sp;
|
||||||
import syntax::fold;
|
import syntax::fold;
|
||||||
|
|
|
@ -1,28 +1,11 @@
|
||||||
import std::vec;
|
import std::{vec, str};
|
||||||
import std::str;
|
|
||||||
import std::str::sbuf;
|
import std::str::sbuf;
|
||||||
|
|
||||||
import llvm::ModuleRef;
|
import llvm::{ModuleRef, ContextRef, TypeRef, TypeHandleRef, ValueRef,
|
||||||
import llvm::ContextRef;
|
BasicBlockRef, BuilderRef, ModuleProviderRef, MemoryBufferRef,
|
||||||
import llvm::TypeRef;
|
PassManagerRef, UseRef, TargetDataRef, Linkage, Attribute,
|
||||||
import llvm::TypeHandleRef;
|
Visibility, CallConv, IntPredicate, RealPredicate, Opcode,
|
||||||
import llvm::ValueRef;
|
ObjectFileRef, SectionIteratorRef};
|
||||||
import llvm::BasicBlockRef;
|
|
||||||
import llvm::BuilderRef;
|
|
||||||
import llvm::ModuleProviderRef;
|
|
||||||
import llvm::MemoryBufferRef;
|
|
||||||
import llvm::PassManagerRef;
|
|
||||||
import llvm::UseRef;
|
|
||||||
import llvm::TargetDataRef;
|
|
||||||
import llvm::Linkage;
|
|
||||||
import llvm::Attribute;
|
|
||||||
import llvm::Visibility;
|
|
||||||
import llvm::CallConv;
|
|
||||||
import llvm::IntPredicate;
|
|
||||||
import llvm::RealPredicate;
|
|
||||||
import llvm::Opcode;
|
|
||||||
import llvm::ObjectFileRef;
|
|
||||||
import llvm::SectionIteratorRef;
|
|
||||||
|
|
||||||
type ULongLong = u64;
|
type ULongLong = u64;
|
||||||
type LongLong = i64;
|
type LongLong = i64;
|
||||||
|
|
|
@ -1,27 +1,17 @@
|
||||||
// Extracting metadata from crate files
|
// Extracting metadata from crate files
|
||||||
|
|
||||||
import driver::session;
|
import driver::session;
|
||||||
import syntax::ast;
|
import syntax::{ast, ast_util};
|
||||||
import syntax::ast_util;
|
import lib::llvm::{False, llvm, mk_object_file, mk_section_iter};
|
||||||
import lib::llvm::False;
|
|
||||||
import lib::llvm::llvm;
|
|
||||||
import lib::llvm::mk_object_file;
|
|
||||||
import lib::llvm::mk_section_iter;
|
|
||||||
import front::attr;
|
import front::attr;
|
||||||
import middle::resolve;
|
import middle::resolve;
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
import back::x86;
|
import back::x86;
|
||||||
import util::common;
|
import util::common;
|
||||||
import std::vec;
|
import std::{vec, str, fs, io, option};
|
||||||
import std::str;
|
import std::option::{none, some};
|
||||||
import std::fs;
|
import std::map::{hashmap, new_int_hash};
|
||||||
import std::io;
|
|
||||||
import std::option;
|
|
||||||
import std::option::none;
|
|
||||||
import std::option::some;
|
|
||||||
import std::map::hashmap;
|
|
||||||
import std::map::new_int_hash;
|
|
||||||
import syntax::print::pprust;
|
import syntax::print::pprust;
|
||||||
import common::*;
|
import common::*;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
// The crate store - a central repo for information collected about external
|
// The crate store - a central repo for information collected about external
|
||||||
// crates and libraries
|
// crates and libraries
|
||||||
|
|
||||||
import std::vec;
|
import std::{vec, map, str};
|
||||||
import std::map;
|
|
||||||
import std::str;
|
|
||||||
import syntax::ast;
|
import syntax::ast;
|
||||||
|
|
||||||
export cstore;
|
export cstore;
|
||||||
|
|
|
@ -1,18 +1,12 @@
|
||||||
// Decoding metadata from a single crate's metadata
|
// Decoding metadata from a single crate's metadata
|
||||||
|
|
||||||
import std::ebml;
|
import std::{ebml, vec, option, str, io};
|
||||||
import std::vec;
|
|
||||||
import std::option;
|
|
||||||
import std::str;
|
|
||||||
import std::io;
|
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
import syntax::ast;
|
import syntax::{ast, ast_util};
|
||||||
import syntax::ast_util;
|
|
||||||
import front::attr;
|
import front::attr;
|
||||||
import middle::ty;
|
import middle::ty;
|
||||||
import common::*;
|
import common::*;
|
||||||
import tydecode::parse_def_id;
|
import tydecode::{parse_def_id, parse_ty_data};
|
||||||
import tydecode::parse_ty_data;
|
|
||||||
import driver::session;
|
import driver::session;
|
||||||
import syntax::print::pprust;
|
import syntax::print::pprust;
|
||||||
import cstore;
|
import cstore;
|
||||||
|
|
|
@ -1,14 +1,7 @@
|
||||||
// Metadata encoding
|
// Metadata encoding
|
||||||
|
|
||||||
import std::vec;
|
import std::{vec, str, uint, io, option, ebml, map};
|
||||||
import std::str;
|
import std::option::{some, none};
|
||||||
import std::uint;
|
|
||||||
import std::io;
|
|
||||||
import std::option;
|
|
||||||
import std::option::some;
|
|
||||||
import std::option::none;
|
|
||||||
import std::ebml;
|
|
||||||
import std::map;
|
|
||||||
import syntax::ast::*;
|
import syntax::ast::*;
|
||||||
import syntax::ast_util;
|
import syntax::ast_util;
|
||||||
import syntax::ast_util::local_def;
|
import syntax::ast_util::local_def;
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
// Type decoding
|
// Type decoding
|
||||||
|
|
||||||
import std::vec;
|
import std::{vec, str, uint, option};
|
||||||
import std::str;
|
import std::option::{none, some};
|
||||||
import std::uint;
|
|
||||||
import std::option;
|
|
||||||
import std::option::none;
|
|
||||||
import std::option::some;
|
|
||||||
import syntax::ast;
|
import syntax::ast;
|
||||||
import syntax::ast::*;
|
import syntax::ast::*;
|
||||||
import syntax::ast_util;
|
import syntax::ast_util;
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
// Type encoding
|
// Type encoding
|
||||||
|
|
||||||
import std::str;
|
import std::{str, io, int, uint};
|
||||||
import std::io;
|
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
import std::option::some;
|
import std::option::{some, none};
|
||||||
import std::option::none;
|
|
||||||
import std::int;
|
|
||||||
import std::uint;
|
|
||||||
import syntax::ast::*;
|
import syntax::ast::*;
|
||||||
import middle::ty;
|
import middle::ty;
|
||||||
import syntax::print::pprust::*;
|
import syntax::print::pprust::*;
|
||||||
|
|
|
@ -1,20 +1,12 @@
|
||||||
|
|
||||||
import syntax::ast;
|
import syntax::{ast, ast_util};
|
||||||
import syntax::ast_util;
|
import ast::{ident, fn_ident, node_id, def_id};
|
||||||
import ast::ident;
|
|
||||||
import ast::fn_ident;
|
|
||||||
import ast::node_id;
|
|
||||||
import ast::def_id;
|
|
||||||
import mut::{expr_root, mut_field, inner_mut};
|
import mut::{expr_root, mut_field, inner_mut};
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
import visit::vt;
|
import visit::vt;
|
||||||
import std::vec;
|
import std::{vec, str, option};
|
||||||
import std::str;
|
import std::option::{some, none, is_none};
|
||||||
import std::option;
|
|
||||||
import std::option::some;
|
|
||||||
import std::option::none;
|
|
||||||
import std::option::is_none;
|
|
||||||
|
|
||||||
// This is not an alias-analyser (though it would merit from becoming one, or
|
// This is not an alias-analyser (though it would merit from becoming one, or
|
||||||
// getting input from one, to be more precise). It is a pass that checks
|
// getting input from one, to be more precise). It is a pass that checks
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import std::smallintmap;
|
import std::{smallintmap, option};
|
||||||
import std::option;
|
|
||||||
import syntax::ast::*;
|
import syntax::ast::*;
|
||||||
import syntax::visit;
|
import syntax::{visit, codemap};
|
||||||
import syntax::codemap;
|
|
||||||
import visit::vt;
|
import visit::vt;
|
||||||
|
|
||||||
tag ast_node {
|
tag ast_node {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import syntax::ast::*;
|
import syntax::ast::*;
|
||||||
import syntax::ast_util::variant_def_ids;
|
import syntax::ast_util::{variant_def_ids, dummy_sp};
|
||||||
import syntax::ast_util::dummy_sp;
|
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
|
|
||||||
fn check_crate(tcx: ty::ctxt, crate: @crate) {
|
fn check_crate(tcx: ty::ctxt, crate: @crate) {
|
||||||
|
|
|
@ -1,15 +1,10 @@
|
||||||
// A pass that annotates for each loops and functions with the free
|
// A pass that annotates for each loops and functions with the free
|
||||||
// variables that they contain.
|
// variables that they contain.
|
||||||
|
|
||||||
import std::map;
|
import std::{map, option, int, str};
|
||||||
import std::map::*;
|
import std::map::*;
|
||||||
import std::option;
|
|
||||||
import std::int;
|
|
||||||
import std::str;
|
|
||||||
import std::option::*;
|
import std::option::*;
|
||||||
import syntax::ast;
|
import syntax::{ast, ast_util, visit};
|
||||||
import syntax::ast_util;
|
|
||||||
import syntax::visit;
|
|
||||||
import driver::session;
|
import driver::session;
|
||||||
import middle::resolve;
|
import middle::resolve;
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
|
|
|
@ -1,18 +1,13 @@
|
||||||
// Routines useful for garbage collection.
|
// Routines useful for garbage collection.
|
||||||
|
|
||||||
import lib::llvm::False;
|
import lib::llvm::{True, False};
|
||||||
import lib::llvm::True;
|
|
||||||
import lib::llvm::llvm::ValueRef;
|
import lib::llvm::llvm::ValueRef;
|
||||||
import middle::trans;
|
import middle::trans;
|
||||||
import middle::trans::{get_tydesc, tps_normal};
|
import middle::trans::{get_tydesc, tps_normal};
|
||||||
import middle::trans_common::*;
|
import middle::trans_common::*;
|
||||||
import middle::ty;
|
import middle::ty;
|
||||||
import std::option::none;
|
import std::option::{some, none};
|
||||||
import std::option::some;
|
import std::{ptr, str, unsafe, vec};
|
||||||
import std::ptr;
|
|
||||||
import std::str;
|
|
||||||
import std::unsafe;
|
|
||||||
import std::vec;
|
|
||||||
|
|
||||||
import lll = lib::llvm::llvm;
|
import lll = lib::llvm::llvm;
|
||||||
import bld = trans_build;
|
import bld = trans_build;
|
||||||
|
|
|
@ -70,19 +70,9 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import syntax::{ast, ast_util, visit};
|
||||||
import syntax::ast;
|
import std::{vec, option, str};
|
||||||
import syntax::ast_util;
|
import ast::{kind, kind_unique, kind_shared, kind_pinned};
|
||||||
import syntax::visit;
|
|
||||||
|
|
||||||
import std::vec;
|
|
||||||
import std::option;
|
|
||||||
import std::str;
|
|
||||||
|
|
||||||
import ast::kind;
|
|
||||||
import ast::kind_unique;
|
|
||||||
import ast::kind_shared;
|
|
||||||
import ast::kind_pinned;
|
|
||||||
|
|
||||||
fn kind_lteq(a: kind, b: kind) -> bool {
|
fn kind_lteq(a: kind, b: kind) -> bool {
|
||||||
alt a {
|
alt a {
|
||||||
|
|
|
@ -1,38 +1,21 @@
|
||||||
|
|
||||||
import syntax::ast;
|
import syntax::{ast, ast_util, codemap};
|
||||||
import syntax::ast::*;
|
import syntax::ast::*;
|
||||||
import syntax::ast_util;
|
import ast::{ident, fn_ident, def, def_id, node_id};
|
||||||
import syntax::codemap;
|
import syntax::ast_util::{local_def, respan};
|
||||||
import ast::ident;
|
|
||||||
import ast::fn_ident;
|
|
||||||
import ast::def;
|
|
||||||
import ast::def_id;
|
|
||||||
import ast::node_id;
|
|
||||||
import syntax::ast_util::local_def;
|
|
||||||
|
|
||||||
import metadata::csearch;
|
import metadata::{csearch, cstore};
|
||||||
import metadata::cstore;
|
|
||||||
import driver::session::session;
|
import driver::session::session;
|
||||||
import util::common::*;
|
import util::common::*;
|
||||||
import std::map::new_int_hash;
|
import std::map::{new_int_hash, new_str_hash};
|
||||||
import std::map::new_str_hash;
|
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
import syntax::ast_util::respan;
|
|
||||||
import middle::ty::constr_table;
|
import middle::ty::constr_table;
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
import visit::vt;
|
import visit::vt;
|
||||||
import std::vec;
|
import std::{vec, int, list, option, str};
|
||||||
import std::int;
|
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
import std::list;
|
import std::list::{list, nil, cons};
|
||||||
import std::list::list;
|
import std::option::{some, none, is_none};
|
||||||
import std::list::nil;
|
|
||||||
import std::list::cons;
|
|
||||||
import std::option;
|
|
||||||
import std::option::is_none;
|
|
||||||
import std::option::some;
|
|
||||||
import std::option::none;
|
|
||||||
import std::str;
|
|
||||||
import syntax::print::pprust::*;
|
import syntax::print::pprust::*;
|
||||||
|
|
||||||
export resolve_crate;
|
export resolve_crate;
|
||||||
|
|
|
@ -2,35 +2,22 @@
|
||||||
// This substitutes for the runtime tags used by e.g. MLs.
|
// This substitutes for the runtime tags used by e.g. MLs.
|
||||||
|
|
||||||
import lib::llvm::True;
|
import lib::llvm::True;
|
||||||
import lib::llvm::llvm::ModuleRef;
|
import lib::llvm::llvm::{ModuleRef, TypeRef, ValueRef};
|
||||||
import lib::llvm::llvm::TypeRef;
|
import middle::{trans, trans_common};
|
||||||
import lib::llvm::llvm::ValueRef;
|
|
||||||
import middle::trans;
|
|
||||||
import middle::trans_common::crate_ctxt;
|
|
||||||
import middle::trans::llsize_of;
|
import middle::trans::llsize_of;
|
||||||
import middle::trans_common::val_ty;
|
import middle::trans_common::{crate_ctxt, val_ty, C_bytes, C_int,
|
||||||
import middle::trans_common;
|
C_named_struct, C_struct, C_uint, T_i8, T_ptr};
|
||||||
import middle::trans_common::C_bytes;
|
|
||||||
import middle::trans_common::C_int;
|
|
||||||
import middle::trans_common::C_named_struct;
|
|
||||||
import middle::trans_common::C_struct;
|
|
||||||
import middle::trans_common::C_uint;
|
|
||||||
import middle::trans_common::T_i8;
|
|
||||||
import middle::trans_common::T_ptr;
|
|
||||||
import middle::ty;
|
import middle::ty;
|
||||||
import middle::ty::field;
|
import middle::ty::{field, mt};
|
||||||
import middle::ty::mt;
|
|
||||||
import syntax::ast;
|
import syntax::ast;
|
||||||
import syntax::ast_util::dummy_sp;
|
import syntax::ast_util::dummy_sp;
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
import syntax::util::interner;
|
import syntax::util::interner;
|
||||||
import util::common;
|
import util::common;
|
||||||
|
|
||||||
import std::vec;
|
import std::{vec, str};
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
import std::option::none;
|
import std::option::{none, some};
|
||||||
import std::option::some;
|
|
||||||
import std::str;
|
|
||||||
|
|
||||||
import ty_ctxt = middle::ty::ctxt;
|
import ty_ctxt = middle::ty::ctxt;
|
||||||
|
|
||||||
|
|
|
@ -12,66 +12,38 @@
|
||||||
// pcwalton). You can, instead, find out its TypeRef by calling val_ty,
|
// pcwalton). You can, instead, find out its TypeRef by calling val_ty,
|
||||||
// but many TypeRefs correspond to one ty::t; for instance, tup(int, int,
|
// but many TypeRefs correspond to one ty::t; for instance, tup(int, int,
|
||||||
// int) and rec(x=int, y=int, z=int) will have the same TypeRef.
|
// int) and rec(x=int, y=int, z=int) will have the same TypeRef.
|
||||||
import std::int;
|
import std::{int, str, uint, map, option, fs, time, vec};
|
||||||
import std::str;
|
|
||||||
import std::uint;
|
|
||||||
import std::map;
|
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
import std::option;
|
import std::map::{new_int_hash, new_str_hash};
|
||||||
import std::option::some;
|
import std::option::{some, none};
|
||||||
import std::option::none;
|
|
||||||
import std::fs;
|
|
||||||
import std::time;
|
|
||||||
import std::vec;
|
|
||||||
import syntax::ast;
|
|
||||||
import syntax::ast_util;
|
|
||||||
import driver::session;
|
import driver::session;
|
||||||
import middle::ty;
|
import middle::{ty, gc};
|
||||||
import middle::freevars::*;
|
import middle::freevars::*;
|
||||||
import middle::gc;
|
import back::{link, x86, abi, upcall};
|
||||||
import back::link;
|
import syntax::{ast, ast_util};
|
||||||
import back::x86;
|
|
||||||
import back::abi;
|
|
||||||
import back::upcall;
|
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
|
import syntax::codemap::span;
|
||||||
|
import syntax::print::pprust::{expr_to_str, path_to_str};
|
||||||
import visit::vt;
|
import visit::vt;
|
||||||
import util::common;
|
import util::common;
|
||||||
import util::common::*;
|
import util::common::*;
|
||||||
import std::map::new_int_hash;
|
import lib::llvm::{llvm, target_data, type_names,
|
||||||
import std::map::new_str_hash;
|
mk_target_data, mk_type_names};
|
||||||
import syntax::codemap::span;
|
import lib::llvm::llvm::{ModuleRef, ValueRef, TypeRef, TypeHandleRef,
|
||||||
import lib::llvm::llvm;
|
BuilderRef, BasicBlockRef};
|
||||||
import lib::llvm::target_data;
|
import lib::llvm::{Bool, True, False};
|
||||||
import lib::llvm::type_names;
|
import link::{mangle_internal_name_by_type_only,
|
||||||
import lib::llvm::mk_target_data;
|
mangle_internal_name_by_seq,
|
||||||
import lib::llvm::mk_type_names;
|
mangle_internal_name_by_path,
|
||||||
import lib::llvm::llvm::ModuleRef;
|
mangle_internal_name_by_path_and_seq,
|
||||||
import lib::llvm::llvm::ValueRef;
|
mangle_exported_name};
|
||||||
import lib::llvm::llvm::TypeRef;
|
import metadata::{creader, csearch, cstore};
|
||||||
import lib::llvm::llvm::TypeHandleRef;
|
import util::ppaux::{ty_to_str, ty_to_short_str};
|
||||||
import lib::llvm::llvm::BuilderRef;
|
|
||||||
import lib::llvm::llvm::BasicBlockRef;
|
|
||||||
import lib::llvm::False;
|
|
||||||
import lib::llvm::True;
|
|
||||||
import lib::llvm::Bool;
|
|
||||||
import link::mangle_internal_name_by_type_only;
|
|
||||||
import link::mangle_internal_name_by_seq;
|
|
||||||
import link::mangle_internal_name_by_path;
|
|
||||||
import link::mangle_internal_name_by_path_and_seq;
|
|
||||||
import link::mangle_exported_name;
|
|
||||||
import metadata::creader;
|
|
||||||
import metadata::csearch;
|
|
||||||
import metadata::cstore;
|
|
||||||
import util::ppaux::ty_to_str;
|
|
||||||
import util::ppaux::ty_to_short_str;
|
|
||||||
import syntax::print::pprust::expr_to_str;
|
|
||||||
import syntax::print::pprust::path_to_str;
|
|
||||||
|
|
||||||
import trans_common::*;
|
import trans_common::*;
|
||||||
import trans_build::*;
|
import trans_build::*;
|
||||||
|
|
||||||
import trans_objects::trans_anon_obj;
|
import trans_objects::{trans_anon_obj, trans_obj};
|
||||||
import trans_objects::trans_obj;
|
|
||||||
import tvec = trans_vec;
|
import tvec = trans_vec;
|
||||||
|
|
||||||
fn type_of(cx: @crate_ctxt, sp: span, t: ty::t) : type_has_static_size(cx, t)
|
fn type_of(cx: @crate_ctxt, sp: span, t: ty::t) : type_has_static_size(cx, t)
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import std::str;
|
import std::{str, vec, option};
|
||||||
import std::vec;
|
import option::{some, none};
|
||||||
import std::option;
|
|
||||||
import option::some;
|
|
||||||
import option::none;
|
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
|
|
||||||
import lib::llvm::llvm;
|
import lib::llvm::llvm;
|
||||||
import lib::llvm::llvm::ValueRef;
|
import lib::llvm::llvm::{ValueRef, TypeRef, BasicBlockRef};
|
||||||
import lib::llvm::llvm::TypeRef;
|
|
||||||
import lib::llvm::llvm::BasicBlockRef;
|
|
||||||
import trans_build::*;
|
import trans_build::*;
|
||||||
import trans::new_sub_block_ctxt;
|
import trans::{new_sub_block_ctxt, new_scope_block_ctxt, load_if_immediate};
|
||||||
import trans::new_scope_block_ctxt;
|
|
||||||
import trans::load_if_immediate;
|
|
||||||
import ty::pat_ty;
|
import ty::pat_ty;
|
||||||
import syntax::ast;
|
import syntax::ast;
|
||||||
import syntax::ast_util;
|
import syntax::ast_util;
|
||||||
|
|
|
@ -3,63 +3,37 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import std::int;
|
import std::{int, vec, str, uint, map, option, fs, unsafe};
|
||||||
import std::vec;
|
|
||||||
import std::vec::to_ptr;
|
import std::vec::to_ptr;
|
||||||
import std::str;
|
|
||||||
import std::uint;
|
|
||||||
import std::map;
|
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
import std::option;
|
import std::option::{some, none};
|
||||||
import std::option::some;
|
|
||||||
import std::option::none;
|
|
||||||
import std::fs;
|
|
||||||
import std::unsafe;
|
|
||||||
import syntax::ast;
|
import syntax::ast;
|
||||||
import driver::session;
|
import driver::session;
|
||||||
import middle::ty;
|
import middle::ty;
|
||||||
import back::link;
|
import back::{link, x86, abi, upcall};
|
||||||
import back::x86;
|
|
||||||
import back::abi;
|
|
||||||
import back::upcall;
|
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
import visit::vt;
|
import visit::vt;
|
||||||
import util::common;
|
import util::common;
|
||||||
import util::common::*;
|
import util::common::*;
|
||||||
import std::map::new_int_hash;
|
import std::map::{new_int_hash, new_str_hash};
|
||||||
import std::map::new_str_hash;
|
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
import lib::llvm::llvm;
|
import lib::llvm::{llvm, target_data, type_names,
|
||||||
import lib::llvm::target_data;
|
mk_target_data, mk_type_names};
|
||||||
import lib::llvm::type_names;
|
import lib::llvm::llvm::{ModuleRef, ValueRef, TypeRef, TypeHandleRef,
|
||||||
import lib::llvm::mk_target_data;
|
BuilderRef, BasicBlockRef};
|
||||||
import lib::llvm::mk_type_names;
|
import lib::llvm::{True, False, Bool};
|
||||||
import lib::llvm::llvm::ModuleRef;
|
import link::{mangle_internal_name_by_type_only,
|
||||||
import lib::llvm::llvm::ValueRef;
|
mangle_internal_name_by_seq,
|
||||||
import lib::llvm::llvm::TypeRef;
|
mangle_internal_name_by_path,
|
||||||
import lib::llvm::llvm::TypeHandleRef;
|
mangle_internal_name_by_path_and_seq,
|
||||||
import lib::llvm::llvm::BuilderRef;
|
mangle_exported_name};
|
||||||
import lib::llvm::llvm::BasicBlockRef;
|
import metadata::{creader, csearch, cstore};
|
||||||
import lib::llvm::False;
|
import util::ppaux::{ty_to_str, ty_to_short_str};
|
||||||
import lib::llvm::True;
|
import syntax::print::pprust::{expr_to_str, path_to_str};
|
||||||
import lib::llvm::Bool;
|
|
||||||
import link::mangle_internal_name_by_type_only;
|
|
||||||
import link::mangle_internal_name_by_seq;
|
|
||||||
import link::mangle_internal_name_by_path;
|
|
||||||
import link::mangle_internal_name_by_path_and_seq;
|
|
||||||
import link::mangle_exported_name;
|
|
||||||
import metadata::creader;
|
|
||||||
import metadata::csearch;
|
|
||||||
import metadata::cstore;
|
|
||||||
import util::ppaux::ty_to_str;
|
|
||||||
import util::ppaux::ty_to_short_str;
|
|
||||||
import syntax::print::pprust::expr_to_str;
|
|
||||||
import syntax::print::pprust::path_to_str;
|
|
||||||
import bld = trans_build;
|
import bld = trans_build;
|
||||||
|
|
||||||
// FIXME: These should probably be pulled in here too.
|
// FIXME: These should probably be pulled in here too.
|
||||||
import trans::type_of_fn_full;
|
import trans::{type_of_fn_full, drop_ty};
|
||||||
import trans::drop_ty;
|
|
||||||
|
|
||||||
obj namegen(mutable i: int) {
|
obj namegen(mutable i: int) {
|
||||||
fn next(prefix: str) -> str { i += 1; ret prefix + int::str(i); }
|
fn next(prefix: str) -> str { i += 1; ret prefix + int::str(i); }
|
||||||
|
|
|
@ -1,22 +1,15 @@
|
||||||
// Translation of object-related things to LLVM IR.
|
// Translation of object-related things to LLVM IR.
|
||||||
|
|
||||||
import std::str;
|
import std::{str, option, vec};
|
||||||
import std::option;
|
import option::{none, some};
|
||||||
import std::vec;
|
|
||||||
import option::none;
|
|
||||||
import option::some;
|
|
||||||
|
|
||||||
import lib::llvm::llvm;
|
import lib::llvm::{llvm, Bool, True};
|
||||||
import lib::llvm::Bool;
|
import lib::llvm::llvm::{TypeRef, ValueRef};
|
||||||
import lib::llvm::True;
|
|
||||||
import lib::llvm::llvm::TypeRef;
|
|
||||||
import lib::llvm::llvm::ValueRef;
|
|
||||||
|
|
||||||
import back::abi;
|
import back::abi;
|
||||||
import back::link::mangle_internal_name_by_path;
|
import back::link::{mangle_internal_name_by_path,
|
||||||
import back::link::mangle_internal_name_by_path_and_seq;
|
mangle_internal_name_by_path_and_seq};
|
||||||
import syntax::ast;
|
import syntax::{ast, ast_util};
|
||||||
import syntax::ast_util;
|
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
|
|
||||||
import trans_common::*;
|
import trans_common::*;
|
||||||
|
|
|
@ -1,28 +1,15 @@
|
||||||
|
|
||||||
import std::option;
|
import std::{int, uint, str, option};
|
||||||
import std::option::some;
|
import std::option::{some, none};
|
||||||
import std::option::none;
|
|
||||||
import std::int;
|
|
||||||
import std::uint;
|
|
||||||
import std::str;
|
|
||||||
import syntax::ast::*;
|
import syntax::ast::*;
|
||||||
import syntax::ast_util::pat_binding_ids;
|
import syntax::ast_util::pat_binding_ids;
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
import std::map::new_str_hash;
|
import std::map::new_str_hash;
|
||||||
import util::common::log_expr_err;
|
import util::common::{log_expr_err, log_block_err, log_item_err,
|
||||||
import util::common::log_block_err;
|
log_stmt_err, log_expr, log_block, log_stmt};
|
||||||
import util::common::log_item_err;
|
import aux::{fn_info, fn_info_map, num_constraints, get_fn_info,
|
||||||
import util::common::log_stmt_err;
|
crate_ctxt, add_node};
|
||||||
import util::common::log_expr;
|
|
||||||
import util::common::log_block;
|
|
||||||
import util::common::log_stmt;
|
|
||||||
import aux::fn_info;
|
|
||||||
import aux::fn_info_map;
|
|
||||||
import aux::num_constraints;
|
|
||||||
import aux::get_fn_info;
|
|
||||||
import aux::crate_ctxt;
|
|
||||||
import aux::add_node;
|
|
||||||
import middle::tstate::ann::empty_ann;
|
import middle::tstate::ann::empty_ann;
|
||||||
|
|
||||||
fn collect_ids_expr(e: @expr, rs: @mutable [node_id]) { *rs += [e.id]; }
|
fn collect_ids_expr(e: @expr, rs: @mutable [node_id]) { *rs += [e.id]; }
|
||||||
|
|
|
@ -1,48 +1,26 @@
|
||||||
import std::vec;
|
import std::{vec, int, uint, str, option};
|
||||||
import std::int::str;
|
|
||||||
import std::str;
|
|
||||||
import std::option;
|
|
||||||
import std::option::*;
|
import std::option::*;
|
||||||
import std::int;
|
|
||||||
import std::uint;
|
|
||||||
import syntax::ast::*;
|
import syntax::ast::*;
|
||||||
import syntax::ast_util::*;
|
import syntax::ast_util::*;
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
import util::common;
|
import util::common;
|
||||||
import util::common::log_block;
|
import util::common::log_block;
|
||||||
import std::map::new_int_hash;
|
import std::map::{new_int_hash, new_uint_hash};
|
||||||
import std::map::new_uint_hash;
|
import util::common::{log_expr_err, lit_eq};
|
||||||
import util::common::log_expr_err;
|
|
||||||
import util::common::lit_eq;
|
|
||||||
import syntax::print::pprust::path_to_str;
|
import syntax::print::pprust::path_to_str;
|
||||||
import tstate::ann::pre_and_post;
|
import tstate::ann::{pre_and_post, pre_and_post_state, empty_ann, prestate,
|
||||||
import tstate::ann::pre_and_post_state;
|
poststate, precond, postcond, empty_states, pps_len,
|
||||||
import tstate::ann::empty_ann;
|
set_prestate, set_poststate, set_in_poststate_,
|
||||||
import tstate::ann::prestate;
|
extend_prestate, extend_poststate, set_precondition,
|
||||||
import tstate::ann::poststate;
|
set_postcondition, set_in_postcond_, ts_ann,
|
||||||
import tstate::ann::precond;
|
clear_in_postcond,
|
||||||
import tstate::ann::postcond;
|
clear_in_poststate, clear_in_poststate_};
|
||||||
import tstate::ann::empty_states;
|
|
||||||
import tstate::ann::pps_len;
|
|
||||||
import tstate::ann::set_prestate;
|
|
||||||
import tstate::ann::set_poststate;
|
|
||||||
import tstate::ann::set_in_poststate_;
|
|
||||||
import tstate::ann::extend_prestate;
|
|
||||||
import tstate::ann::extend_poststate;
|
|
||||||
import tstate::ann::set_precondition;
|
|
||||||
import tstate::ann::set_postcondition;
|
|
||||||
import tstate::ann::set_in_postcond_;
|
|
||||||
import tstate::ann::ts_ann;
|
|
||||||
import tstate::ann::clear_in_postcond;
|
|
||||||
import tstate::ann::clear_in_poststate;
|
|
||||||
import tstate::ann::clear_in_poststate_;
|
|
||||||
import tritv::*;
|
import tritv::*;
|
||||||
import bitvectors::promises_;
|
import bitvectors::promises_;
|
||||||
|
|
||||||
import syntax::print::pprust::constr_args_to_str;
|
import syntax::print::pprust::{constr_args_to_str, constr_arg_to_str,
|
||||||
import syntax::print::pprust::constr_arg_to_str;
|
lit_to_str};
|
||||||
import syntax::print::pprust::lit_to_str;
|
|
||||||
|
|
||||||
// Used to communicate which operands should be invalidated
|
// Used to communicate which operands should be invalidated
|
||||||
// to helper functions
|
// to helper functions
|
||||||
|
|
|
@ -3,27 +3,13 @@ import syntax::visit;
|
||||||
import std::vec;
|
import std::vec;
|
||||||
import std::option::*;
|
import std::option::*;
|
||||||
import aux::*;
|
import aux::*;
|
||||||
import tstate::ann::pre_and_post;
|
import tstate::ann::{pre_and_post, precond, postcond, prestate, poststate,
|
||||||
import tstate::ann::precond;
|
relax_prestate, relax_precond, relax_poststate,
|
||||||
import tstate::ann::postcond;
|
pps_len, true_precond, empty_prestate,
|
||||||
import tstate::ann::prestate;
|
difference, union, intersect, clone,
|
||||||
import tstate::ann::poststate;
|
set_in_postcond, set_in_poststate, set_in_poststate_,
|
||||||
import tstate::ann::relax_prestate;
|
clear_in_poststate, clear_in_prestate,
|
||||||
import tstate::ann::relax_precond;
|
clear_in_poststate_};
|
||||||
import tstate::ann::relax_poststate;
|
|
||||||
import tstate::ann::pps_len;
|
|
||||||
import tstate::ann::true_precond;
|
|
||||||
import tstate::ann::empty_prestate;
|
|
||||||
import tstate::ann::difference;
|
|
||||||
import tstate::ann::union;
|
|
||||||
import tstate::ann::intersect;
|
|
||||||
import tstate::ann::clone;
|
|
||||||
import tstate::ann::set_in_postcond;
|
|
||||||
import tstate::ann::set_in_poststate;
|
|
||||||
import tstate::ann::set_in_poststate_;
|
|
||||||
import tstate::ann::clear_in_poststate;
|
|
||||||
import tstate::ann::clear_in_prestate;
|
|
||||||
import tstate::ann::clear_in_poststate_;
|
|
||||||
import tritv::*;
|
import tritv::*;
|
||||||
import util::common::*;
|
import util::common::*;
|
||||||
|
|
||||||
|
|
|
@ -1,43 +1,17 @@
|
||||||
|
|
||||||
import syntax::ast;
|
import syntax::ast;
|
||||||
import ast::method;
|
import ast::{method, item, item_fn, _fn, obj_field, _obj, stmt, ident,
|
||||||
import ast::item;
|
fn_ident, node_id, def_id, ty_param, crate, return, noreturn,
|
||||||
import ast::item_fn;
|
expr};
|
||||||
import ast::_fn;
|
|
||||||
import ast::obj_field;
|
|
||||||
import ast::_obj;
|
|
||||||
import ast::stmt;
|
|
||||||
import ast::ident;
|
|
||||||
import ast::fn_ident;
|
|
||||||
import ast::node_id;
|
|
||||||
import ast::def_id;
|
|
||||||
import syntax::ast_util::local_def;
|
import syntax::ast_util::local_def;
|
||||||
import ast::ty_param;
|
|
||||||
import ast::crate;
|
|
||||||
import ast::return;
|
|
||||||
import ast::noreturn;
|
|
||||||
import ast::expr;
|
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
import middle::ty::type_is_nil;
|
import middle::ty::{type_is_nil, ret_ty_of_fn};
|
||||||
import middle::ty::ret_ty_of_fn;
|
import tstate::ann::{ts_ann, empty_poststate, true_precond, true_postcond,
|
||||||
import tstate::ann::ts_ann;
|
false_postcond, precond, postcond, poststate, prestate,
|
||||||
import tstate::ann::empty_poststate;
|
implies, ann_precond, ann_prestate};
|
||||||
import tstate::ann::true_precond;
|
import std::{str, option};
|
||||||
import tstate::ann::true_postcond;
|
import std::option::{t, some, none};
|
||||||
import tstate::ann::false_postcond;
|
|
||||||
import tstate::ann::precond;
|
|
||||||
import tstate::ann::postcond;
|
|
||||||
import tstate::ann::poststate;
|
|
||||||
import tstate::ann::prestate;
|
|
||||||
import tstate::ann::implies;
|
|
||||||
import tstate::ann::ann_precond;
|
|
||||||
import tstate::ann::ann_prestate;
|
|
||||||
import std::option;
|
|
||||||
import std::option::t;
|
|
||||||
import std::option::some;
|
|
||||||
import std::option::none;
|
|
||||||
import std::str;
|
|
||||||
import aux::*;
|
import aux::*;
|
||||||
import syntax::print::pprust::ty_to_str;
|
import syntax::print::pprust::ty_to_str;
|
||||||
import util::common::log_stmt_err;
|
import util::common::log_stmt_err;
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
import std::str;
|
import std::{str, uint, int, vec};
|
||||||
import std::uint;
|
|
||||||
import std::int;
|
|
||||||
import std::vec;
|
|
||||||
import syntax::ast::*;
|
import syntax::ast::*;
|
||||||
import syntax::ast_util::*;
|
import syntax::ast_util::*;
|
||||||
import util::ppaux::fn_ident_to_string;
|
import util::ppaux::fn_ident_to_string;
|
||||||
|
|
|
@ -1,36 +1,20 @@
|
||||||
|
|
||||||
import std::vec;
|
import std::{vec, str, option};
|
||||||
import std::str;
|
import std::option::{none, some};
|
||||||
import std::option;
|
|
||||||
import std::option::none;
|
|
||||||
import std::option::some;
|
|
||||||
|
|
||||||
import tstate::ann::*;
|
import tstate::ann::*;
|
||||||
import aux::*;
|
import aux::*;
|
||||||
import bitvectors::bit_num;
|
import bitvectors::{bit_num, promises, seq_preconds, seq_postconds,
|
||||||
import bitvectors::promises;
|
intersect_states, declare_var, gen_poststate,
|
||||||
import bitvectors::seq_preconds;
|
relax_precond_block, gen};
|
||||||
import bitvectors::seq_postconds;
|
|
||||||
import bitvectors::intersect_states;
|
|
||||||
import bitvectors::declare_var;
|
|
||||||
import bitvectors::gen_poststate;
|
|
||||||
import bitvectors::relax_precond_block;
|
|
||||||
import bitvectors::gen;
|
|
||||||
import tritv::*;
|
import tritv::*;
|
||||||
import syntax::ast::*;
|
import syntax::ast::*;
|
||||||
import syntax::ast_util::*;
|
import syntax::ast_util::*;
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
import std::map::new_int_hash;
|
import std::map::new_int_hash;
|
||||||
import util::common::new_def_hash;
|
import util::common::{new_def_hash, log_expr, log_fn, field_exprs,
|
||||||
import util::common::log_expr;
|
has_nonlocal_exits, log_stmt, log_stmt_err,
|
||||||
import util::common::log_fn;
|
log_expr_err, log_block_err, log_block};
|
||||||
import util::common::field_exprs;
|
|
||||||
import util::common::has_nonlocal_exits;
|
|
||||||
import util::common::log_stmt;
|
|
||||||
import util::common::log_stmt_err;
|
|
||||||
import util::common::log_expr_err;
|
|
||||||
import util::common::log_block_err;
|
|
||||||
import util::common::log_block;
|
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
import util::ppaux::fn_ident_to_string;
|
import util::ppaux::fn_ident_to_string;
|
||||||
|
|
||||||
|
|
|
@ -1,36 +1,19 @@
|
||||||
import syntax::print::pprust::path_to_str;
|
import syntax::print::pprust::path_to_str;
|
||||||
import util::ppaux::ty_to_str;
|
import util::ppaux::ty_to_str;
|
||||||
import std::vec;
|
import std::{vec, str, option};
|
||||||
import std::str;
|
import std::option::{get, is_none, none, some, maybe};
|
||||||
import std::option;
|
|
||||||
import std::option::get;
|
|
||||||
import std::option::is_none;
|
|
||||||
import std::option::none;
|
|
||||||
import std::option::some;
|
|
||||||
import std::option::maybe;
|
|
||||||
import ann::*;
|
import ann::*;
|
||||||
import aux::*;
|
import aux::*;
|
||||||
import tritv::tritv_clone;
|
import tritv::{tritv_clone, tritv_set, ttrue};
|
||||||
import tritv::tritv_set;
|
|
||||||
import tritv::ttrue;
|
|
||||||
|
|
||||||
import bitvectors::*;
|
import bitvectors::*;
|
||||||
import syntax::ast::*;
|
import syntax::ast::*;
|
||||||
import syntax::ast_util::*;
|
import syntax::ast_util::*;
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
import middle::ty::expr_ty;
|
import middle::ty::{expr_ty, type_is_nil, type_is_bot};
|
||||||
import middle::ty::type_is_nil;
|
import util::common::{new_def_hash, log_expr, log_block, log_block_err,
|
||||||
import middle::ty::type_is_bot;
|
log_fn, field_exprs, has_nonlocal_exits, log_stmt,
|
||||||
import util::common::new_def_hash;
|
log_stmt_err, log_expr_err};
|
||||||
import util::common::log_expr;
|
|
||||||
import util::common::log_block;
|
|
||||||
import util::common::log_block_err;
|
|
||||||
import util::common::log_fn;
|
|
||||||
import util::common::field_exprs;
|
|
||||||
import util::common::has_nonlocal_exits;
|
|
||||||
import util::common::log_stmt;
|
|
||||||
import util::common::log_stmt_err;
|
|
||||||
import util::common::log_expr_err;
|
|
||||||
|
|
||||||
fn forbid_upvar(fcx: fn_ctxt, rhs_id: node_id, sp: span, t: oper_type) {
|
fn forbid_upvar(fcx: fn_ctxt, rhs_id: node_id, sp: span, t: oper_type) {
|
||||||
alt t {
|
alt t {
|
||||||
|
|
|
@ -1,47 +1,22 @@
|
||||||
import syntax::ast;
|
import syntax::{ast, ast_util};
|
||||||
import syntax::ast_util;
|
import ast::{mutability, spanned};
|
||||||
import ast::mutability;
|
import syntax::ast_util::{local_def, respan};
|
||||||
import syntax::ast_util::local_def;
|
|
||||||
import syntax::ast_util::respan;
|
|
||||||
import ast::spanned;
|
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
import metadata::csearch;
|
import metadata::csearch;
|
||||||
import driver::session;
|
import driver::session;
|
||||||
import util::common;
|
import util::common;
|
||||||
import util::common::*;
|
import util::common::*;
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
import std::map::new_int_hash;
|
|
||||||
import std::map::new_str_hash;
|
|
||||||
import middle::ty;
|
import middle::ty;
|
||||||
import middle::ty::node_id_to_type;
|
import middle::ty::{node_id_to_type, arg, bind_params_in_type, block_ty,
|
||||||
import middle::ty::arg;
|
expr_ty, field, method, node_type_table, pat_ty,
|
||||||
import middle::ty::bind_params_in_type;
|
ty_param_substs_opt_and_ty, ty_param_kinds_and_ty,
|
||||||
import middle::ty::block_ty;
|
ty_nil};
|
||||||
import middle::ty::expr_ty;
|
|
||||||
import middle::ty::field;
|
|
||||||
import middle::ty::method;
|
|
||||||
import middle::ty::node_type_table;
|
|
||||||
import middle::ty::pat_ty;
|
|
||||||
import middle::ty::ty_param_substs_opt_and_ty;
|
|
||||||
import util::ppaux::ty_to_str;
|
import util::ppaux::ty_to_str;
|
||||||
import middle::ty::ty_param_kinds_and_ty;
|
import middle::ty::unify::{ures_ok, ures_err, fixup_result, fix_ok, fix_err};
|
||||||
import middle::ty::ty_nil;
|
import std::{int, vec, str, uint, map, option, smallintmap};
|
||||||
import middle::ty::unify::ures_ok;
|
import std::map::{hashmap, new_int_hash, new_str_hash};
|
||||||
import middle::ty::unify::ures_err;
|
import std::option::{none, some, from_maybe};
|
||||||
import middle::ty::unify::fixup_result;
|
|
||||||
import middle::ty::unify::fix_ok;
|
|
||||||
import middle::ty::unify::fix_err;
|
|
||||||
import std::int;
|
|
||||||
import std::vec;
|
|
||||||
import std::str;
|
|
||||||
import std::uint;
|
|
||||||
import std::map;
|
|
||||||
import std::map::hashmap;
|
|
||||||
import std::option;
|
|
||||||
import std::option::none;
|
|
||||||
import std::option::some;
|
|
||||||
import std::option::from_maybe;
|
|
||||||
import std::smallintmap;
|
|
||||||
import middle::tstate::ann::ts_ann;
|
import middle::tstate::ann::ts_ann;
|
||||||
import syntax::print::pprust::*;
|
import syntax::print::pprust::*;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
// The Rust abstract syntax tree.
|
// The Rust abstract syntax tree.
|
||||||
|
|
||||||
import std::option;
|
import std::option;
|
||||||
import codemap::span;
|
import codemap::{span, filename};
|
||||||
import codemap::filename;
|
|
||||||
|
|
||||||
type spanned<T> = {node: T, span: span};
|
type spanned<T> = {node: T, span: span};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import std::str;
|
import std::{str, option};
|
||||||
import std::option;
|
|
||||||
import codemap::span;
|
import codemap::span;
|
||||||
import ast::*;
|
import ast::*;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
import std::vec;
|
import std::{vec, uint, str, term, io, option};
|
||||||
import std::uint;
|
import std::option::{some, none};
|
||||||
import std::str;
|
|
||||||
import std::term;
|
|
||||||
import std::io;
|
|
||||||
import std::option;
|
|
||||||
import std::option::some;
|
|
||||||
import std::option::none;
|
|
||||||
|
|
||||||
type filename = str;
|
type filename = str;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import std::str;
|
import std::{str, vec, option};
|
||||||
import std::vec;
|
|
||||||
import std::option;
|
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
import driver::session::session;
|
import driver::session::session;
|
||||||
import codemap::span;
|
import codemap::span;
|
||||||
|
|
|
@ -4,10 +4,7 @@
|
||||||
* should all get sucked into either the compiler syntax extension plugin
|
* should all get sucked into either the compiler syntax extension plugin
|
||||||
* interface.
|
* interface.
|
||||||
*/
|
*/
|
||||||
import std::vec;
|
import std::{vec, str, option, generic_os};
|
||||||
import std::str;
|
|
||||||
import std::option;
|
|
||||||
import std::generic_os;
|
|
||||||
import base::*;
|
import base::*;
|
||||||
export expand_syntax_ext;
|
export expand_syntax_ext;
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
import driver::session;
|
import driver::session;
|
||||||
|
|
||||||
import std::option::none;
|
import std::option::{none, some};
|
||||||
import std::option::some;
|
|
||||||
|
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
import std::vec;
|
import std::{vec, str};
|
||||||
import std::str;
|
|
||||||
|
|
||||||
import syntax::ast::crate;
|
import syntax::ast::{crate, expr_, expr_mac, mac_invoc};
|
||||||
import syntax::ast::expr_;
|
|
||||||
import syntax::ast::expr_mac;
|
|
||||||
import syntax::ast::mac_invoc;
|
|
||||||
import syntax::fold::*;
|
import syntax::fold::*;
|
||||||
import syntax::ext::base::*;
|
import syntax::ext::base::*;
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,8 @@
|
||||||
* should all get sucked into either the standard library extfmt module or the
|
* should all get sucked into either the standard library extfmt module or the
|
||||||
* compiler syntax extension plugin interface.
|
* compiler syntax extension plugin interface.
|
||||||
*/
|
*/
|
||||||
import std::vec;
|
import std::{vec, str, option};
|
||||||
import std::str;
|
import std::option::{none, some};
|
||||||
import std::option;
|
|
||||||
import std::option::none;
|
|
||||||
import std::option::some;
|
|
||||||
import std::extfmt::ct::*;
|
import std::extfmt::ct::*;
|
||||||
import base::*;
|
import base::*;
|
||||||
import codemap::span;
|
import codemap::span;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import std::vec;
|
import std::{vec, str, option};
|
||||||
import std::str;
|
|
||||||
import std::option;
|
|
||||||
import base::*;
|
import base::*;
|
||||||
import syntax::ast;
|
import syntax::ast;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import std::option;
|
import std::{str, option};
|
||||||
import base::*;
|
import base::*;
|
||||||
import syntax::ast;
|
import syntax::ast;
|
||||||
import std::str;
|
|
||||||
|
|
||||||
fn expand_syntax_ext(cx: ext_ctxt, sp: codemap::span, arg: @ast::expr,
|
fn expand_syntax_ext(cx: ext_ctxt, sp: codemap::span, arg: @ast::expr,
|
||||||
_body: option::t<str>) -> @ast::expr {
|
_body: option::t<str>) -> @ast::expr {
|
||||||
|
|
|
@ -1,35 +1,17 @@
|
||||||
use std;
|
use std;
|
||||||
|
|
||||||
import codemap::span;
|
import codemap::span;
|
||||||
import std::vec;
|
import std::{vec, str, option};
|
||||||
import std::str;
|
import std::map::{hashmap, new_str_hash};
|
||||||
import std::option;
|
import option::{some, none};
|
||||||
import std::map::hashmap;
|
|
||||||
import std::map::new_str_hash;
|
|
||||||
import option::some;
|
|
||||||
import option::none;
|
|
||||||
|
|
||||||
import base::syntax_extension;
|
import base::{syntax_extension, ext_ctxt, normal,
|
||||||
import base::ext_ctxt;
|
expr_to_str, expr_to_ident};
|
||||||
import base::normal;
|
|
||||||
import base::expr_to_str;
|
|
||||||
import base::expr_to_ident;
|
|
||||||
|
|
||||||
import fold::*;
|
import fold::*;
|
||||||
import ast::node_id;
|
|
||||||
import ast_util::respan;
|
import ast_util::respan;
|
||||||
import ast::ident;
|
import ast::{ident, path, ty, blk, blk_, expr, expr_, path_, expr_path,
|
||||||
import ast::path;
|
expr_vec, expr_mac, mac_invoc, node_id};
|
||||||
import ast::ty;
|
|
||||||
import ast::blk;
|
|
||||||
import ast::blk_;
|
|
||||||
import ast::expr;
|
|
||||||
import ast::expr_;
|
|
||||||
import ast::path_;
|
|
||||||
import ast::expr_path;
|
|
||||||
import ast::expr_vec;
|
|
||||||
import ast::expr_mac;
|
|
||||||
import ast::mac_invoc;
|
|
||||||
|
|
||||||
export add_new_extension;
|
export add_new_extension;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import syntax::codemap::span;
|
import syntax::codemap::span;
|
||||||
import ast::*;
|
import ast::*;
|
||||||
|
|
||||||
import std::vec;
|
import std::{vec, option};
|
||||||
import std::option;
|
|
||||||
|
|
||||||
export ast_fold_precursor;
|
export ast_fold_precursor;
|
||||||
export ast_fold;
|
export ast_fold;
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
|
|
||||||
import std::str;
|
import std::{str, option};
|
||||||
import std::option;
|
import std::option::{some, none};
|
||||||
import std::option::some;
|
|
||||||
import std::option::none;
|
|
||||||
import syntax::ast;
|
import syntax::ast;
|
||||||
import syntax::parse::token;
|
import syntax::parse::token;
|
||||||
import syntax::parse::parser::parser;
|
import syntax::parse::parser::{parser, new_parser_from_file,
|
||||||
import syntax::parse::parser::new_parser_from_file;
|
parse_inner_attrs_and_next,
|
||||||
import syntax::parse::parser::parse_inner_attrs_and_next;
|
parse_mod_items, SOURCE_FILE};
|
||||||
import syntax::parse::parser::parse_mod_items;
|
|
||||||
import syntax::parse::parser::SOURCE_FILE;
|
|
||||||
|
|
||||||
export eval_crate_directives_to_mod;
|
export eval_crate_directives_to_mod;
|
||||||
export mode_parse;
|
export mode_parse;
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
|
|
||||||
import std::io;
|
import std::{io, int, vec, str, map, option};
|
||||||
import std::int;
|
|
||||||
import std::vec;
|
|
||||||
import std::str;
|
|
||||||
import std::map;
|
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
import std::option;
|
import std::option::{some, none};
|
||||||
import std::option::some;
|
|
||||||
import std::option::none;
|
|
||||||
import util::interner;
|
import util::interner;
|
||||||
import util::interner::intern;
|
import util::interner::intern;
|
||||||
import codemap;
|
import codemap;
|
||||||
|
|
|
@ -1,21 +1,13 @@
|
||||||
|
|
||||||
import std::io;
|
import std::{io, vec, str, option, either};
|
||||||
import std::vec;
|
import std::option::{some, none};
|
||||||
import std::str;
|
import std::either::{left, right};
|
||||||
import std::option;
|
import std::map::{hashmap, new_str_hash};
|
||||||
import std::option::some;
|
|
||||||
import std::option::none;
|
|
||||||
import std::either;
|
|
||||||
import std::either::left;
|
|
||||||
import std::either::right;
|
|
||||||
import std::map::hashmap;
|
|
||||||
import token::can_begin_expr;
|
import token::can_begin_expr;
|
||||||
import ex = ext::base;
|
import ex = ext::base;
|
||||||
import codemap::span;
|
import codemap::span;
|
||||||
import std::map::new_str_hash;
|
|
||||||
import util::interner;
|
import util::interner;
|
||||||
import ast::node_id;
|
import ast::{node_id, spanned};
|
||||||
import ast::spanned;
|
|
||||||
|
|
||||||
tag restriction { UNRESTRICTED; RESTRICT_NO_CALL_EXPRS; }
|
tag restriction { UNRESTRICTED; RESTRICT_NO_CALL_EXPRS; }
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,7 @@ import ast::ty_mach;
|
||||||
import ast_util::ty_mach_to_str;
|
import ast_util::ty_mach_to_str;
|
||||||
import std::map::new_str_hash;
|
import std::map::new_str_hash;
|
||||||
import util::interner;
|
import util::interner;
|
||||||
import std::int;
|
import std::{int, uint, str};
|
||||||
import std::uint;
|
|
||||||
import std::str;
|
|
||||||
|
|
||||||
type str_num = uint;
|
type str_num = uint;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
import std::io;
|
import std::{io, vec, str};
|
||||||
import std::vec;
|
|
||||||
import std::str;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This pretty-printer is a direct reimplementation of Philip Karlton's
|
* This pretty-printer is a direct reimplementation of Philip Karlton's
|
||||||
|
|
|
@ -1,29 +1,14 @@
|
||||||
|
|
||||||
import std::vec;
|
import std::{vec, int, io, str, uint, option};
|
||||||
import std::int;
|
|
||||||
import std::io;
|
|
||||||
import std::str;
|
|
||||||
import std::uint;
|
|
||||||
import std::option;
|
|
||||||
import parse::lexer;
|
import parse::lexer;
|
||||||
import syntax::codemap::codemap;
|
import syntax::codemap::codemap;
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
import ast;
|
import ast;
|
||||||
import ast_util;
|
import ast_util;
|
||||||
import option::some;
|
import option::{some, none};
|
||||||
import option::none;
|
import pp::{printer, break_offset, word, huge_word, zero_word,
|
||||||
import pp::printer;
|
space, zerobreak, hardbreak, breaks, consistent,
|
||||||
import pp::break_offset;
|
inconsistent, eof};
|
||||||
import pp::word;
|
|
||||||
import pp::huge_word;
|
|
||||||
import pp::zero_word;
|
|
||||||
import pp::space;
|
|
||||||
import pp::zerobreak;
|
|
||||||
import pp::hardbreak;
|
|
||||||
import pp::breaks;
|
|
||||||
import pp::consistent;
|
|
||||||
import pp::inconsistent;
|
|
||||||
import pp::eof;
|
|
||||||
|
|
||||||
// The ps is stored here to prevent recursive type.
|
// The ps is stored here to prevent recursive type.
|
||||||
// FIXME use a nominal tag instead
|
// FIXME use a nominal tag instead
|
||||||
|
|
|
@ -1,14 +1,9 @@
|
||||||
// An "interner" is a data structure that associates values with uint tags and
|
// An "interner" is a data structure that associates values with uint tags and
|
||||||
// allows bidirectional lookup; i.e. given a value, one can easily find the
|
// allows bidirectional lookup; i.e. given a value, one can easily find the
|
||||||
// type, and vice versa.
|
// type, and vice versa.
|
||||||
import std::vec;
|
import std::{vec, map, option};
|
||||||
import std::map;
|
import std::map::{hashmap, hashfn, eqfn};
|
||||||
import std::map::hashmap;
|
import std::option::{none, some};
|
||||||
import std::map::hashfn;
|
|
||||||
import std::map::eqfn;
|
|
||||||
import std::option;
|
|
||||||
import std::option::none;
|
|
||||||
import std::option::some;
|
|
||||||
|
|
||||||
type interner<T> =
|
type interner<T> =
|
||||||
{map: hashmap<T, uint>,
|
{map: hashmap<T, uint>,
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
|
|
||||||
import ast::*;
|
import ast::*;
|
||||||
import std::option;
|
import std::option;
|
||||||
import std::option::some;
|
import std::option::{none, some};
|
||||||
import std::option::none;
|
|
||||||
import codemap::span;
|
import codemap::span;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,14 @@
|
||||||
import std::str;
|
import std::{str, map, uint, int, option};
|
||||||
import std::map;
|
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
import std::uint;
|
import std::option::{none, some};
|
||||||
import std::int;
|
|
||||||
import std::option;
|
|
||||||
import std::option::none;
|
|
||||||
import std::option::some;
|
|
||||||
import syntax::ast;
|
import syntax::ast;
|
||||||
import ast::ty;
|
import ast::{ty, pat, lit, path};
|
||||||
import ast::pat;
|
import syntax::codemap::{codemap, span};
|
||||||
import syntax::codemap::codemap;
|
|
||||||
import syntax::codemap::span;
|
|
||||||
import ast::lit;
|
|
||||||
import ast::path;
|
|
||||||
import syntax::visit;
|
import syntax::visit;
|
||||||
import std::io::stdout;
|
import std::io::{stdout, str_writer, string_writer};
|
||||||
import std::io::str_writer;
|
|
||||||
import std::io::string_writer;
|
|
||||||
import syntax::print;
|
import syntax::print;
|
||||||
import print::pprust::print_block;
|
import print::pprust::{print_block, print_item, print_expr, print_path,
|
||||||
import print::pprust::print_item;
|
print_decl, print_fn, print_type, print_literal};
|
||||||
import print::pprust::print_expr;
|
|
||||||
import print::pprust::print_path;
|
|
||||||
import print::pprust::print_decl;
|
|
||||||
import print::pprust::print_fn;
|
|
||||||
import print::pprust::print_type;
|
|
||||||
import print::pprust::print_literal;
|
|
||||||
import print::pp::mk_printer;
|
import print::pp::mk_printer;
|
||||||
|
|
||||||
type flag = hashmap<str, ()>;
|
type flag = hashmap<str, ()>;
|
||||||
|
|
|
@ -1,21 +1,11 @@
|
||||||
import std::vec;
|
import std::{vec, str, int, option};
|
||||||
import std::str;
|
import std::option::{none, some};
|
||||||
import std::int;
|
|
||||||
import std::option;
|
|
||||||
import std::option::none;
|
|
||||||
import std::option::some;
|
|
||||||
import middle::ty;
|
import middle::ty;
|
||||||
import middle::ty::*;
|
import middle::ty::*;
|
||||||
import metadata::encoder;
|
import metadata::encoder;
|
||||||
import syntax::print::pp;
|
import syntax::print::{pp, pprust};
|
||||||
import syntax::print::pprust;
|
import syntax::print::pprust::{path_to_str, constr_args_to_str, proto_to_str};
|
||||||
import syntax::print::pprust::path_to_str;
|
import pp::{word, eof, zerobreak, hardbreak};
|
||||||
import syntax::print::pprust::constr_args_to_str;
|
|
||||||
import syntax::print::pprust::proto_to_str;
|
|
||||||
import pp::word;
|
|
||||||
import pp::eof;
|
|
||||||
import pp::zerobreak;
|
|
||||||
import pp::hardbreak;
|
|
||||||
import syntax::ast_util::ty_mach_to_str;
|
import syntax::ast_util::ty_mach_to_str;
|
||||||
import syntax::ast;
|
import syntax::ast;
|
||||||
import middle::ast_map;
|
import middle::ast_map;
|
||||||
|
|
|
@ -1,22 +1,11 @@
|
||||||
use std;
|
use std;
|
||||||
use rustc;
|
use rustc;
|
||||||
|
|
||||||
import std::fs;
|
import std::{fs, io, getopts, vec, str, uint, option};
|
||||||
import std::getopts;
|
import std::getopts::{optopt, opt_present, opt_str};
|
||||||
import std::getopts::optopt;
|
|
||||||
import std::getopts::opt_present;
|
|
||||||
import std::getopts::opt_str;
|
|
||||||
import std::io;
|
|
||||||
import std::io::stdout;
|
import std::io::stdout;
|
||||||
import std::vec;
|
|
||||||
import std::str;
|
|
||||||
import std::uint;
|
|
||||||
import std::option;
|
|
||||||
|
|
||||||
import rustc::syntax::ast;
|
import rustc::syntax::{ast, fold, visit, codemap};
|
||||||
import rustc::syntax::fold;
|
|
||||||
import rustc::syntax::visit;
|
|
||||||
import rustc::syntax::codemap;
|
|
||||||
import rustc::syntax::parse::parser;
|
import rustc::syntax::parse::parser;
|
||||||
import rustc::syntax::print::pprust;
|
import rustc::syntax::print::pprust;
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,7 @@ import task;
|
||||||
import vec;
|
import vec;
|
||||||
|
|
||||||
import comm;
|
import comm;
|
||||||
import comm::chan;
|
import comm::{chan, port, send, recv};
|
||||||
import comm::port;
|
|
||||||
import comm::send;
|
|
||||||
import comm::recv;
|
|
||||||
import net;
|
import net;
|
||||||
|
|
||||||
native "rust" mod rustrt {
|
native "rust" mod rustrt {
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
// Simple Extensible Binary Markup Language (ebml) reader and writer on a
|
// Simple Extensible Binary Markup Language (ebml) reader and writer on a
|
||||||
// cursor model. See the specification here:
|
// cursor model. See the specification here:
|
||||||
// http://www.matroska.org/technical/specs/rfc/index.html
|
// http://www.matroska.org/technical/specs/rfc/index.html
|
||||||
import option::none;
|
import option::{some, none};
|
||||||
import option::some;
|
|
||||||
|
|
||||||
type ebml_tag = {id: uint, size: uint};
|
type ebml_tag = {id: uint, size: uint};
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
import option;
|
import option;
|
||||||
import option::some;
|
import option::{some, none};
|
||||||
import option::none;
|
|
||||||
|
|
||||||
tag t<T, U> { left(T); right(U); }
|
tag t<T, U> { left(T); right(U); }
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,7 @@
|
||||||
* we also only support translating-to-rust a tiny subset of the possible
|
* we also only support translating-to-rust a tiny subset of the possible
|
||||||
* combinations at the moment.
|
* combinations at the moment.
|
||||||
*/
|
*/
|
||||||
import option::none;
|
import option::{some, none};
|
||||||
import option::some;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -10,8 +10,7 @@ of features.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import option::some;
|
import option::{some, none};
|
||||||
import option::none;
|
|
||||||
import option = option::t;
|
import option = option::t;
|
||||||
|
|
||||||
export treemap;
|
export treemap;
|
||||||
|
|
|
@ -8,8 +8,7 @@
|
||||||
* is what you expect. Use opt_* accessors (bottom of the file) to get
|
* is what you expect. Use opt_* accessors (bottom of the file) to get
|
||||||
* argument values out of the match object.
|
* argument values out of the match object.
|
||||||
*/
|
*/
|
||||||
import option::some;
|
import option::{some, none};
|
||||||
import option::none;
|
|
||||||
export opt;
|
export opt;
|
||||||
export reqopt;
|
export reqopt;
|
||||||
export optopt;
|
export optopt;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import option::some;
|
import option::{some, none};
|
||||||
import option::none;
|
|
||||||
|
|
||||||
tag list<T> { cons(T, @list<T>); nil; }
|
tag list<T> { cons(T, @list<T>); nil; }
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
import comm::port;
|
import comm::{port, chan, send, recv};
|
||||||
import comm::chan;
|
|
||||||
import comm::send;
|
|
||||||
import comm::recv;
|
|
||||||
|
|
||||||
import net;
|
import net;
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
/// A simple map based on a vector for small integer keys. Space requirements
|
/// A simple map based on a vector for small integer keys. Space requirements
|
||||||
/// are O(highest integer key).
|
/// are O(highest integer key).
|
||||||
import option::none;
|
import option::{some, none};
|
||||||
import option::some;
|
|
||||||
|
|
||||||
// FIXME: Should not be @; there's a bug somewhere in rustc that requires this
|
// FIXME: Should not be @; there's a bug somewhere in rustc that requires this
|
||||||
// to be.
|
// to be.
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
import vec::len;
|
import vec::{len, slice};
|
||||||
import vec::slice;
|
|
||||||
|
|
||||||
export merge_sort;
|
export merge_sort;
|
||||||
export quick_sort;
|
export quick_sort;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import cast = unsafe::reinterpret_cast;
|
import cast = unsafe::reinterpret_cast;
|
||||||
import comm;
|
import comm;
|
||||||
import option::some;
|
import option::{some, none};
|
||||||
import option::none;
|
|
||||||
import option = option::t;
|
import option = option::t;
|
||||||
import ptr;
|
import ptr;
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,7 @@ red-black tree or something else.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import option::some;
|
import option::{some, none};
|
||||||
import option::none;
|
|
||||||
import option = option::t;
|
import option = option::t;
|
||||||
|
|
||||||
export treemap;
|
export treemap;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
import option::none;
|
import option::{some, none};
|
||||||
import option::some;
|
|
||||||
|
|
||||||
|
|
||||||
// A very naive implementation of union-find with unsigned integer nodes.
|
// A very naive implementation of union-find with unsigned integer nodes.
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// Interior vector utility functions.
|
// Interior vector utility functions.
|
||||||
|
|
||||||
import option::none;
|
import option::{some, none};
|
||||||
import option::some;
|
|
||||||
import uint::next_power_of_two;
|
import uint::next_power_of_two;
|
||||||
import ptr::addr_of;
|
import ptr::addr_of;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue