about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorPaul Stansifer <paul.stansifer@gmail.com>2012-08-22 17:24:52 -0700
committerPaul Stansifer <paul.stansifer@gmail.com>2012-08-23 11:14:14 -0700
commit29f32b4a7298b0807408658bc8add1de8a06ab12 (patch)
treec989293754f94ce2c22cee3902af0c57d33e6dd0 /src/libsyntax/parse
parent226fd87199fb0184fb39ffc5dff3865cfdc9f362 (diff)
downloadrust-29f32b4a7298b0807408658bc8add1de8a06ab12.tar.gz
rust-29f32b4a7298b0807408658bc8add1de8a06ab12.zip
`m1!{...}` -> `m1!(...)`
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/comments.rs20
-rw-r--r--src/libsyntax/parse/common.rs2
-rw-r--r--src/libsyntax/parse/eval.rs10
-rw-r--r--src/libsyntax/parse/lexer.rs16
-rw-r--r--src/libsyntax/parse/parser.rs46
5 files changed, 47 insertions, 47 deletions
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs
index 09edbda4335..b80e472c047 100644
--- a/src/libsyntax/parse/comments.rs
+++ b/src/libsyntax/parse/comments.rs
@@ -118,7 +118,7 @@ fn consume_non_eol_whitespace(rdr: string_reader) {
 }
 
 fn push_blank_line_comment(rdr: string_reader, &comments: ~[cmnt]) {
-    debug!{">>> blank-line comment"};
+    debug!(">>> blank-line comment");
     let v: ~[~str] = ~[];
     vec::push(comments, {style: blank_line, lines: v, pos: rdr.chpos});
 }
