]> git.lizzy.rs Git - rust.git/commitdiff
Additional ; to , changes, disable "tag" and ";" in parser. Close #1430. Close #1428.
authorGraydon Hoare <graydon@mozilla.com>
Fri, 20 Jan 2012 03:29:21 +0000 (19:29 -0800)
committerGraydon Hoare <graydon@mozilla.com>
Fri, 20 Jan 2012 03:29:21 +0000 (19:29 -0800)
14 files changed:
src/comp/middle/trans_alt.rs
src/comp/middle/trans_common.rs
src/comp/syntax/parse/parser.rs
src/libcore/comm.rs
src/libcore/either.rs
src/libcore/result.rs
src/libstd/c_vec.rs
src/libstd/extfmt.rs
src/libstd/fun_treemap.rs
src/libstd/map.rs
src/libstd/treemap.rs
src/rustdoc/gen.rs
src/test/compile-fail/unsafe-alt.rs
src/test/run-pass/issue-970.rs

index 816c82de1e2b4ff47a1b4c0d1852004dbdafbfc6..efdcd613fedb0339552b73f934cc7654c370832c 100644 (file)
@@ -20,8 +20,8 @@
 // range)
 enum opt {
     lit(@ast::expr),
-    var(/* disr val */int, /* variant dids */{tg: def_id, var: def_id});
-    range(@ast::expr, @ast::expr);
+    var(/* disr val */int, /* variant dids */{tg: def_id, var: def_id}),
+    range(@ast::expr, @ast::expr)
 }
 fn opt_eq(a: opt, b: opt) -> bool {
     alt (a, b) {
index 64ac02e31251ed4433f2c7ae93dd693866081938..3e83f3da2f3d6c15bfe734f20ffdaca4208e1de9 100644 (file)
@@ -338,21 +338,21 @@ enum block_kind {
     // in the source language.  Since these blocks create variable scope, any
     // variables created in them that are still live at the end of the block
     // must be dropped and cleaned up when the block ends.
-    SCOPE_BLOCK;
+    SCOPE_BLOCK,
 
 
     // A basic block created from the body of a loop.  Contains pointers to
     // which block to jump to in the case of "continue" or "break", with the
     // "continue" block optional, because "while" and "do while" don't support
     // "continue" (TODO: is this intentional?)
-    LOOP_SCOPE_BLOCK(option::t<@block_ctxt>, @block_ctxt);
+    LOOP_SCOPE_BLOCK(option::t<@block_ctxt>, @block_ctxt),
 
 
     // A non-scope block is a basic block created as a translation artifact
     // from translating code that expresses conditional logic rather than by
     // explicit { ... } block structure in the source language.  It's called a
     // non-scope block because it doesn't introduce a new variable scope.
-    NON_SCOPE_BLOCK;
+    NON_SCOPE_BLOCK
 }
 
 
index ae0cf5bef60026fd9711a072b2fe4d449a040054..46b6c474363c1ed28d5e36478db198ada8a41e3c 100644 (file)
@@ -2074,7 +2074,7 @@ fn parse_item_tag(p: parser, attrs: [ast::attribute]) -> @ast::item {
             }
 
             alt p.token {
-              token::SEMI | token::COMMA {
+              token::COMMA {
                 p.bump();
                 if p.token == token::RBRACE { done = true; }
               }
index 95a62be3dcbaec976cfb6a9908332daf0be71595..b37ccd62aebbea229b41828074bcb7cc52651625 100644 (file)
@@ -65,7 +65,7 @@ fn port_recv(dptr: *uint, po: *rust_port,
           over other channels."
 )]
 enum chan<T: send> {
-    chan_t(task::task, port_id);
+    chan_t(task::task, port_id)
 }
 
 resource port_ptr<T: send>(po: *rustrt::rust_port) {
@@ -89,7 +89,7 @@ enum chan<T: send> {
           copied, both copies refer to the same port. \
           Ports may be associated with multiple <chan>s."
 )]
-enum port<T: send> { port_t(@port_ptr<T>); }
+enum port<T: send> { port_t(@port_ptr<T>) }
 
 #[doc(
   brief = "Sends data over a channel. The sent data is moved \
index 29595a37b4a45491f71e6ab57a681db4700c8c0a..d605b575901ea57c543a2f83c6d56efcd3d472ae 100644 (file)
@@ -14,7 +14,7 @@ enum t<T, U> {
     /* Variant: left */
     left(T),
     /* Variant: right */
-    right(U),
+    right(U)
 }
 
 /* Section: Operations */
index 50dd7fcd21a344f1b2388271898f59403c33d578..0b229110ec3b030588ba61fa37782c04b4dda821 100644 (file)
@@ -23,7 +23,7 @@ enum t<T, U> {
 
     Contains the error value
     */
-    err(U),
+    err(U)
 }
 
 /* Section: Operations */
index 05d59c2b50ba9ae5844745fbca986ce11788c341..b2154bc61b4b4fa36b369e9f826aff2b6a4f2fd0 100644 (file)
@@ -43,7 +43,7 @@
  */
 
 enum t<T> {
-    t({ base: *mutable T, len: uint, rsrc: @dtor_res});
+    t({ base: *mutable T, len: uint, rsrc: @dtor_res})
 }
 
 resource dtor_res(dtor: option::t<fn@()>) {
index a34c1d27f96a7d2f59d4aea5649d66109f95c1ee..f5135ac8298e855cfab7b416f7b8488105b614af 100644 (file)
@@ -39,8 +39,8 @@
 
 // Functions used by the fmt extension at compile time
 mod ct {
-    enum signedness { signed, unsigned, }
-    enum caseness { case_upper, case_lower, }
+    enum signedness { signed, unsigned }
+    enum caseness { case_upper, case_lower }
     enum ty {
         ty_bool,
         ty_str,
index cf39aa2314ccd546b57c6cc7a1812cee61cdacdb..8e9839a8901c3f3d5f9ca3d56e6716a7077a3ac1 100644 (file)
@@ -33,7 +33,7 @@
 */
 enum tree_node<K, V> {
     empty,
-    node(@K, @V, @tree_node<K, V>, @tree_node<K, V>),
+    node(@K, @V, @tree_node<K, V>, @tree_node<K, V>)
 }
 
 /* Section: Operations */
index 37b29f73f452da98bc74ed5c1e3604f212656bf4..bbf3f888cf65b00812f4cf7a5791a03e88c81c95 100644 (file)
@@ -114,7 +114,7 @@ mod chained {
 
     enum chain<K, V> {
         present(@entry<K, V>),
-        absent,
+        absent
     }
 
     type t<K, V> = {
@@ -127,7 +127,7 @@ enum chain<K, V> {
     enum search_result<K, V> {
         not_found,
         found_first(uint, @entry<K,V>),
-        found_after(@entry<K,V>, @entry<K,V>),
+        found_after(@entry<K,V>, @entry<K,V>)
     }
 
     fn search_rem<K: copy, V: copy>(
index f5841d534c02bafacff1e21d4dd157e5c9cc835c..7e181a80457055fc67107d137718f2579397229a 100644 (file)
@@ -28,7 +28,7 @@
 /*
 Tag: tree_node
 */
-enum tree_node<K, V> { empty, node(@K, @V, treemap<K, V>, treemap<K, V>), }
+enum tree_node<K, V> { empty, node(@K, @V, treemap<K, V>, treemap<K, V>) }
 
 /* Section: Operations */
 
index a355bea9934e8f07450f99300bf67fa2ce6e1fbf..20c6e224daab357803b06255c8908b2d41408971 100644 (file)
@@ -33,9 +33,9 @@ fn write_markdown(
 }
 
 enum hlvl {
-    h1 = 1;
-    h2 = 2;
-    h3 = 3;
+    h1 = 1,
+    h2 = 2,
+    h3 = 3
 }
 
 fn write_header(ctxt: ctxt, lvl: hlvl, title: str) {
index 877dc65d9c10084cc9b6f7fc1451033e83195b5c..b0291ea4e83bf57713c768b86953f5ff5191bdcd 100644 (file)
@@ -1,6 +1,6 @@
 // error-pattern:invalidate reference i
 
-enum foo { left({mutable x: int}); right(bool); }
+enum foo { left({mutable x: int}), right(bool) }
 
 fn main() {
     let x = left({mutable x: 10});
index f256a936431ecbff97f7b7338bb3cf06273e3110..17fa82980a99f6e3cee8f403a779c4c962d116ac 100644 (file)
@@ -1,6 +1,6 @@
 enum maybe_ordered_pair {
-    yes({low: int, high: int} : less_than(*.low, *.high));
-    no;
+    yes({low: int, high: int} : less_than(*.low, *.high)),
+    no
 }
 pure fn less_than(x: int, y: int) -> bool { ret x < y; }
 fn main() { }