diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-12-30 14:40:31 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-01-02 14:16:07 -0800 |
| commit | 425a140485dc3ba70c4e30e10cd8d5fd92a458c5 (patch) | |
| tree | f570e95e025778143c9ba017c6c76a57f61b98d0 /src/libsyntax | |
| parent | f499d365ada01a23bd046bac9b1bef7ccdb9fa8c (diff) | |
| download | rust-425a140485dc3ba70c4e30e10cd8d5fd92a458c5.tar.gz rust-425a140485dc3ba70c4e30e10cd8d5fd92a458c5.zip | |
libsyntax: De-`@mut` `quote_depth` in the parser
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 6 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 5021cf968f7..0f0793e03b7 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -590,7 +590,7 @@ fn expand_tts(cx: &ExtCtxt, sp: Span, tts: &[ast::token_tree]) let mut p = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg(), tts.to_owned()); - *p.quote_depth += 1u; + p.quote_depth += 1u; let cx_expr = p.parse_expr(); if !p.eat(&token::COMMA) { diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index f2c695c6cd6..a14d25305fd 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -448,9 +448,9 @@ pub fn parse_nt(p: &mut Parser, name: &str) -> nonterminal { } "attr" => token::nt_attr(@p.parse_attribute(false)), "tt" => { - *p.quote_depth += 1u; //but in theory, non-quoted tts might be useful + p.quote_depth += 1u; //but in theory, non-quoted tts might be useful let res = token::nt_tt(@p.parse_token_tree()); - *p.quote_depth -= 1u; + p.quote_depth -= 1u; res } "matchers" => token::nt_matchers(p.parse_matchers()), diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 1200c5db611..a1f770a5fde 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -175,7 +175,7 @@ pub fn parse_tts_from_source_str( name, source ); - *p.quote_depth += 1u; + p.quote_depth += 1u; // right now this is re-creating the token trees from ... token trees. maybe_aborted(p.parse_all_token_trees(),p) } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 2a4658854c3..806da6988d8 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -315,7 +315,7 @@ pub fn Parser(sess: @mut ParseSess, buffer_end: @mut 0, tokens_consumed: @mut 0, restriction: @mut UNRESTRICTED, - quote_depth: @mut 0, + quote_depth: 0, obsolete_set: @mut HashSet::new(), mod_path_stack: @mut ~[], open_braces: @mut ~[], @@ -340,7 +340,7 @@ pub struct Parser { buffer_end: @mut int, tokens_consumed: @mut uint, restriction: @mut restriction, - quote_depth: @mut uint, // not (yet) related to the quasiquoter + quote_depth: uint, // not (yet) related to the quasiquoter reader: @mut reader, interner: @token::ident_interner, /// The set of seen errors about obsolete syntax. Used to suppress @@ -2097,7 +2097,7 @@ impl Parser { token_str)) }, /* we ought to allow different depths of unquotation */ - token::DOLLAR if *p.quote_depth > 0u => { + token::DOLLAR if p.quote_depth > 0u => { p.bump(); let sp = *p.span; |
