summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2016-06-29Refactor away `parser.commit_stmt_expecting()`Jeffrey Seyfried-5/+1
2016-06-29Treat `MultiDecorator`s as a special case of `MultiModifier`sJeffrey Seyfried-78/+33
2016-06-28cleanup: refactor away `ast::NodeIdAssigner`Jeffrey Seyfried-10/+0
2016-06-28cleanup: use `DummyResult` to implement `MacroGenerable::dummy`Jeffrey Seyfried-19/+17
2016-06-28cleanup: don't count attributes on an item in a statement position as on the ↵Jeffrey Seyfried-8/+3
statement
2016-06-27Auto merge of #34424 - jseyfried:breaking_batch, r=Manishearthbors-5165/+2221
Batch up libsyntax breaking changes Batch of the following syntax-[breaking-change] changes: - #34213: Add a variant `Macro` to `TraitItemKind` - #34368: Merge the variant `QPath` of `PatKind` into the variant `PatKind::Path` - #34385: Move `syntax::ast::TokenTree` into a new module `syntax::tokenstream` - #33943: - Remove the type parameter from `visit::Visitor` - Remove `attr::WithAttrs` -- use `attr::HasAttrs` instead. - Change `fold_tt`/`fold_tts` to take token trees by value and avoid wrapping token trees in `Rc`. - Remove the field `ctxt` of `ast::Mac_` - Remove inherent method `attrs()` of types -- use the method `attrs` of `HasAttrs` instead. - #34316: - Remove `ast::Decl`/`ast::DeclKind` and add variants `Local` and `Item` to `StmtKind`. - Move the node id for statements from the `StmtKind` variants to a field of `Stmt` (making `Stmt` a struct instead of an alias for `Spanned<StmtKind>`) - Rename `ast::ExprKind::Again` to `Continue`. - #34339: Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>` - Use `.into()` in convert between `Vec<Attribute>` and `ThinVec<Attribute>` - Use autoderef instead of `.as_attr_slice()` - #34436: Remove the optional expression from `ast::Block` and instead use a `StmtKind::Expr` at the end of the statement list. - #34403: Move errors into a separate crate (unlikely to cause breakage)
2016-06-27Fix `Cargo.toml`sJeffrey Seyfried-1/+2
2016-06-27Forbid type parameters and global paths in macro invocationsJeffrey Seyfried-1/+1
2016-06-26Auto merge of #34450 - jseyfried:fix_include_path, r=nrcbors-1/+2
Revert a change to the relative path for macro-expanded `include!`s Fixes #34431 (c.f. discussion in that issue). r? @nrc
2016-06-26Rollup merge of #34436 - jseyfried:no_block_expr, r=eddybJeffrey Seyfried-96/+72
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-202/+177
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.
2016-06-26Rollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddybJeffrey Seyfried-349/+289
Refactor away `ast::Decl`, refactor `ast::Stmt`, and rename `ast::ExprKind::Again` to `ast::ExprKind::Continue`.
2016-06-26Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrcJeffrey Seyfried-333/+237
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-26Rollup merge of #34385 - cgswords:tstream, r=nrcJeffrey Seyfried-262/+304
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-25Rollup merge of #34403 - jonathandturner:move_liberror, r=alexcrichtonJeffrey Seyfried-3852/+994
This PR refactors the 'errors' part of libsyntax into its own crate (librustc_errors). This is the first part of a few refactorings to simplify error reporting and potentially support more output formats (like a standardized JSON output and possibly an --explain mode that can work with the user's code), though this PR stands on its own and doesn't assume further changes. As part of separating out the errors crate, I have also refactored the code position portion of codemap into its own crate (libsyntax_pos). While it's helpful to have the common code positions in a separate crate for the new errors crate, this may also enable further simplifications in the future.
2016-06-25Rollup merge of #34368 - petrochenkov:astqpath, r=ManishearthJeffrey Seyfried-30/+18
The AST part of https://github.com/rust-lang/rust/pull/34365 plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645
2016-06-25Rollup merge of #34213 - josephDunne:trait_item_macros, r=jseyfriedJeffrey Seyfried-87/+175
**syntax-[breaking-change]** cc #31645 New `TraitItemKind::Macro` variant This change adds support for macro expansion inside trait items by adding the new `TraitItemKind::Macro` and associated parsing code.
2016-06-24reexport errors from syntax. fix failing cfail testJonathan Turner-1/+4
2016-06-24Fix codemap tests to not double importJonathan Turner-1/+0
2016-06-24Improve `syntax::ast::*` type docs (examples, etc)Vincent Esche-36/+135
2016-06-24Reexport syntax_pos in codemap and fix some cfail testsJonathan Turner-1/+1
2016-06-24Revert a change to the relative path for macro-expanded `include!`sJeffrey Seyfried-1/+2
2016-06-24Add `ecx.stmt_semi()` and fix issues with the pretty-printerJeffrey Seyfried-3/+18
2016-06-23Refactor away duplicate method `ecx.block_all()`Jeffrey Seyfried-11/+6
2016-06-23make old school mode a bit more configurableJonathan Turner-18/+32
2016-06-23Remove field `expr` of `ast::Block`Jeffrey Seyfried-98/+52
2016-06-23Add missing refernce to RenderedLineJonathan Turner-1/+1
2016-06-23Move test helper functions to consolidated codemap testingJonathan Turner-63/+64
2016-06-23Actually consolidate the CodeMap testsJonathan Turner-517/+517
2016-06-23Consolidate codemap tests and fix more errors for travisJonathan Turner-2/+821
2016-06-23Address more travis errorsJonathan Turner-4/+7
2016-06-23Address comments and fix travis warningJonathan Turner-2/+2
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-3850/+153
2016-06-23Auto merge of #34253 - jseyfried:improve_multi_modifiers, r=nrcbors-92/+66
Allow `MultiItemModifier`s to expand into zero or many items Fixes #34223. r? @nrc
2016-06-23Cleanup commentsJeffrey Seyfried-4/+4
2016-06-21Refactored tokentrees into their own files in preparation for tokenstreams. ↵cgswords-262/+304
Modified tests to point to the new file now.
2016-06-20Merge PatKind::QPath into PatKind::Path in ASTVadim Petrochenkov-30/+18
2016-06-20Remove unit testsJeffrey Seyfried-445/+3
2016-06-20Fix hygiene regressionJeffrey Seyfried-151/+44
2016-06-18Auto merge of #34295 - jseyfried:cfg_decoration, r=eddybbors-6/+25
Perform `cfg` attribute processing on decorator-generated items Fixes https://users.rust-lang.org/t/unused-attribute-warning-for-custom-derive-attribute/6180. r? @nrc
2016-06-19Generalize and abstract `ThinAttributes`Jeffrey Seyfried-202/+181
2016-06-18Auto merge of #34310 - erickt:tuple-struct-attrs, r=nrcbors-1/+2
Pretty-print attributes on tuple structs and add tests This adds support to the pretty printer to print attributes added to tuple struct elements. Furthermore, it adds a test that makes sure we will print attributes on all variant data types.
2016-06-17Fix panic when using debugGuillaume Gomez-1/+1
2016-06-17Pretty-print attributes on tuple structs and add testsErick Tryzelaar-1/+2
This adds support to the pretty printer to print attributes added to tuple struct elements. Furthermore, it adds a test that makes sure we will print attributes on all variant data types.
2016-06-17Rename `ast::ExprKind::Again` -> `ast::ExprKind::Continue`Jeffrey Seyfried-6/+6
2016-06-17Fix falloutJeffrey Seyfried-328/+267
2016-06-17Refactor away `ast::Decl` and refactor `ast::Stmt`Jeffrey Seyfried-16/+14
2016-06-16Auto merge of #34315 - Manishearth:rollup, r=Manishearthbors-859/+859
Rollup of 4 pull requests - Successful merges: #34298, #34302, #34307, #34312 - Failed merges:
2016-06-17Rollup merge of #34312 - erickt:add-try, r=nikomatsakisManish Goregaokar-859/+859
Revert using ? for try! in the libsyntax pretty printer The use of ...?instead of try!(...) in libsyntax makes extracting libsyntax into syntex quite painful since it's not stable yet. This makes backports take a much longer time and causes a lot of problems for the syntex dependencies. Even if it was, it'd take a few release cycles until syntex would be able to use it. Since it's not stable and that this feature is just syntax sugar, it would be most helpful if we could remove it. cc #34311
2016-06-16Auto merge of #34272 - jseyfried:simplify_gated_cfg_checking, r=nrcbors-169/+95
Simplify gated cfg checking r? @nrc