Skip to content

Commit e68cc7d

Browse files
kevinabrson
authored andcommitted
---
yaml --- r: 8086 b: refs/heads/snap-stage3 c: 1d855eb h: refs/heads/master v: v3
1 parent ae363de commit e68cc7d

File tree

11 files changed

+6
-30
lines changed

11 files changed

+6
-30
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 2898dcc5d97da9427ac367542382b6239d9c0bbf
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 91b6dc5c8ed8d839006de4ea6a7e8cd6727db93d
4+
refs/heads/snap-stage3: 1d855ebc510855536beee418036b405cfa05808e
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/snap-stage3/src/comp/syntax/ast.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ enum mac_ {
293293
mac_embed_block(blk),
294294
mac_ellipsis,
295295
// the span is used by the quoter/anti-quoter ...
296-
mac_qq(span /* span of expr */, @expr), // quasi-quote
297296
mac_aq(span /* span of quote */, @expr), // anti-quote
298297
mac_var(uint)
299298
}

branches/snap-stage3/src/comp/syntax/ext/expand.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import option::{none, some};
55
import std::map::hashmap;
66
import vec;
77

8-
import syntax::ast::{crate, expr_, expr_mac, mac_invoc, mac_qq};
8+
import syntax::ast::{crate, expr_, expr_mac, mac_invoc};
99
import syntax::fold::*;
1010
import syntax::ext::base::*;
1111
import syntax::ext::qquote::{expand_qquote,qq_helper};
@@ -46,13 +46,6 @@ fn expand_expr(exts: hashmap<str, syntax_extension>, cx: ext_ctxt,
4646
}
4747
}
4848
}
49-
mac_qq(sp, exp) {
50-
let r = expand_qquote(cx, sp, none, exp);
51-
// need to keep going, resuls may contain embedded qquote or
52-
// macro that need expanding
53-
let r2 = fld.fold_expr(r);
54-
(r2.node, s)
55-
}
5649
_ { cx.span_bug(mac.span, "naked syntactic bit") }
5750
}
5851
}

branches/snap-stage3/src/comp/syntax/ext/qquote.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import driver::session;
33
import option::{none, some};
44

55
import syntax::ast::{crate, expr_, mac_invoc,
6-
mac_qq, mac_aq, mac_var};
6+
mac_aq, mac_var};
77
import syntax::fold::*;
88
import syntax::visit::*;
99
import syntax::ext::base::*;
@@ -156,7 +156,7 @@ fn expand_ast(ecx: ext_ctxt, _sp: span,
156156
let node = parse_from_source_str
157157
(f, fname, some(ss), str,
158158
ecx.session().opts.cfg, ecx.session().parse_sess);
159-
ret expand_qquote(ecx, node.span(), some(*str), node);
159+
ret expand_qquote(ecx, node.span(), *str, node);
160160
}
161161

162162
ret alt what {
@@ -185,13 +185,9 @@ fn parse_item(p: parser) -> @ast::item {
185185
}
186186

187187
fn expand_qquote<N: qq_helper>
188-
(ecx: ext_ctxt, sp: span, maybe_str: option::t<str>, node: N)
188+
(ecx: ext_ctxt, sp: span, str: str, node: N)
189189
-> @ast::expr
190190
{
191-
let str = alt(maybe_str) {
192-
some(s) {s}
193-
none {codemap::span_to_snippet(sp, ecx.session().parse_sess.cm)}
194-
};
195191
let qcx = gather_anti_quotes(sp.lo, node);
196192
let cx = qcx;
197193
let prev = 0u;

branches/snap-stage3/src/comp/syntax/ext/simplext.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,6 @@ fn p_t_s_r_mac(cx: ext_ctxt, mac: ast::mac, s: selector, b: binders) {
587587
none { no_des(cx, blk.span, "under `#{}`"); }
588588
}
589589
}
590-
ast::mac_qq(_,_) { no_des(cx, mac.span, "quasiquotes"); }
591590
ast::mac_aq(_,_) { no_des(cx, mac.span, "antiquotes"); }
592591
ast::mac_var(_) { no_des(cx, mac.span, "antiquote variables"); }
593592
}

branches/snap-stage3/src/comp/syntax/fold.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ fn fold_mac_(m: mac, fld: ast_fold) -> mac {
144144
mac_embed_type(ty) { mac_embed_type(fld.fold_ty(ty)) }
145145
mac_embed_block(blk) { mac_embed_block(fld.fold_block(blk)) }
146146
mac_ellipsis { mac_ellipsis }
147-
mac_qq(_,_) { /* fixme */ m.node }
148147
mac_aq(_,_) { /* fixme */ m.node }
149148
mac_var(_) { /* fixme */ m.node }
150149
},

branches/snap-stage3/src/comp/syntax/parse/lexer.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ fn next_token_inner(rdr: reader) -> token::token {
349349
'#' {
350350
rdr.bump();
351351
if rdr.curr == '<' { rdr.bump(); ret token::POUND_LT; }
352-
if rdr.curr == '(' { rdr.bump(); ret token::POUND_LPAREN; }
353352
if rdr.curr == '{' { rdr.bump(); ret token::POUND_LBRACE; }
354353
ret token::POUND;
355354
}

branches/snap-stage3/src/comp/syntax/parse/parser.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -880,12 +880,6 @@ fn parse_bottom_expr(p: parser) -> pexpr {
880880
} else if p.token == token::ELLIPSIS {
881881
p.bump();
882882
ret pexpr(mk_mac_expr(p, lo, p.span.hi, ast::mac_ellipsis));
883-
} else if p.token == token::POUND_LPAREN {
884-
p.bump();
885-
let e = parse_expr(p);
886-
expect(p, token::RPAREN);
887-
ret pexpr(mk_mac_expr(p, lo, p.span.hi,
888-
ast::mac_qq(e.span, e)));
889883
} else if eat_word(p, "bind") {
890884
let e = parse_expr_res(p, RESTRICT_NO_CALL_EXPRS);
891885
fn parse_expr_opt(p: parser) -> option<@ast::expr> {

branches/snap-stage3/src/comp/syntax/parse/token.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ enum token {
5353
LBRACE,
5454
RBRACE,
5555
POUND,
56-
POUND_LPAREN,
5756
POUND_LBRACE,
5857
POUND_LT,
5958

@@ -128,7 +127,6 @@ fn to_str(r: reader, t: token) -> str {
128127
LBRACE { ret "{"; }
129128
RBRACE { ret "}"; }
130129
POUND { ret "#"; }
131-
POUND_LPAREN { ret "#("; }
132130
POUND_LBRACE { ret "#{"; }
133131
POUND_LT { ret "#<"; }
134132

branches/snap-stage3/src/comp/syntax/visit.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ fn visit_mac<E>(m: mac, e: E, v: vt<E>) {
300300
ast::mac_embed_type(ty) { v.visit_ty(ty, e, v); }
301301
ast::mac_embed_block(blk) { v.visit_block(blk, e, v); }
302302
ast::mac_ellipsis { }
303-
ast::mac_qq(_, e) { /* FIXME: maybe visit */ }
304303
ast::mac_aq(_, e) { /* FIXME: maybe visit */ }
305304
ast::mac_var(_) { }
306305
}

branches/snap-stage3/src/test/run-pass/qquote.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn main() {
5353
let expr3 = #ast{2 - $(abc) + 7};
5454
check_pp(expr3, pprust::print_expr, "2 - 23 + 7");
5555

56-
let expr4 = #ast{2 - $(#(3)) + 9};
56+
let expr4 = #ast{2 - $(#ast{3}) + 9};
5757
check_pp(expr4, pprust::print_expr, "2 - 3 + 9");
5858

5959
let ty = #ast(ty){int};

0 commit comments

Comments
 (0)