@@ -136,9 +136,9 @@ fn consume_whitespace_counting_blank_lines(rdr: string_reader,
 
 fn read_shebang_comment(rdr: string_reader, code_to_the_left: bool,
                                                         &comments: ~[cmnt]) {
-    debug!{">>> shebang comment"};
+    debug!(">>> shebang comment");
     let p = rdr.chpos;
-    debug!{"<<< shebang comment"};
+    debug!("<<< shebang comment");
     vec::push(comments, {
         style: if code_to_the_left { trailing } else { isolated },
         lines: ~[read_one_line_comment(rdr)],
@@ -148,7 +148,7 @@ fn read_shebang_comment(rdr: string_reader, code_to_the_left: bool,
 
 fn read_line_comments(rdr: string_reader, code_to_the_left: bool,
                                                         &comments: ~[cmnt]) {
-    debug!{">>> line comments"};
+    debug!(">>> line comments");
     let p = rdr.chpos;
     let mut lines: ~[~str] = ~[];
     while rdr.curr == '/' && nextch(rdr) == '/' {
@@ -160,7 +160,7 @@ fn read_line_comments(rdr: string_reader, code_to_the_left: bool,
         vec::push(lines, line);
         consume_non_eol_whitespace(rdr);
     }
-    debug!{"<<< line comments"};
+    debug!("<<< line comments");
     if !lines.is_empty() {
         vec::push(comments, {
             style: if code_to_the_left { trailing } else { isolated },
@@ -193,7 +193,7 @@ fn trim_whitespace_prefix_and_push_line(&lines: ~[~str],
 
 fn read_block_comment(rdr: string_reader, code_to_the_left: bool,
                                                         &comments: ~[cmnt]) {
-    debug!{">>> block comment"};
+    debug!(">>> block comment");
     let p = rdr.chpos;
     let mut lines: ~[~str] = ~[];
     let mut col: uint = rdr.col;
@@ -215,7 +215,7 @@ fn read_block_comment(rdr: string_reader, code_to_the_left: bool,
     let mut curr_line = ~"/*";
     let mut level: int = 1;
     while level > 0 {
-        debug!{"=== block comment level %d", level};
+        debug!("=== block comment level %d", level);
         if is_eof(rdr) {(rdr as reader).fatal(~"unterminated block comment");}
         if rdr.curr == '\n' {
             trim_whitespace_prefix_and_push_line(lines, curr_line, col);
@@ -246,7 +246,7 @@ fn read_block_comment(rdr: string_reader, code_to_the_left: bool,
     if !is_eof(rdr) && rdr.curr != '\n' && vec::len(lines) == 1u {
         style = mixed;
     }
-    debug!{"<<< block comment"};
+    debug!("<<< block comment");
     vec::push(comments, {style: style, lines: lines, pos: p});
 }
 
@@ -258,7 +258,7 @@ fn peeking_at_comment(rdr: string_reader) -> bool {
 
 fn consume_comment(rdr: string_reader, code_to_the_left: bool,
                    &comments: ~[cmnt]) {
-    debug!{">>> consume comment"};
+    debug!(">>> consume comment");
     if rdr.curr == '/' && nextch(rdr) == '/' {
         read_line_comments(rdr, code_to_the_left, comments);
     } else if rdr.curr == '/' && nextch(rdr) == '*' {
@@ -266,7 +266,7 @@ fn consume_comment(rdr: string_reader, code_to_the_left: bool,
     } else if rdr.curr == '#' && nextch(rdr) == '!' {
         read_shebang_comment(rdr, code_to_the_left, comments);
     } else { fail; }
-    debug!{"<<< consume comment"};
+    debug!("<<< consume comment");
 }
 
 type lit = {lit: ~str, pos: uint};
diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs
index 1d260268d3f..afb9c91fc8d 100644
--- a/src/libsyntax/parse/common.rs
+++ b/src/libsyntax/parse/common.rs
@@ -115,7 +115,7 @@ impl parser: parser_common {
     // A sanity check that the word we are asking for is a known keyword
     fn require_keyword(word: ~str) {
         if !self.keywords.contains_key_ref(&word) {
-            self.bug(fmt!{"unknown keyword: %s", word});
+            self.bug(fmt!("unknown keyword: %s", word));
         }
     }
 
diff --git a/src/libsyntax/parse/eval.rs b/src/libsyntax/parse/eval.rs
index 60d2fadb04c..2eafa4a6f34 100644
--- a/src/libsyntax/parse/eval.rs
+++ b/src/libsyntax/parse/eval.rs
@@ -20,9 +20,9 @@ fn eval_crate_directives(cx: ctx,
 fn eval_crate_directives_to_mod(cx: ctx, cdirs: ~[@ast::crate_directive],
                                 prefix: ~str, suffix: option<~str>)
     -> (ast::_mod, ~[ast::attribute]) {
-    debug!{"eval crate prefix: %s", prefix};
-    debug!{"eval crate suffix: %s",
-           option::get_default(suffix, ~"none")};
+    debug!("eval crate prefix: %s", prefix);
+    debug!("eval crate suffix: %s",
+           option::get_default(suffix, ~"none"));
     let (cview_items, citems, cattrs)
         = parse_companion_mod(cx, prefix, suffix);
     let mut view_items: ~[@ast::view_item] = ~[];
@@ -63,9 +63,9 @@ fn parse_companion_mod(cx: ctx, prefix: ~str, suffix: option<~str>)
     }
 
     let modpath = companion_file(prefix, suffix);
-    debug!{"looking for companion mod %s", modpath};
+    debug!("looking for companion mod %s", modpath);
     if file_exists(modpath) {
-        debug!{"found companion mod"};
+        debug!("found companion mod");
         let (p0, r0) = new_parser_etc_from_file(cx.sess, cx.cfg,
                                                 modpath, SOURCE_FILE);
         let inner_attrs = p0.parse_inner_attrs_and_next();
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index a796073c9dd..854633aa06e 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -419,8 +419,8 @@ fn scan_number(c: char, rdr: string_reader) -> token::token {
         }
         let parsed = option::get(u64::from_str_radix(num_str, base as u64));
 
-        debug!{"lexing %s as an unsuffixed integer literal",
-               num_str};
+        debug!("lexing %s as an unsuffixed integer literal",
+               num_str);
         return token::LIT_INT_UNSUFFIXED(parsed as i64);
     }
 }
@@ -431,7 +431,7 @@ fn scan_numeric_escape(rdr: string_reader, n_hex_digits: uint) -> char {
         let n = rdr.curr;
         bump(rdr);
         if !is_hex_digit(n) {
-            rdr.fatal(fmt!{"illegal numeric character escape: %d", n as int});
+            rdr.fatal(fmt!("illegal numeric character escape: %d", n as int));
         }
         accum_int *= 16;
         accum_int += hex_digit_val(n);
@@ -578,7 +578,7 @@ fn next_token_inner(rdr: string_reader) -> token::token {
               'u' => { c2 = scan_numeric_escape(rdr, 4u); }
               'U' => { c2 = scan_numeric_escape(rdr, 8u); }
               c2 => {
-                rdr.fatal(fmt!{"unknown character escape: %d", c2 as int});
+                rdr.fatal(fmt!("unknown character escape: %d", c2 as int));
               }
             }
         }
@@ -593,8 +593,8 @@ fn next_token_inner(rdr: string_reader) -> token::token {
         bump(rdr);
         while rdr.curr != '"' {
             if is_eof(rdr) {
-                rdr.fatal(fmt!{"unterminated double quote string: %s",
-                               get_str_from(rdr, n)});
+                rdr.fatal(fmt!("unterminated double quote string: %s",
+                               get_str_from(rdr, n)));
             }
 
             let ch = rdr.curr;
@@ -621,7 +621,7 @@ fn next_token_inner(rdr: string_reader) -> token::token {
                     str::push_char(accum_str, scan_numeric_escape(rdr, 8u));
                   }
                   c2 => {
-                    rdr.fatal(fmt!{"unknown string escape: %d", c2 as int});
+                    rdr.fatal(fmt!("unknown string escape: %d", c2 as int));
                   }
                 }
               }
@@ -656,7 +656,7 @@ fn next_token_inner(rdr: string_reader) -> token::token {
       '/' => { return binop(rdr, token::SLASH); }
       '^' => { return binop(rdr, token::CARET); }
       '%' => { return binop(rdr, token::PERCENT); }
-      c => { rdr.fatal(fmt!{"unknown start of token: %d", c as int}); }
+      c => { rdr.fatal(fmt!("unknown start of token: %d", c as int)); }
     }
 }
 
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index f81d6de25b4..2aef7c99dbc 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -126,7 +126,7 @@ enum view_item_parse_mode {
 /* The expr situation is not as complex as I thought it would be.
 The important thing is to make sure that lookahead doesn't balk
 at INTERPOLATED tokens */
-macro_rules! maybe_whole_expr {
+macro_rules! maybe_whole_expr (
     {$p:expr} => { match copy $p.token {
       INTERPOLATED(token::nt_expr(e)) => {
         $p.bump();
@@ -139,9 +139,9 @@ macro_rules! maybe_whole_expr {
       }
       _ => ()
     }}
-}
+)
 
-macro_rules! maybe_whole {
+macro_rules! maybe_whole (
     {$p:expr, $constructor:ident} => { match copy $p.token {
       INTERPOLATED(token::$constructor(x)) => { $p.bump(); return x; }
       _ => ()
@@ -166,7 +166,7 @@ macro_rules! maybe_whole {
       _ => ()
     }}
 
-}
+)
 
 
 pure fn maybe_append(+lhs: ~[attribute], rhs: option<~[attribute]>)
@@ -325,13 +325,13 @@ struct parser {
             let self_ty = if is_static { static_sty } else { self_ty };
 
             let hi = p.last_span.hi;
-            debug!{"parse_trait_methods(): trait method signature ends in \
+            debug!("parse_trait_methods(): trait method signature ends in \
                     `%s`",
-                   token_to_str(p.reader, p.token)};
+                   token_to_str(p.reader, p.token));
             match p.token {
               token::SEMI => {
                 p.bump();
-                debug!{"parse_trait_methods(): parsing required method"};
+                debug!("parse_trait_methods(): parsing required method");
                 // NB: at the moment, visibility annotations on required
                 // methods are ignored; this could change.
                 required({ident: ident, attrs: attrs,
@@ -340,7 +340,7 @@ struct parser {
                           id: p.get_id(), span: mk_sp(lo, hi)})
               }
               token::LBRACE => {
-                debug!{"parse_trait_methods(): parsing provided method"};
+                debug!("parse_trait_methods(): parsing provided method");
                 let (inner_attrs, body) =
                     p.parse_inner_attrs_and_block(true);
                 let attrs = vec::append(attrs, inner_attrs);
@@ -441,7 +441,7 @@ struct parser {
     }
 
     fn parse_ty(colons_before_params: bool) -> @ty {
-        maybe_whole!{self, nt_ty};
+        maybe_whole!(self, nt_ty);
 
         let lo = self.span.lo;
 
@@ -708,7 +708,7 @@ struct parser {
         parse_ident: fn(parser) -> ident,
         parse_last_ident: fn(parser) -> ident) -> @path {
 
-        maybe_whole!{self, nt_path};
+        maybe_whole!(self, nt_path);
         let lo = self.span.lo;
         let global = self.eat(token::MOD_SEP);
         let mut ids = ~[];
@@ -735,9 +735,9 @@ struct parser {
     }
 
     fn parse_path_with_tps(colons: bool) -> @path {
-        debug!{"parse_path_with_tps(colons=%b)", colons};
+        debug!("parse_path_with_tps(colons=%b)", colons);
 
-        maybe_whole!{self, nt_path};
+        maybe_whole!(self, nt_path);
         let lo = self.span.lo;
         let path = self.parse_path_without_tps();
         if colons && !self.eat(token::MOD_SEP) {
@@ -829,7 +829,7 @@ struct parser {
     }
 
     fn parse_bottom_expr() -> pexpr {
-        maybe_whole_expr!{self};
+        maybe_whole_expr!(self);
         let lo = self.span.lo;
         let mut hi = self.span.hi;
 
@@ -1197,7 +1197,7 @@ struct parser {
     }
 
     fn parse_token_tree() -> token_tree {
-        maybe_whole!{deref self, nt_tt};
+        maybe_whole!(deref self, nt_tt);
 
         fn parse_tt_tok(p: parser, delim_ok: bool) -> token_tree {
             match p.token {
@@ -1249,7 +1249,7 @@ struct parser {
     fn parse_matchers() -> ~[matcher] {
         // unification of matchers and token_trees would vastly improve
         // the interpolation of matchers
-        maybe_whole!{self, nt_matchers};
+        maybe_whole!(self, nt_matchers);
         let name_idx = @mut 0u;
         return match self.token {
           token::LBRACE | token::LPAREN | token::LBRACKET => {
@@ -1598,9 +1598,9 @@ struct parser {
             // There may be other types of expressions that can
             // represent the callee in `for` and `do` expressions
             // but they aren't represented by tests
-            debug!{"sugary call on %?", e.node};
+            debug!("sugary call on %?", e.node);
             self.span_fatal(
-                lo, fmt!{"`%s` must be followed by a block call", keyword});
+                lo, fmt!("`%s` must be followed by a block call", keyword));
           }
         }
     }
@@ -1801,7 +1801,7 @@ struct parser {
     }
 
     fn parse_pat(refutable: bool) -> @pat {
-        maybe_whole!{self, nt_pat};
+        maybe_whole!(self, nt_pat);
 
         let lo = self.span.lo;
         let mut hi = self.span.hi;
@@ -2077,7 +2077,7 @@ struct parser {
     }
 
     fn parse_stmt(+first_item_attrs: ~[attribute]) -> @stmt {
-        maybe_whole!{self, nt_stmt};
+        maybe_whole!(self, nt_stmt);
 
         fn check_expected_item(p: parser, current_attrs: ~[attribute]) {
             // If we have attributes then we should have an item
@@ -2140,7 +2140,7 @@ struct parser {
     fn parse_inner_attrs_and_block(parse_attrs: bool)
         -> (~[attribute], blk) {
 
-        maybe_whole!{pair_empty self, nt_block};
+        maybe_whole!(pair_empty self, nt_block);
 
         fn maybe_parse_inner_attrs_and_next(p: parser, parse_attrs: bool) ->
             {inner: ~[attribute], next: ~[attribute]} {
@@ -2812,7 +2812,7 @@ struct parser {
                            token_to_str(self.reader, self.token) + ~"`");
               }
             }
-            debug!{"parse_mod_items: attrs=%?", attrs};
+            debug!("parse_mod_items: attrs=%?", attrs);
         }
 
         if first && attrs_remaining.len() > 0u {
@@ -3139,7 +3139,7 @@ struct parser {
 
     fn parse_item_or_view_item(+attrs: ~[attribute], items_allowed: bool)
                             -> item_or_view_item {
-        maybe_whole!{iovi self,nt_item};
+        maybe_whole!(iovi self,nt_item);
         let lo = self.span.lo;
 
         let visibility;
@@ -3303,7 +3303,7 @@ struct parser {
         let lo = self.span.lo;
         let first_ident = self.parse_ident();
         let mut path = ~[first_ident];
-        debug!{"parsed view_path: %s", *self.id_to_str(first_ident)};
+        debug!("parsed view_path: %s", *self.id_to_str(first_ident));
         match self.token {
           token::EQ => {
             // x = foo::bar