diff options
| author | Paul Stansifer <paul.stansifer@gmail.com> | 2012-06-29 18:26:34 -0700 |
|---|---|---|
| committer | Paul Stansifer <paul.stansifer@gmail.com> | 2012-07-05 18:09:31 -0700 |
| commit | 0c6fe6470e6a19899bd32add0a282d3ae2a97b8a (patch) | |
| tree | 4b9ac214483a3190ea5043adab6cb3f965515da2 /src/libsyntax/parse/parser.rs | |
| parent | f4fb975e4eeb88f5b92b75a5df1e4e6c19856b42 (diff) | |
| download | rust-0c6fe6470e6a19899bd32add0a282d3ae2a97b8a.tar.gz rust-0c6fe6470e6a19899bd32add0a282d3ae2a97b8a.zip | |
Macro By Example transcription of token trees with interpolations and dotdotdots.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index d31d4762c7b..4d564563d10 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1070,9 +1070,10 @@ class parser { fn parse_tt_flat(p: parser, delim_ok: bool) -> token_tree { if p.eat_keyword("many") && p.quote_depth > 0u { - ret tt_dotdotdot( - p.parse_seq(token::LPAREN, token::RPAREN, seq_sep_none(), - |p| p.parse_token_tree()).node); + let seq = p.parse_seq(token::LPAREN, token::RPAREN, + seq_sep_none(), + |p| p.parse_token_tree()); + ret tt_dotdotdot(seq.span, seq.node); } alt p.token { token::RPAREN | token::RBRACE | token::RBRACKET @@ -1086,7 +1087,8 @@ class parser { /* we ought to allow different depths of unquotation */ token::DOLLAR if p.quote_depth > 0u { p.bump(); - ret tt_interpolate(p.parse_ident()); + let sp = p.span; + ret tt_interpolate(sp, p.parse_ident()); } _ { /* ok */ } } |
