about summary refs log tree commit diff
path: root/src/libsyntax/ext/quote.rs
AgeCommit message (Collapse)AuthorLines
2016-12-30Such large. Very 128. Much bits.Simonas Kazlauskas-2/+4
This commit introduces 128-bit integers. Stage 2 builds and produces a working compiler which understands and supports 128-bit integers throughout. The general strategy used is to have rustc_i128 module which provides aliases for iu128, equal to iu64 in stage9 and iu128 later. Since nowhere in rustc we rely on large numbers being supported, this strategy is good enough to get past the first bootstrap stages to end up with a fully working 128-bit capable compiler. In order for this strategy to work, number of locations had to be changed to use associated max_value/min_value instead of MAX/MIN constants as well as the min_value (or was it max_value?) had to be changed to use xor instead of shift so both 64-bit and 128-bit based consteval works (former not necessarily producing the right results in stage1). This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-5/+4
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-5/+6
2016-11-20Refactor `P<ast::MetaItem>` -> `ast::MetaItem`.Jeffrey Seyfried-2/+2
2016-11-20Refactor away `ast::Attribute_`.Jeffrey Seyfried-2/+2
2016-11-03Reduce the size of `Token` and make it cheaper to clone by refactoringJeffrey Seyfried-22/+32
`Token::Interpolated(Nonterminal)` -> `Token::Interpolated(Rc<Nonterminal>)`.
2016-10-31Changed most vec! invocations to use square bracesiirelu-31/+31
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-29Move `CrateConfig` from `Crate` to `ParseSess`.Jeffrey Seyfried-13/+1
2016-10-14Avoid many CrateConfig clones.Nicholas Nethercote-5/+9
This commit changes `ExtCtx::cfg()` so it returns a `CrateConfig` reference instead of a clone. As a result, it also changes all of the `cfg()` callsites to explicitly clone... except one, because the commit also changes `macro_parser::parse()` to take `&CrateConfig`. This is good, because that function can be hot, and `CrateConfig` is expensive to clone. This change almost halves the number of heap allocations done by rustc for `html5ever` in rustc-benchmarks suite, which makes compilation 1.20x faster.
2016-07-19Introduced `NoDelim` and modified the compiler to support it.cgswords-3/+4
2016-07-04Revert "Change `fold_tt` and `fold_tts` to take token trees by value ↵Jeffrey Seyfried-5/+11
(instead of by reference)" This reverts commit 5bf7970ac70b4e7781e7b2f3816720aa62fac6fd.
2016-06-26Rollup merge of #34436 - jseyfried:no_block_expr, r=eddybJeffrey Seyfried-13/+11
To allow these braced macro invocation, this PR removes the optional expression from `ast::Block` and instead uses a `StmtKind::Expr` at the end of the statement list. Currently, braced macro invocations in blocks can expand into statements (and items) except when they are last in a block, in which case they can only expand into expressions. For example, ```rust macro_rules! make_stmt { () => { let x = 0; } } fn f() { make_stmt! {} //< This is OK... let x = 0; //< ... unless this line is commented out. } ``` Fixes #34418.
2016-06-26Rollup merge of #34339 - jseyfried:thin_vec, r=petrochenkov,ManishearthJeffrey Seyfried-3/+3
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.
2016-06-26Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrcJeffrey Seyfried-11/+5
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-26Rollup merge of #34385 - cgswords:tstream, r=nrcJeffrey Seyfried-9/+12
syntax-[breaking-change] cc #31645 (Only breaking because ast::TokenTree is now tokenstream::TokenTree.) This pull request refactors TokenTrees into their own file as src/libsyntax/tokenstream.rs, moving them out of src/libsyntax/ast.rs, in order to prepare for an accompanying TokenStream implementation (per RFC 1566).
2016-06-23Refactor away duplicate method `ecx.block_all()`Jeffrey Seyfried-3/+3
2016-06-23Remove field `expr` of `ast::Block`Jeffrey Seyfried-13/+11
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-2/+3
2016-06-21Refactored tokentrees into their own files in preparation for tokenstreams. ↵cgswords-9/+12
Modified tests to point to the new file now.
2016-06-19Generalize and abstract `ThinAttributes`Jeffrey Seyfried-3/+3
2016-06-14Change `fold_tt` and `fold_tts` to take token trees by value (instead of by ↵Jeffrey Seyfried-11/+5
reference)
2016-05-31simplify HR subtyping back to what we did beforeNiko Matsakis-1/+1
A lot of the refactors, however, seem helpful, so leave those in, particularly since we may want to make this change in the future.
2016-04-24syntax: Check paths in visibilities for type parametersVadim Petrochenkov-5/+6
syntax: Merge PathParsingMode::NoTypesAllowed and PathParsingMode::ImportPrefix syntax: Rename PathParsingMode and its variants to better express their purpose syntax: Remove obsolete error message about 'self lifetime syntax: Remove ALLOW_MODULE_PATHS workaround syntax/resolve: Adjust some error messages resolve: Compare unhygienic (not renamed) names with keywords::Invalid, invalid identifiers may appear to be valid after renaming
2016-04-24syntax: Get rid of token::IdentStyleVadim Petrochenkov-19/+6
2016-03-15syntax: impl ToTokens for P<ast::ImplItem>Richo Healey-0/+6
2016-02-16Move more uses of `panictry!` out of libsyntaxJonas Schievink-20/+22
[breaking-change] for syntax extensions
2016-02-11Remove some unnecessary indirection from AST structuresVadim Petrochenkov-12/+14
2016-02-11[breaking-change] don't glob export ast::StrStyle variantsOliver 'ker' Schneider-1/+1
2016-02-11[breaking-change] don't glob export ast::Visibility variantsOliver 'ker' Schneider-1/+1
2016-02-11[breaking-change] don't glob export ast::KleeneOp variantsOliver 'ker' Schneider-7/+9
2016-02-11[breaking-change] don't pub export ast::IntLitType variantsOliver Schneider-2/+2
2016-02-11[breaking-change] don't pub export ast::Lit_ variantsOliver Schneider-5/+5
2016-02-11[breaking-change] remove the sign from integer literals in the astOliver Schneider-3/+21
2016-02-11[breaking-change] don't glob export ast::{UintTy, IntTy} variantsOliver Schneider-11/+11
2016-02-11[breaking-change] don't glob export ast::Expr_ variantsOliver Schneider-1/+1
2015-12-31Cut out a bunch of Result and panictry! boilerplate from libsyntax.Nick Cameron-1/+1
[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
2015-12-30use structured errorsNick Cameron-1/+1
2015-12-17Remove unused importsJeffrey Seyfried-2/+2
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-1/+1
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-26Add syntax support for attributes on expressions and all syntaxMarvin Löbel-0/+1
nodes in statement position. Extended #[cfg] folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. Extended lint checker to recognize lint levels on expressions and locals.
2015-11-17Fix match_ref_pats flagged by ClippySeo Sanghyeon-3/+3
2015-11-13Move the panicking parse functions out of the parserKyle Mayes-3/+52
Since these functions are only used by the AST quoting syntax extensions, they should be there instead of in the parser.
2015-11-13Auto merge of #29761 - eefriedman:rename-nopanic, r=sanxiynbors-1/+1
Just `sed s/_nopanic//g`. Hopefully makes libsyntax a bit more readable.
2015-11-11libsyntax: Add more quasiquoting macrosKyle Mayes-0/+51
2015-11-10Rename _nopanic methods to remove the suffix.Eli Friedman-1/+1
Just `sed s/_nopanic//g`. Hopefully makes libsyntax a bit more readable.
2015-11-06remove `Tt` prefix from TokenType variantsOliver Schneider-46/+53
[breaking change]
2015-10-28Make quote plugin use parsing functions which explicitly panic.Eli Friedman-7/+7
Rename parse_* to parse_*_panic, and add parse_attribute_panic.
2015-10-27Don't use panicking helpers in Parser.Eli Friedman-1/+1
2015-10-01Stop re-exporting AttrStyle's variants and rename them.Ms2ger-1/+1
2015-09-24Cleanup interfaces of Name, SyntaxContext and IdentVadim Petrochenkov-8/+9
Make sure Name, SyntaxContext and Ident are passed by value Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined