syntex_syntax 0.4.3

Export of libsyntax for code generation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
b0VIM 7.4,(4UW��-ericktErick-Tryzelaar-MBP.local~erickt/projects/rust/rust/src/libsyntax/ext/deriving/cmp/ord.rsutf-8
3210#"! Utpl!mad�l��]Z��R.-$�
�
�
�
z
X
L
K

���lj&����tM"�
�
�
j
=
�	�	�	a	L	>	3	
			������9�vtsG��~@�����dH,%$��V#��������v/����YC+��t_    let     let test    l            let new = {            // }            //    __test            // } else {            //    old            // if __test == ::std::cmp::Ordering::Equal {            // let __test = new;        |cx, span, old, self_f, other_fs| {        false,        // as the outermost one, and the last as the innermost.        // foldr nests the if-elses correctly, leaving the first field    cs_fold(    */    FIXME #6449: These `if`s could/should be `match`es.    }        __test    } else {        }            __test        } else {            ...        if __test == ::std::cmp::Ordering::Equal {        let __test = ::std::cmp::Ord::cmp(&self_field2, &other_field2);    if other == ::std::cmp::Ordering::Equal {    let __test = ::std::cmp::Ord::cmp(&self_field1, &other_field1);    Builds:    /*    ];        cx.ident_of("cmp"),        cx.ident_of("Ord"),        cx.ident_of("cmp"),        cx.ident_of_std("core"),    let cmp_path = vec![                                          cx.ident_of("Equal")));                                          cx.ident_of("Ordering"),                                          cx.ident_of("cmp"),                                     vec!(cx.ident_of_std("core"),    let equals_path = cx.path_global(span,    let test_id = cx.ident_of("__test");              substr: &Substructure) -> P<Expr> {pub fn cs_cmp(cx: &mut ExtCtxt, span: Span,}    cx.expr_method_call(span, lft, cx.ident_of("cmp"), vec![rgt])    let rgt = cx.expr_addr_of(span, cx.expr_ident(span, self_arg_tags[1]));    let lft = cx.expr_ident(span, self_arg_tags[0]);                          self_arg_tags: &[ast::Ident]) -> P<ast::Expr> {                          span: Span,pub fn ordering_collapsed(cx: &mut ExtCtxt,}    trait_def.expand(cx, mitem, item, push)    };        associated_types: Vec::new(),        ),            }                })),                    cs_cmp(a, b, c)                combine_substructure: combine_substructure(Box::new(|a, b, c| {                attributes: attrs,                ret_ty: Literal(path_std!(cx, core::cmp::Ordering)),                args: vec!(borrowed_self()),                explicit_self: borrowed_explicit_self(),                generics: LifetimeBounds::empty(),                name: "cmp",            MethodDef {        methods: vec!(        generics: LifetimeBounds::empty(),        additional_bounds: Vec::new(),        path: path_std!(cx, core::cmp::Ord),        attributes: Vec::new(),        span: span,    let trait_def = TraitDef {    let attrs = vec!(cx.attribute(span, inline));    let inline = cx.meta_word(span, InternedString::new("inline"));{                           push: &mut FnMut(P<Item>))                           item: &Item,                           mitem: &MetaItem,                           span: Span,pub fn expand_deriving_ord(cx: &mut ExtCtxt,use ptr::P;use parse::token::InternedString;use ext::deriving::generic::ty::*;use ext::deriving::generic::*;use ext::build::AstBuilder;use ext::base::ExtCtxt;use codemap::Span;use ast::{MetaItem, Item, Expr};use ast;// except according to those terms.// option. This file may not be copied, modified, or distributed// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or//// http://rust-lang.org/COPYRIGHT.// file at the top-level directory of this distribution and at// Copyright 2013 The Rust Project Developers. See the COPYRIGHTad-
�
!��.���wv4%$�
�
�
g

���A6��P;�
�
�
�
�
R
?
�	�	�	u	 	����P�on
��H9��jiYK8����x2�����P�������JB54}        cx,}      }        cx, span, substr)        }),            }>>>>>>> syntax: Remov}        cx, }        cx}        cx, span, substr}}}        cx, span, sub}        cx, span, substr)        }),            }        cx, span, substr)        }),            }>>>}        cx, span, substr)        }),           }        cx,}        cx, span, substr)  }        cx, span, substr)        }),        }        cx, s}        cx, span, substr)        }),            }>>>>>>> syntax:}        cx, span, substr)        }),            }>>>>>>> syntax: }        cx, span, su}}        cx, sp}        cx, span, substr)        }),            }>>>>>>}        cx, span, substr)        }),            }>>>>>>> syn}        cx, span, substr)}        cx, span,}        cx, }        cx, sp}}        cx, span, substr)        }),            }>>>>>>> syntax: }        cx, span, substr)        }),            }>>>>>>> syntax: Remo}        cx, span, substr)        }),            }>>>>>>> s}        cx, s}        cx, span, substr)        }),            }>>>>>>> syntax}        cx, span, substr)        }),}        cx, span, substr)        }),            }>>>>>>> syntax: Remove uses of #[fea}        cx, s}}        cx, span, substr)        }),            }>>>>>>> syntax: Remove uses}}        cx, span, substr)        }),            }>>>>}        cx, span, substr)        }),            }>>>>>>> syntax: Remove uses of #[featu}}        cx, span, substr)        }),            }>>>>>>> syntax: Remo}        cx, span, substr)        }),            }}        c}        cx, span, substr)       }        cx, span, substr)        }),            }>>>>>>> syntax: }        cx, span, substr)        })}        cx, span, substr)        }),            }>>>>>>> syntax: Remove uses of }        cx, span, s}        cx, span, substr)        }),       }        cx, span, substr)        }),            }>>>>>>> synta}        cx, span, substr)        }),            }>>>>>>> synta}        cx, span,}        cx, span, substr)        }),            }>>>>>>> syn}        cx, span, substr)        }),            }>>>>}        cx, span, substr)        }),            }                ordering_collapsed(cx, span, tag_tuple)            } else {                cx.span_bug(span, "not exactly 2 arguments in `derives(Ord)`")            if self_args.len() != 2 {        Box::new(|cx, span, (self_args, tag_tuple), _non_self_args| {        cx.expr_path(equals_path.clone()),        },            cx.expr_block(cx.block(span, vec!(assign), Some(if_)))                                 old, Some(cx.expr_ident(span, test_id)));                                 cond,            let if_ = cx.expr_if(span,                                      cx.expr_path(equals_path.clone()));                                      cx.expr_ident(span, test_id),            let cond = cx.expr_binary(span, ast::BiEq,            let assign = cx.stmt_let(span, false, test_id, new);            };                cx.expr_call_global(span, cmp_path.clone(), args)                ];                    cx.expr_addr_of(span, other_f.clone()),                    cx.expr_addr_of(span, self_f),                let args = vec![                };                    _ => cx.span_bug(span, "not exactly 2 arguments in `derive(PartialOrd)`"),                    (1, Some(o_f)) => o_f,                let other_f = match (other_fs.len(), other_fs.get(0)) {