syntex_syntax 0.3.0

Export of libsyntax for code generation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
b0VIM 7.4Ĉ0UX�-ericktErick-Tryzelaar-MBP.local~erickt/projects/rust/rust/src/libsyntax/parse/mod.rsutf-8
3210#"! Utp
x��������]y��������_���������a5��������h���������f���������jd��������_���������S-��������^���������<���������e'adx�{XU��M)(
	�
�
i
N
B
A
@
 


������}|ONA10!������?�
�
�
�
�
t

�	�	�	�	�	s	c	F		��������8��tji_YWV��zy[I.����iW<'����a'���^-�����R                                         cfg: ast::CrateConfig,                                         source: String,pub fn parse_crate_attrs_from_source_str(name: String,}    maybe_aborted(panictry!(p.parse_crate_mod()),p)                                           source);                                           name,                                           cfg,    let mut p = new_parser_from_source_str(sess,                                   -> ast::Crate {                                   sess: &ParseSess)                                   cfg: ast::CrateConfig,                                   source: String,pub fn parse_crate_from_source_str(name: String,}    new_parser_from_file(sess, cfg, input).parse_inner_attributes()) -> Vec<ast::Attribute> {    sess: &ParseSess    cfg: ast::CrateConfig,    input: &Path,pub fn parse_crate_attrs_from_file(}    // why is there no p.abort_if_errors here?    panictry!(new_parser_from_file(sess, cfg, input).parse_crate_mod())) -> ast::Crate {    sess: &ParseSess    cfg: ast::CrateConfig,    input: &Path,pub fn parse_crate_from_file(// source_str.// uses a HOF to parse anything, and <source> includes file and// where <thing> includes crate, expr, item, stmt, tts, and one that// a bunch of utility functions of the form parse_<thing>_from_<source>}    }        v        }            None => panic!("Input too large, ran out of node ids!")            Some(next) => { self.node_id.set(next); }        match v.checked_add(count) {        let v = self.node_id.get();    pub fn reserve_node_ids(&self, count: ast::NodeId) -> ast::NodeId {    }        self.reserve_node_ids(1)    pub fn next_node_id(&self) -> ast::NodeId {impl ParseSess {}    }        node_id: Cell::new(1),        included_mod_stack: RefCell::new(Vec::new()),        span_diagnostic: sh,    ParseSess {pub fn new_parse_sess_special_handler(sh: SpanHandler) -> ParseSess {}    }        node_id: Cell::new(1),        included_mod_stack: RefCell::new(Vec::new()),        span_diagnostic: mk_span_handler(default_handler(Auto, None, true), CodeMap::new()),    ParseSess {pub fn new_parse_sess() -> ParseSess {}    pub node_id: Cell<ast::NodeId>,    included_mod_stack: RefCell<Vec<PathBuf>>,    /// Used to determine and report recursive mod inclusions    pub span_diagnostic: SpanHandler, // better be the same as the one in the reader!pub struct ParseSess {/// Info about a parsing session.pub mod obsolete;pub mod classify;pub mod common;pub mod attr;pub mod token;pub mod lexer;pub mod parser;#[macro_use]pub type PResult<T> = Result<T, FatalError>;use std::str;use std::rc::Rc;use std::path::{Path, PathBuf};use std::num::Int;#[allow(deprecated)] // Intuse std::iter;use std::io::Read;use std::fs::File;use std::cell::{Cell, RefCell};use ptr::P;use parse::parser::Parser;use parse::attr::ParserAttr;use diagnostic::{SpanHandler, mk_span_handler, default_handler, Auto, FatalError};use codemap::{Span, CodeMap, FileMap};use ast;//! The main parser interface// 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 2012-2014 The Rust Project Developers. See the COPYRIGHTad�S	'�R! �n)�
�
_
^

�a��98�
�
�
�
\
Q
P


�	�	e	[	U	S	R	}    }        }            Err(_) => panic!("could not get snippet"),            Ok(s) => assert_eq!(&s[..], "{ body }"),        match sess.span_diagnostic.cm.span_to_snippet(span) {        let span = tts.iter().rev().next().unwrap().get_span();        };            _ => panic!("not a macro"),            }                tts.clone()                let ast::MacInvocTT(_, ref tts, _) = mac.node;            ast::ExprMac(ref mac) => {        let tts = match expr.node {            "foo!( fn main() { body } )".to_string(), vec![], &sess);        let expr = parse::parse_expr_from_source_str("foo".to_string(),        let sess = parse::new_parse_sess();    fn ttdelim_span() {    #[test]    }        assert_eq!(&doc[..], "/** doc comment\n *  with CRLF */");        let doc = first_attr_value_str_by_name(&item.attrs, "doc").unwrap();        let item = parse_item_from_source_str(name, source, Vec::new(), &sess).unwrap();        let source = "/** doc comment\r\n *  with CRLF */\r\nfn foo() {}".to_string();        assert_eq!(&docs[..], b);        let b: &[_] = &["/// doc comment".to_string(), "/// line 2".to_string()];                    .map(|a| a.value_str().unwrap().to_string()).collect::<Vec<_>>();        let docs = item.attrs.iter().filter(|a| &*a.name() == "doc")        let item = parse_item_from_source_str(name.clone(), source, Vec::new(), &sess).unwrap();        let source = "/// doc comment\r\n/// line 2\r\nfn foo() {}".to_string();        assert_eq!(&doc[..], "/// doc comment");        let doc = first_attr_value_str_by_name(&item.attrs, "doc").unwrap();        let item = parse_item_from_source_str(name.clone(), source, Vec::new(), &sess).unwrap();