diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-11-18 15:55:03 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-11-18 18:09:41 -0800 |
| commit | 371be3c6c4c9be74ee224f74f41006fefa3dda1b (patch) | |
| tree | 94041ca601657165557c6e8dd362697986947bc1 /src/libsyntax/parse | |
| parent | 74b2e9979738ce413209aa4342fc35afe68c68de (diff) | |
| download | rust-371be3c6c4c9be74ee224f74f41006fefa3dda1b.tar.gz rust-371be3c6c4c9be74ee224f74f41006fefa3dda1b.zip | |
Remove unused file_type enum from the parser
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/eval.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 9 |
2 files changed, 4 insertions, 11 deletions
diff --git a/src/libsyntax/parse/eval.rs b/src/libsyntax/parse/eval.rs index 1873a346270..78a47ec09c7 100644 --- a/src/libsyntax/parse/eval.rs +++ b/src/libsyntax/parse/eval.rs @@ -1,4 +1,4 @@ -use parser::{Parser, SOURCE_FILE}; +use parser::Parser; use attr::parser_attr; use ast_util::mk_sp; use codemap::span; @@ -67,7 +67,7 @@ fn parse_companion_mod(cx: ctx, prefix: &Path, suffix: &Option<Path>) debug!("found companion mod"); // XXX: Using a dummy span, but this code will go away soon let p0 = new_sub_parser_from_file(cx.sess, cx.cfg, - modpath, SOURCE_FILE, + modpath, ast_util::dummy_sp()); let inner_attrs = p0.parse_inner_attrs_and_next(); let m0 = p0.parse_mod_items(token::EOF, inner_attrs.next); @@ -96,7 +96,7 @@ fn eval_src_mod(cx: ctx, prefix: &Path, id: ast::ident, }; let p0 = new_sub_parser_from_file(cx.sess, cx.cfg, - &full_path, SOURCE_FILE, sp); + &full_path, sp); let inner_attrs = p0.parse_inner_attrs_and_next(); let mod_attrs = vec::append(outer_attrs, inner_attrs.inner); let first_item_outer_attrs = inner_attrs.next; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 9d71f83b28d..f49447215fe 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -70,10 +70,7 @@ use ast::{_mod, add, arg, arm, attribute, expr_vstore_fixed, expr_vstore_slice, expr_vstore_box, expr_vstore_uniq, TyFn, Onceness, Once, Many}; -export file_type; export Parser; -export CRATE_FILE; -export SOURCE_FILE; // FIXME (#3726): #ast expects to find this here but it's actually // defined in `parse` Fixing this will be easier when we have export @@ -92,8 +89,6 @@ enum restriction { RESTRICT_NO_BAR_OR_DOUBLEBAR_OP, } -enum file_type { CRATE_FILE, SOURCE_FILE, } - enum class_member { field_member(@struct_field), method_member(@method) @@ -180,7 +175,7 @@ pure fn maybe_append(+lhs: ~[attribute], rhs: Option<~[attribute]>) /* ident is handled by common.rs */ fn Parser(sess: parse_sess, cfg: ast::crate_cfg, - +rdr: reader, ftype: file_type) -> Parser { + +rdr: reader) -> Parser { let tok0 = rdr.next_token(); let span0 = tok0.sp; @@ -191,7 +186,6 @@ fn Parser(sess: parse_sess, cfg: ast::crate_cfg, interner: move interner, sess: sess, cfg: cfg, - file_type: ftype, token: tok0.tok, span: span0, last_span: span0, @@ -210,7 +204,6 @@ fn Parser(sess: parse_sess, cfg: ast::crate_cfg, struct Parser { sess: parse_sess, cfg: crate_cfg, - file_type: file_type, mut token: token::Token, mut span: span, mut last_span: span, |
