about summary refs log tree commit diff
path: root/src/libsyntax/ast_util.rs
AgeCommit message (Collapse)AuthorLines
2016-04-06syntax: dismantle ast_util.Eduard Burtescu-398/+0
2016-04-02Make `ast::Visibility` non-copyableJeffrey Seyfried-1/+1
2016-02-13Rename ast::Pat_ and its variantsVadim Petrochenkov-2/+2
2016-02-11[breaking-change] don't glob export ast::Mutablity variantsOliver 'ker' Schneider-1/+2
2016-02-11[breaking-change] don't glob export ast::Item_ variantsOliver 'ker' Schneider-1/+1
2016-02-11[breaking-change] don't glob export ast::Expr_ variantsOliver Schneider-1/+1
2016-02-01Spans now derive equalityDaniel Campbell-1/+1
2015-12-22Stop re-exporting PathParameters's variants.Ms2ger-1/+1
2015-12-21Auto merge of #30460 - Ms2ger:BindingMode, r=alexcrichtonbors-1/+1
2015-12-20Stop re-exporting the ast::BindingMode variants.Ms2ger-1/+1
2015-12-18Deprecate name `OwnedSlice` and don't use itVadim Petrochenkov-3/+2
2015-12-14[breaking-change] move ast_util functions to methodsfaineance-155/+1
2015-11-23Avoid some code duplication around getting names of numeric types.Michael Woerister-24/+18
2015-11-18Rework the `IdVisitor` so that it only visits item contents (and doesn'tNiko Matsakis-18/+10
visit nested items). This is what all clients wanted anyhow.
2015-10-27Generalise associative operator parsingSimonas Kazlauskas-20/+0
This commit generalises parsing of associative operators from left-associative only (with some ugly hacks to support right-associative assignment) to properly left/right-associative operators. Parsing still is not general enough to handle non-associative, non-highest-precedence prefix or non-highest-precedence postfix operators (e.g. `..` range syntax), though. That should be fixed in the future. Lastly, this commit adds support for parsing right-associative `<-` (left arrow) operator with precedence higher than assignment as the operator for placement-in feature.
2015-10-13Merge VariantData and VariantData_Vadim Petrochenkov-1/+1
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-2/+2
2015-10-13Provide span for visit_struct_def + remove some dead codeVadim Petrochenkov-1/+2
2015-10-13Remove now redundant NodeId from VariantVadim Petrochenkov-7/+1
2015-10-13Decouple structure kinds from NodeIdsVadim Petrochenkov-7/+1
2015-10-01Auto merge of #28577 - jethrogb:topic/ast-stmt-debug, r=pcwaltonbors-6/+7
This enables the Debug trait to work on syntax::ast::Stmt.
2015-09-28Fill in some missing parts in the default AST visitorVadim Petrochenkov-2/+2
+ Add helper macro for walking lists (including Options)
2015-09-26Auto merge of #28642 - petrochenkov:name3, r=nrcbors-10/+10
This PR removes random remaining `Ident`s outside of libsyntax and performs general cleanup In particular, interfaces of `Name` and `Ident` are tidied up, `Name`s and `Ident`s being small `Copy` aggregates are always passed to functions by value, and `Ident`s are never used as keys in maps, because `Ident` comparisons are tricky. Although this PR closes https://github.com/rust-lang/rust/issues/6993 there's still work related to it: - `Name` can be made `NonZero` to compress numerous `Option<Name>`s and `Option<Ident>`s but it requires const unsafe functions. - Implementation of `PartialEq` on `Ident` should be eliminated and replaced with explicit hygienic, non-hygienic or member-wise comparisons. - Finally, large parts of AST can potentially be converted to `Name`s in the same way as HIR to clearly separate identifiers used in hygienic and non-hygienic contexts. r? @nrc
2015-09-24Cleanup interfaces of Name, SyntaxContext and IdentVadim Petrochenkov-10/+10
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-09-24Remove the deprecated box(PLACE) syntax.Eduard Burtescu-4/+3
2015-09-21Change syntax::ast_util::stmt_id to not panic on macrosJethro Beekman-6/+7
This enables the Debug trait to work on syntax::ast::Stmt
2015-09-03Add an intital HIR and lowering stepNick Cameron-41/+1
2015-08-26Rename FnKind variants and stop re-exporting them from the visit module.Ms2ger-8/+8
There is no longer a need for that pattern, since enums are now qualified.
2015-08-24Auto merge of #27857 - Manishearth:improve-fnkind, r=pnkfelixbors-1/+1
Since enums are namespaced now, should we also remove the `Fk` prefixes from `FnKind` and remove the reexport? (The reexport must be removed because otherwise it clashes with glob imports containing `ItemFn`). IMO writing `FnKind::Method` is much clearer than `FkMethod`.
2015-08-24move def-id to rustc crateNiko Matsakis-6/+0
2015-08-16FnFnBlock -> FkClosureManish Goregaokar-1/+1
2015-08-14move InlinedItem into librustc, where it belongsNiko Matsakis-22/+11
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-3/+1
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-1/+1
2015-06-11Conver reborrows to .iter() calls where appropriateJoshua Landau-1/+1
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-1/+1
2015-05-21Make various fixes:Niko Matsakis-2/+1
- add feature gate - add basic tests - adjust parser to eliminate conflict between `const fn` and associated constants - allow `const fn` in traits/trait-impls, but forbid later in type check - correct some merge conflicts
2015-05-21syntax: parse `const fn` for free functions and inherent methods.Eduard Burtescu-0/+1
2015-04-27Auto merge of #23606 - quantheory:associated_const, r=nikomatsakisbors-1/+1
Closes #17841. The majority of the work should be done, e.g. trait and inherent impls, different forms of UFCS syntax, defaults, and cross-crate usage. It's probably enough to replace the constants in `f32`, `i8`, and so on, or close to good enough. There is still some significant functionality missing from this commit: - ~~Associated consts can't be used in match patterns at all. This is simply because I haven't updated the relevant bits in the parser or `resolve`, but it's *probably* not hard to get working.~~ - Since you can't select an impl for trait-associated consts until partway through type-checking, there are some problems with code that assumes that you can check constants earlier. Associated consts that are not in inherent impls cause ICEs if you try to use them in array sizes or match ranges. For similar reasons, `check_static_recursion` doesn't check them properly, so the stack goes ka-blooey if you use an associated constant that's recursively defined. That's a bit trickier to solve; I'm not entirely sure what the best approach is yet. - Dealing with consts associated with type parameters will raise some new issues (e.g. if you have a `T: Int` type parameter and want to use `<T>::ZERO`). See rust-lang/rfcs#865. - ~~Unused associated consts don't seem to trigger the `dead_code` lint when they should. Probably easy to fix.~~ Also, this is the first time I've been spelunking in rustc to such a large extent, so I've probably done some silly things in a couple of places.
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-23Get associated consts working in match patterns.Sean Patrick Santos-1/+1
2015-04-21syntax: Replace String::from_str with the stable String::fromErick Tryzelaar-1/+1
2015-04-14Expose visibility for fns in syntax::visitNick Cameron-2/+2
2015-04-01Fallout in libsyntaxNiko Matsakis-1/+1
2015-03-30Implement new type-checking strategy for binary operators. Basically,Niko Matsakis-22/+6
the plan is to treat all binary operators as if they were overloaded, relying on the fact that we have impls for all the builtin scalar operations (and no more). But then during writeback we clear the overload if the types correspond to a builtin op. This strategy allows us to avoid having to know the types of the operands ahead of time. It also avoids us overspecializing as we did in the past.
2015-03-25rustc: Remove support for int/uintAlex Crichton-4/+4
This commit removes all parsing, resolve, and compiler support for the old and long-deprecated int/uint types.
2015-03-11syntax: move MethMac to MacImplItem and combine {Provided,Required}Method ↵Eduard Burtescu-30/+2
into MethodTraitItem.
2015-03-11syntax: rename TypeMethod to MethodSig and use it in MethDecl.Eduard Burtescu-19/+4
2015-03-11syntax: gather common fields of impl & trait items into their respective types.Eduard Burtescu-20/+19
2015-03-11syntax: move indirection around {Trait,Impl}Item, from within.Eduard Burtescu-56/+0