summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
AgeCommit message (Collapse)AuthorLines
2016-05-16Remove hir::IdentVadim Petrochenkov-0/+4
2016-05-15Auto merge of #33505 - petrochenkov:self, r=nrcbors-18/+65
Remove ExplicitSelf from HIR `self` argument is already kept in the argument list and can be retrieved from there if necessary, so there's no need for the duplication. The same changes can be applied to AST, I'll make them in the next breaking batch. The first commit also improves parsing of method declarations and fixes https://github.com/rust-lang/rust/issues/33413. r? @eddyb
2016-05-14syntax: Refactor parsing of method declarationsVadim Petrochenkov-18/+65
Fix spans and expected token lists, fix #33413 + other cosmetic improvements Add test for #33413 Convert between `Arg` and `ExplicitSelf` precisely Simplify pretty-printing for methods
2016-05-11save-analysis: give better text info in value fieldsNick Cameron-4/+1
2016-05-09Move resolution to before loweringJeffrey Seyfried-0/+38
2016-04-25Rollup merge of #33041 - petrochenkov:path, r=nrc,ManishearthManish Goregaokar-11/+9
Paths are mostly parsed without taking whitespaces into account, e.g. `std :: vec :: Vec :: new ()` parses successfully, however, there are some special cases involving keywords `super`, `self` and `Self`. For example, `self::` is considered a path start only if there are no spaces between `self` and `::`. These restrictions probably made sense when `self` and friends weren't keywords, but now they are unnecessary. The first two commits remove this special treatment of whitespaces by removing `token::IdentStyle` entirely and therefore fix https://github.com/rust-lang/rust/issues/14109. This change also affects naked `self` and `super` (which are not tightly followed by `::`, obviously) they can now be parsed as paths, however they are still not resolved correctly in imports (cc @jseyfried, see `compile-fail/use-keyword.rs`), so https://github.com/rust-lang/rust/issues/29036 is not completely fixed. The third commit also makes `super`, `self`, `Self` and `static` keywords nominally (before this they acted as keywords for all purposes) and removes most of remaining \"special idents\". The last commit (before tests) contains some small improvements - some qualified paths with type parameters are parsed correctly, `parse_path` is not used for parsing single identifiers, imports are sanity checked for absence of type parameters - such type parameters can be generated by syntax extensions or by macros when https://github.com/rust-lang/rust/issues/10415 is fixed (~~soon!~~already!). This patch changes some pretty basic things in `libsyntax`, like `token::Token` and the keyword list, so it's a plugin-[breaking-change]. r? @eddyb
2016-04-24Remove some old code from libsyntaxVadim Petrochenkov-3/+3
2016-04-24syntax: Make static/super/self/Self keywords + special ident cleanupVadim Petrochenkov-1/+1
2016-04-24syntax: Get rid of token::IdentStyleVadim Petrochenkov-7/+5
2016-04-24thread tighter span for closures aroundNiko Matsakis-1/+3
Track the span corresponding to the `|...|` part of the closure.
2016-04-14Add a span to the `Crate` variant of `ast::Visibility`Jeffrey Seyfried-1/+1
2016-04-06Rollup merge of #32570 - eddyb:tis-but-a-front, r=nikomatsakisManish Goregaokar-0/+17
r? @nikomatsakis Conflicts: src/librustc_save_analysis/lib.rs src/libsyntax/ast_util.rs
2016-04-06Move span into `StructField`Vadim Petrochenkov-3/+2
2016-04-06Get rid of ast::StructFieldKindVadim Petrochenkov-33/+2
2016-04-06syntax: dismantle ast_util.Eduard Burtescu-0/+17
2016-04-02Add `Crate` and `Restricted` variants to `ast::Visibility`Jeffrey Seyfried-0/+2
2016-04-02Make `ast::Visibility` non-copyableJeffrey Seyfried-4/+4
2016-04-02Remove `ast::Visibility::inherit_from` (it is unused and has obsolete semantics)Jeffrey Seyfried-9/+0
2016-03-24fatal error instead of ICE for impossible range during HIR loweringAlex Burka-0/+5
End-less ranges (`a...`) don't parse but bad syntax extensions could conceivably produce them. Unbounded ranges (`...`) do parse and are caught here. The other panics in HIR lowering are all for unexpanded macros, which cannot be constructed by bad syntax extensions.
2016-03-22try! -> ?Jorge Aparicio-2/+2
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-14Add `default` as contextual keyword, and parse it for impl items.Aaron Turon-4/+11
2016-03-12Removed integer suffixes in libsyntax cratesrinivasreddy-3/+3
2016-03-09Auto merge of #31631 - jonas-schievink:agoraphobia, r=nrcbors-1/+1
[breaking-batch] Move more uses of `panictry!` out of libsyntax
2016-03-07implement the `?` operatorJorge Aparicio-0/+3
The `?` postfix operator is sugar equivalent to the try! macro, but is more amenable to chaining: `File::open("foo")?.metadata()?.is_dir()`. `?` is accepted on any *expression* that can return a `Result`, e.g. `x()?`, `y!()?`, `{z}?`, `(w)?`, etc. And binds more tightly than unary operators, e.g. `!x?` is parsed as `!(x?)`. cc #31436
2016-02-27libsyntax: parse inclusive rangesAlex Burka-2/+11
2016-02-16Move more uses of `panictry!` out of libsyntaxJonas Schievink-1/+1
[breaking-change] for syntax extensions
2016-02-16Split PatKind::Enum into PatKind::TupleStruct and PatKind::PathVadim Petrochenkov-1/+1
2016-02-13Split ast::PatKind::Enum into tuple struct and path patternsVadim Petrochenkov-10/+16
2016-02-13Rename ast::Pat_ and its variantsVadim Petrochenkov-19/+18
2016-02-11Remove some unnecessary indirection from AST structuresVadim Petrochenkov-7/+7
2016-02-11[breaking-change] don't glob export ast::PathListItem_ variantsOliver 'ker' Schneider-10/+9
2016-02-11[breaking-change] don't glob export ast::StrStyle variantsOliver 'ker' Schneider-3/+2
2016-02-11[breaking-change] don't glob export ast::Visibility variantsOliver 'ker' Schneider-3/+2
2016-02-11[breaking-change] don't glob export ast::TraitItemKind variantsOliver 'ker' Schneider-6/+5
2016-02-11[breaking-change] don't glob export ast::Mutablity variantsOliver 'ker' Schneider-3/+2
2016-02-11[breaking-change] don't glob export ast::MetaItem_Oliver 'ker' Schneider-15/+15
2016-02-11[breaking-change] don't glob export ast::MacStmtStyleOliver 'ker' Schneider-4/+3
2016-02-11[breaking-change] don't glob export ast::KleeneOp variantsOliver 'ker' Schneider-1/+0
2016-02-11[breaking-change] don't glob export ast::Item_ variantsOliver 'ker' Schneider-33/+32
2016-02-11[breaking-change] don't glob export ast::ForeignItem_ variantsOliver 'ker' Schneider-8/+7
2016-02-11[breaking-change] don't pub export ast::Stmt_ variantsOliver Schneider-17/+16
2016-02-11[breaking-change] don't pub export ast::IntLitType variantsOliver Schneider-4/+3
2016-02-11[breaking-change] don't pub export ast::Lit_ variantsOliver Schneider-13/+12
2016-02-11[breaking-change] don't pub export ast::Ty_ variantsOliver Schneider-18/+17
2016-02-11[breaking-change] remove unused enum ast::PrimTyOliver Schneider-12/+0
2016-02-11[breaking-change] remove the sign from integer literals in the astOliver Schneider-28/+2
2016-02-11[breaking-change] don't glob export ast::{UintTy, IntTy} variantsOliver Schneider-40/+38
2016-02-11[breaking-change] don't glob export ast::FloatTy variantsOliver Schneider-7/+6
2016-02-11[breaking-change] don't glob export ast::Expr_ variantsOliver Schneider-40/+39
2016-02-11[breaking-change] don't glob export ast::ExplicitSelf_ variantsOliver Schneider-7/+6