summary refs log tree commit diff
path: root/src/libsyntax/ext/tt/transcribe.rs
AgeCommit message (Collapse)AuthorLines
2016-11-04Remove field `TtReader::next_tok`.Jeffrey Seyfried-5/+0
2016-11-03Move doc comment desugaring into the parser.Jeffrey Seyfried-27/+1
2016-11-03Revert "macros: Improve `tt` fragments"Jeffrey Seyfried-13/+3
This reverts commit 41745f30f751364bdce14428b7d3ffa5dd028903.
2016-11-03Reduce the size of `Token` and make it cheaper to clone by refactoringJeffrey Seyfried-13/+11
`Token::Interpolated(Nonterminal)` -> `Token::Interpolated(Rc<Nonterminal>)`.
2016-10-25Use `SmallVector` for `TtReader::stack`.Nicholas Nethercote-3/+4
This avoids 800,000 heap allocations when compiling html5ever. It requires tweaking `SmallVector` a little.
2016-10-19Improve `$crate`.Jeffrey Seyfried-29/+2
2016-10-17Fix partially consumed tokens in macro matchers.Jeffrey Seyfried-0/+5
2016-08-07Make metavariables hygienic.Jeffrey Seyfried-5/+5
2016-07-23macros: Improve `tt` fragmentsJeffrey Seyfried-3/+13
2016-07-06Auto merge of #34652 - jseyfried:fix_expansion_perf, r=nrcbors-2/+2
Fix expansion performance regression **syntax-[breaking-change] cc #31645** This fixes #34630 by reverting commit 5bf7970 of PR #33943, which landed in #34424. By removing the `Rc<_>` wrapping around `Delimited` and `SequenceRepetition` in `TokenTree`, 5bf7970 made cloning `TokenTree`s more expensive. While this had no measurable performance impact on the compiler's crates, it caused an order of magnitude performance regression on some macro-heavy code in the wild. I believe this is due to clones of `TokenTree`s in `macro_parser.rs` and/or `macro_rules.rs`. r? @nrc
2016-07-04Revert "Change `fold_tt` and `fold_tts` to take token trees by value ↵Jeffrey Seyfried-2/+2
(instead of by reference)" This reverts commit 5bf7970ac70b4e7781e7b2f3816720aa62fac6fd.
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-6/+3
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-06-26Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrcJeffrey Seyfried-2/+2
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-26Rollup merge of #34385 - cgswords:tstream, r=nrcJeffrey Seyfried-7/+7
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-23Move errors from libsyntax to its own crateJonathan Turner-1/+1
2016-06-21Refactored tokentrees into their own files in preparation for tokenstreams. ↵cgswords-7/+7
Modified tests to point to the new file now.
2016-06-14Change `fold_tt` and `fold_tts` to take token trees by value (instead of by ↵Jeffrey Seyfried-2/+2
reference)
2016-04-27Make some fatal lexer errors recoverablemitaa-1/+3
2016-04-24syntax: Get rid of token::IdentStyleVadim Petrochenkov-6/+6
2016-02-18Remove unnecessary explicit lifetime bounds.Corey Farwell-11/+11
These explicit lifetimes can be ommitted because of lifetime elision rules. Instances were found using rust-clippy.
2016-02-11[breaking-change] don't glob export ast::KleeneOp variantsOliver 'ker' Schneider-2/+2
2015-12-18Rollup merge of #30384 - nrc:diagnostics, r=@nikomatsakisManish Goregaokar-4/+4
Should make it possible to add JSON or HTML errors. Also tidies up a lot.
2015-12-17Remove unused importsJeffrey Seyfried-1/+1
2015-12-17move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*Nick Cameron-4/+4
Also split out emitters into their own module.
2015-12-15Generated code spans now point to callsite parameters (where applicable)Daniel Campbell-2/+2
2015-11-06remove `Tt` prefix from TokenType variantsOliver Schneider-21/+21
[breaking change]
2015-09-24Cleanup interfaces of Name, SyntaxContext and IdentVadim Petrochenkov-5/+5
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
2015-08-15Fix span of invalid metavariable repetitionJonas Schievink-1/+1
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-6/+4
2015-04-21syntax: remove #![feature(box_syntax, box_patterns)]Erick Tryzelaar-2/+2
2015-04-05Work towards a non-panicing parser (libsyntax)Phil Dawes-7/+7
- Functions in parser.rs return PResult<> rather than panicing - Other functions in libsyntax call panic! explicitly for now if they rely on panicing behaviour. - 'panictry!' macro added as scaffolding while converting panicing functions. (This does the same as 'unwrap()' but is easier to grep for and turn into try!()) - Leaves panicing wrappers for the following functions so that the quote_* macros behave the same: - parse_expr, parse_item, parse_pat, parse_arm, parse_ty, parse_stmt
2015-02-18Round 3 test fixes and conflictsAlex Crichton-1/+1
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-1/+1
2015-02-02Omit integer suffix when unnecessaryAlfie John-1/+1
See PR # 21378 for context
2015-01-18libsyntax: 0u -> 0us, 0i -> 0isPaul Collier-1/+1
2015-01-17libsyntax: uint types to usizePaul Collier-4/+4
2015-01-07use slicing sugarJorge Aparicio-3/+3
2015-01-06rollup merge of #19430: pczarn/interp_tt-cleanupAlex Crichton-11/+23
Conflicts: src/libsyntax/parse/parser.rs
2015-01-07Cleanup and followup to PR #17830: parsing changesPiotr Czarnecki-11/+23
Prevents breaking down `$name` tokens into separate `$` and `name`. Reports unknown macro variables. Fixes #18775 Fixes #18839 Fixes #15640
2015-01-06rollup merge of #20481: seanmonstar/fmt-show-stringAlex Crichton-2/+2
Conflicts: src/compiletest/runtest.rs src/libcore/fmt/mod.rs src/libfmt_macros/lib.rs src/libregex/parse.rs src/librustc/middle/cfg/construct.rs src/librustc/middle/dataflow.rs src/librustc/middle/infer/higher_ranked/mod.rs src/librustc/middle/ty.rs src/librustc_back/archive.rs src/librustc_borrowck/borrowck/fragments.rs src/librustc_borrowck/borrowck/gather_loans/mod.rs src/librustc_resolve/lib.rs src/librustc_trans/back/link.rs src/librustc_trans/save/mod.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/callee.rs src/librustc_trans/trans/common.rs src/librustc_trans/trans/consts.rs src/librustc_trans/trans/controlflow.rs src/librustc_trans/trans/debuginfo.rs src/librustc_trans/trans/expr.rs src/librustc_trans/trans/monomorphize.rs src/librustc_typeck/astconv.rs src/librustc_typeck/check/method/mod.rs src/librustc_typeck/check/mod.rs src/librustc_typeck/check/regionck.rs src/librustc_typeck/collect.rs src/libsyntax/ext/format.rs src/libsyntax/ext/source_util.rs src/libsyntax/ext/tt/transcribe.rs src/libsyntax/parse/mod.rs src/libsyntax/parse/token.rs src/test/run-pass/issue-8898.rs
2015-01-06core: split into fmt::Show and fmt::StringSean McArthur-2/+2
fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of #20013 [breaking-change]
2015-01-07Replace full slice notation with index callsNick Cameron-2/+2
2015-01-05Add a special macro nonterminal $crateKeegan McAllister-1/+28
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-3/+3
2015-01-03use assoc types in binop traitsJorge Aparicio-1/+3
2014-12-21Fallout of std::str stabilizationAlex Crichton-2/+2
2014-12-19Register new snapshotsAlex Crichton-24/+0
This does not yet start the movement to rustc-serialize. That detail is left to a future PR.
2014-12-13libsyntax: convert `LockstepIterSize` binops to by valueJorge Aparicio-0/+24
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+1
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-16fallout from deprecating find_copy and get_copyAlexis Beingessner-1/+1