diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-04-19 14:26:45 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-04-19 15:30:58 -0700 |
| commit | 030404c793cd20bf8b7eb11f91f3f0f8010bf52a (patch) | |
| tree | 37a8b0669b65d3a4dccd105d348abffeeeb50f58 /src/librustsyntax | |
| parent | e6b5b4827b6110f7cf72e57b9167ead2ee152ee3 (diff) | |
| download | rust-030404c793cd20bf8b7eb11f91f3f0f8010bf52a.tar.gz rust-030404c793cd20bf8b7eb11f91f3f0f8010bf52a.zip | |
Cleanup FIXMEs in syntax::ext::qquote
Inline some one-off functions, add an error message, annotate a FIXME
Diffstat (limited to 'src/librustsyntax')
| -rw-r--r-- | src/librustsyntax/ext/qquote.rs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/librustsyntax/ext/qquote.rs b/src/librustsyntax/ext/qquote.rs index f95c902cb6d..e625ba55fed 100644 --- a/src/librustsyntax/ext/qquote.rs +++ b/src/librustsyntax/ext/qquote.rs @@ -96,13 +96,15 @@ impl of qq_helper for @ast::pat { fn gather_anti_quotes<N: qq_helper>(lo: uint, node: N) -> aq_ctxt { - let v = @{visit_expr: visit_aq_expr, - visit_ty: visit_aq_ty + let v = @{visit_expr: {|node, &&cx, v| + visit_aq(node, "from_expr", cx, v)}, + visit_ty: {|node, &&cx, v| + visit_aq(node, "from_ty", cx, v)} with *default_visitor()}; let cx = @{lo:lo, mut gather: []}; node.visit(cx, mk_vt(v)); // FIXME: Maybe this is an overkill (merge_sort), it might be better - // to just keep the gather array in sorted order ... + // to just keep the gather array in sorted order ... (Issue #2250) cx.gather = std::sort::merge_sort({|a,b| a.lo < b.lo}, copy cx.gather); ret cx; } @@ -117,14 +119,6 @@ fn visit_aq<T:qq_helper>(node: T, constr: str, &&cx: aq_ctxt, v: vt<aq_ctxt>) _ {node.visit(cx, v);} } } -// FIXME: these are only here because I (kevina) couldn't figure out how to -// get bind to work in gather_anti_quotes -fn visit_aq_expr(node: @ast::expr, &&cx: aq_ctxt, v: vt<aq_ctxt>) { - visit_aq(node,"from_expr",cx,v); -} -fn visit_aq_ty(node: @ast::ty, &&cx: aq_ctxt, v: vt<aq_ctxt>) { - visit_aq(node,"from_ty",cx,v); -} fn is_space(c: char) -> bool { parse::lexer::is_whitespace(c) @@ -180,8 +174,8 @@ fn parse_stmt(p: parser) -> @ast::stmt { fn parse_item(p: parser) -> @ast::item { alt (parser::parse_item(p, [])) { - some(item) {item} - none {fail; /* FIXME: Error message, somehow */} + some(item) { item } + none { fail "parse_item: parsing an item failed"; } } } |
