Jeffrey Seyfried
9bb3ea0feb
Rollup merge of #34436 - jseyfried:no_block_expr, r=eddyb
...
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-26 02:20:14 +00:00
Jeffrey Seyfried
8748cd92d0
Rollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddyb
...
Refactor away `ast::Decl`, refactor `ast::Stmt`, and rename `ast::ExprKind::Again` to `ast::ExprKind::Continue`.
2016-06-26 02:17:27 +00:00
Jeffrey Seyfried
82a15a6a0a
Rollup merge of #34385 - cgswords:tstream, r=nrc
...
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-26 02:11:59 +00:00
Jeffrey Seyfried
b7da35a5aa
Remove field expr
of ast::Block
2016-06-23 17:42:08 +00:00
Jonathan Turner
6ae3502134
Move errors from libsyntax to its own crate
2016-06-23 08:07:35 -04:00
cgswords
d59accfb06
Refactored tokentrees into their own files in preparation for tokenstreams. Modified tests to point to the new file now.
2016-06-21 11:12:36 -07:00
Jeffrey Seyfried
962d5c16b5
Fix fallout
2016-06-17 05:21:23 +00:00
Wang Xuerui
2ea6c70a1a
syntax_ext: format: remove reference to methods in comment
2016-05-16 17:16:32 +08:00
Wang Xuerui
067284b291
syntax_ext: format: nest_level's are no more
...
`nest_level` is long dead since cac7a2053aba7be214d5e58e13867089638a8f50
(PR #14831 ), so is `check_positional_ok()`. Let's bid them farewell.
2016-05-16 16:59:27 +08:00
Vadim Petrochenkov
b32d7b5923
syntax: Merge keywords and remaining special idents in one list
...
Simplify the macro used for generation of keywords
Make `Keyword::ident` private
2016-04-24 20:59:44 +03:00
Vadim Petrochenkov
e2c821d35e
syntax: Make static/super/self/Self keywords + special ident cleanup
2016-04-24 20:59:44 +03:00
Vadim Petrochenkov
546c052d22
syntax: Get rid of token::IdentStyle
2016-04-24 20:59:44 +03:00
Vadim Petrochenkov
77cc5764b9
Remove some unnecessary indirection from AST structures
2016-02-11 23:33:09 +03:00
Oliver 'ker' Schneider
73fa9b2da2
[breaking-change] don't glob export ast::Mutablity variants
2016-02-11 12:34:48 +01:00
Oliver 'ker' Schneider
019614f03d
[breaking-change] don't glob export ast::Item_ variants
2016-02-11 12:34:48 +01:00
Oliver Schneider
8290c950a8
[breaking-change] don't pub export ast::Stmt_ variants
2016-02-11 12:34:48 +01:00
Oliver Schneider
69072c4f5d
[breaking-change] don't pub export ast::Lit_ variants
2016-02-11 12:34:48 +01:00
Oliver Schneider
05d4cefd63
[breaking-change] don't pub export ast::Ty_ variants
2016-02-11 12:34:48 +01:00
Oliver Schneider
80bf9ae18a
[breaking-change] don't glob export ast::Expr_ variants
2016-02-11 12:34:48 +01:00
Oliver Schneider
79fa657abc
[breaking-change] don't glob export ast::Decl_ variants
2016-02-11 12:34:48 +01:00
Daniel Campbell
616bfb6f15
Extended save-analysis to support generated code, alterned some spans in format_args! and derive to maintain compatability
2016-01-22 19:12:51 +13:00
Nick Cameron
9023c659af
Cut out a bunch of Result and panictry! boilerplate from libsyntax.
...
[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
2015-12-31 14:29:02 +13:00
Nick Cameron
95dc7efad0
use structured errors
2015-12-30 14:27:59 +13:00
Seo Sanghyeon
f9ba107824
Move built-in syntax extensions to a separate crate
2015-12-15 15:04:46 +09:00