diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2011-06-16 16:55:46 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-06-16 16:55:46 -0700 |
| commit | b84fffaa4e0e672b4653a7832d75a2dc120040aa (patch) | |
| tree | ad8e6854d11f6627b7afc9b8d14f525580beff55 /src/comp/front | |
| parent | eb9969f54699924e4373f6c447aaeb4dd041b0dd (diff) | |
Reformat a bunch of recent churn.
Diffstat (limited to 'src/comp/front')
| -rw-r--r-- | src/comp/front/ast.rs | 43 | ||||
| -rw-r--r-- | src/comp/front/creader.rs | 3 | ||||
| -rw-r--r-- | src/comp/front/eval.rs | 10 | ||||
| -rw-r--r-- | src/comp/front/lexer.rs | 2 |
4 files changed, 32 insertions, 26 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index b07d3d9fd80..303c8b2909c 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -245,13 +245,16 @@ tag expr_ { expr_alt(@expr, vec[arm], ann); expr_fn(_fn, ann); expr_block(block, ann); - expr_move(@expr /* TODO: @expr|is_lval */, @expr, ann); - expr_assign(@expr /* TODO: @expr|is_lval */, @expr, ann); - expr_swap(@expr /* TODO: @expr|is_lval */, - @expr /* TODO: @expr|is_lval */, ann); - expr_assign_op(binop, @expr /* TODO: @expr|is_lval */, @expr, ann); - expr_send(@expr /* TODO: @expr|is_lval */, @expr, ann); - expr_recv(@expr /* TODO: @expr|is_lval */, @expr, ann); + /* + * FIXME: many of these @exprs should be constrained with + * is_lval once we have constrained types working. + */ + expr_move(@expr, @expr, ann); + expr_assign(@expr,@expr, ann); + expr_swap(@expr, @expr, ann); + expr_assign_op(binop, @expr, @expr, ann); + expr_send(@expr, @expr, ann); + expr_recv(@expr, @expr, ann); expr_field(@expr, ident, ann); expr_index(@expr, @expr, ann); expr_path(path, ann); @@ -366,16 +369,14 @@ type constr_arg = constr_arg_general[uint]; type constr_arg_general[T] = spanned[constr_arg_general_[T]]; -type constr_ = rec(path path, - vec[@constr_arg_general[uint]] args, - ann ann); +type constr_ = rec(path path, vec[@constr_arg_general[uint]] args, ann ann); type constr = spanned[constr_]; + /* The parser generates ast::constrs; resolve generates a mapping from each function to a list of ty::constr_defs, corresponding to these. */ - type arg = rec(mode mode, @ty ty, ident ident, def_id id); type fn_decl = @@ -464,12 +465,14 @@ tag attr_style { attr_outer; attr_inner; } type attribute_ = rec(attr_style style, meta_item value); -type item = rec(ident ident, - vec[attribute] attrs, - def_id id, // For objs, this is the type def_id - ann ann, - item_ node, - span span); +type item = + rec(ident ident, + vec[attribute] attrs, + def_id id, // For objs, this is the type def_id + + ann ann, + item_ node, + span span); tag item_ { item_const(@ty, @expr); @@ -478,7 +481,9 @@ tag item_ { item_native_mod(native_mod); item_ty(@ty, vec[ty_param]); item_tag(vec[variant], vec[ty_param]); - item_obj(_obj, vec[ty_param], def_id /* constructor id */); + item_obj(_obj, vec[ty_param], def_id); + /* constructor id */ + } type native_item = spanned[native_item_]; @@ -521,9 +526,9 @@ fn is_exported(ident i, _mod m) -> bool { case (_) {/* fall through */ } } } - // If there are no declared exports then // everything not imported is exported + ret count == 0u && !nonlocal; } diff --git a/src/comp/front/creader.rs b/src/comp/front/creader.rs index 98004bf6961..09f90befa12 100644 --- a/src/comp/front/creader.rs +++ b/src/comp/front/creader.rs @@ -478,8 +478,7 @@ fn tag_variant_ids(&ebml::doc item, int this_cnum) -> vec[ast::def_id] { fn get_metadata_section(str filename) -> option::t[vec[u8]] { auto b = str::buf(filename); - auto mb = - llvm::LLVMRustCreateMemoryBufferWithContentsOfFile(b); + auto mb = llvm::LLVMRustCreateMemoryBufferWithContentsOfFile(b); if (mb as int == 0) { ret option::none[vec[u8]]; } auto of = mk_object_file(mb); auto si = mk_section_iter(of.llof); diff --git a/src/comp/front/eval.rs b/src/comp/front/eval.rs index 44a6e1abb5d..9c1fad981ae 100644 --- a/src/comp/front/eval.rs +++ b/src/comp/front/eval.rs @@ -294,8 +294,9 @@ fn eval_crate_directive(ctx cx, env e, @ast::crate_directive cdir, str prefix, cx.p.set_def(next_id._1); cx.chpos = p0.get_chpos(); cx.next_ann = p0.next_ann_num(); - auto i = front::parser::mk_item(cx.p, cdir.span.lo, cdir.span.hi, - id, ast::item_mod(m0), []); + auto i = + front::parser::mk_item(cx.p, cdir.span.lo, cdir.span.hi, id, + ast::item_mod(m0), []); vec::push[@ast::item](items, i); } case (ast::cdir_dir_mod(?id, ?dir_opt, ?cdirs)) { @@ -303,8 +304,9 @@ fn eval_crate_directive(ctx cx, env e, @ast::crate_directive cdir, str prefix, alt (dir_opt) { case (some(?d)) { path = d; } case (none) { } } auto full_path = prefix + std::fs::path_sep() + path; auto m0 = eval_crate_directives_to_mod(cx, e, cdirs, full_path); - auto i = front::parser::mk_item - (cx.p, cdir.span.lo, cdir.span.hi, id, ast::item_mod(m0), []); + auto i = + front::parser::mk_item(cx.p, cdir.span.lo, cdir.span.hi, id, + ast::item_mod(m0), []); vec::push[@ast::item](items, i); } case (ast::cdir_view_item(?vi)) { diff --git a/src/comp/front/lexer.rs b/src/comp/front/lexer.rs index 89b7d76e08b..9ae3afad0c6 100644 --- a/src/comp/front/lexer.rs +++ b/src/comp/front/lexer.rs @@ -281,7 +281,7 @@ fn scan_number(char c, &reader rdr) -> token::token { rdr.bump(); ret token::LIT_MACH_FLOAT(util::common::ty_f64, intern(*rdr.get_interner(), - float_str)); + float_str)); /* FIXME: if this is out of range for either a 32-bit or 64-bit float, it won't be noticed till the back-end */ |
