syntex_syntax 0.12.0

Export of libsyntax for code generation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
b0VIM 7.4X5U�_��ericktErick-Tryzelaar-MBP.local~erickt/projects/rust/rust/src/libsyntax/parse/lexer/mod.rs
3210#"! Utpt��������gu��������[���������n7��������T���������_���������`X��������X���������L��������g\��������]���������` ��������S���������b���������g5��������v���������h��������Zz!�ad�t�{XU��M)(�
�
�
�
�
f
e
O
@
2

�������b4���k?�
�
�
t
I
6



�	�	�	�	�	�	�	�	�		a	7	���i8"�����nm"����<�����w4��tVF@�����zT=�������}wH#���        r        debug!("TtReader: r={:?}", r);        let r = tt_next_token(self);    fn next_token(&mut self) -> TokenAndSpan {    }        self.cur_tok == token::Eof    fn is_eof(&self) -> bool {impl<'a> Reader for TtReader<'a> {}    }        }            sp: self.peek_span,            tok: self.peek_tok.clone(),        TokenAndSpan {        // FIXME(pcwalton): Bad copy!    fn peek(&self) -> TokenAndSpan {    }        self.err_span(self.peek_span, m)    fn err(&self, m: &str) {    }        self.fatal_span(self.peek_span, m)    fn fatal(&self, m: &str) -> ! {    }        ret_val        self.advance_token();        };            sp: self.peek_span,            tok: replace(&mut self.peek_tok, token::Underscore),        let ret_val = TokenAndSpan {    fn next_token(&mut self) -> TokenAndSpan {    /// Return the next token. EFFECT: advances the string_reader.    fn is_eof(&self) -> bool { self.curr.is_none() }impl<'a> Reader for StringReader<'a> {}    source_text: Rc<String>    // retrieve it via `self.filemap.src.as_ref().unwrap()` all the time.    // cache a direct reference to the source text, so that we don't have to    read_embedded_ident: bool,    /// Is \x00<name>,<ctxt>\x00 is interpreted as encoded ast::Ident?    // are revised to go directly to token-trees.    // FIXME (Issue #16472): This field should go away after ToToken impls    pub peek_span: Span,    pub peek_tok: token::Token,    /* cached: */    pub filemap: Rc<codemap::FileMap>,    pub curr: Option<char>,    /// The last character to be read    pub col: CharPos,    /// The column of the next character to read    pub last_pos: BytePos,    /// The absolute offset within the codemap of the last character read(curr)    pub pos: BytePos,    /// The absolute offset within the codemap of the next character to read    pub span_diagnostic: &'a SpanHandler,pub struct StringReader<'a> {}    pub sp: Span,    pub tok: token::Token,pub struct TokenAndSpan {#[derive(Clone, PartialEq, Eq, Debug)]}    }        t        }            }                _ => break                },                    t = self.next_token();                token::Whitespace | token::Comment | token::Shebang(_) => {            match t.tok {        loop {        let mut t = self.next_token();    fn real_token(&mut self) -> TokenAndSpan {    /// Get a token the parser cares about.    fn peek(&self) -> TokenAndSpan;    fn err(&self, &str);    /// Report a non-fatal error with the current span.    fn fatal(&self, &str) -> !;    /// Report a fatal error with the current span.    fn next_token(&mut self) -> TokenAndSpan;    fn is_eof(&self) -> bool;pub trait Reader {pub mod comments;pub use ext::tt::transcribe::{TtReader, new_tt_reader, new_tt_reader_with_doc_flag};use std::rc::Rc;use std::mem::{replace, transmute};use std::fmt;use std::char;use std::borrow::Cow;use parse::token::str_to_ident;use parse::token;use ext::tt::transcribe::tt_next_token;use diagnostic::SpanHandler;use codemap;use codemap::{BytePos, CharPos, CodeMap, Pos, Span};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 2012-2013 The Rust Project Developers. See the COPYRIGHTad�	�
!���^]��7�
�
P

����l?���b?�
�
�
�
�
}    }        assert_eq!(lexer.next_token().tok, token::Literal(token::Char(token::intern("a")), None));        }            _ => panic!("expected a comment!")            token::Comment => { },        match lexer.next_token().tok {        let mut lexer = setup(&sh, "/* /* */ */'a'".to_string());        let sh = mk_sh();    #[test] fn nested_block_comments() {    }        assert!(!is_doc_comment("////"));        assert!(is_doc_comment("/// blah"));        assert!(is_doc_comment("///"));    #[test] fn line_doc_comments() {    }                                  Some(token::intern("suffix"))));                   token::Literal(token::BinaryRaw(token::intern("raw"), 3),        assert_eq!(setup(&mk_sh(), "br###\"raw\"###suffix".to_string()).next_token().tok,                                  Some(token::intern("suffix"))));                   token::Literal(token::StrRaw(token::intern("raw"), 3),        assert_eq!(setup(&mk_sh(), "r###\"raw\"###suffix".to_string()).next_token().tok,                                  Some(token::intern("us"))));                   token::Literal(token::Integer(token::intern("2")),        assert_eq!(setup(&mk_sh(), "2us".to_string()).next_token().tok,        test!("1.0e10", Float, "1.0e10");        test!("1.0", Float, "1.0");        test!("0xABC", Integer, "0xABC");        test!("0b101", Integer, "0b101");