summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
AgeCommit message (Collapse)AuthorLines
2015-10-25syntax/rustc_front: Simplify VariantData::fieldsVadim Petrochenkov-12/+6
And use VariantData instead of P<VariantData> in Item_ and Variant_
2015-10-15Auto merge of #28980 - nrc:unsafe-macros, r=@pnkfelixbors-2/+0
This is a [breaking change]. @brson could you do a Crater run with this PR please? Lets not land till Crater says its OK. This was discussed at https://internals.rust-lang.org/t/does-anyone-use-the-push-pop-unsafe-macros/2702
2015-10-13Comment on the purpose(s) of NodeId in VariantDataVadim Petrochenkov-0/+11
2015-10-13Merge VariantData and VariantData_Vadim Petrochenkov-17/+14
2015-10-13Merge struct fields and struct kindVadim Petrochenkov-7/+29
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-4/+4
2015-10-13Provide span for visit_struct_def + remove some dead codeVadim Petrochenkov-6/+0
2015-10-13Remove now redundant NodeId from VariantVadim Petrochenkov-1/+0
2015-10-13Decouple structure kinds from NodeIdsVadim Petrochenkov-10/+9
2015-10-13Unify structures and enum variants in ASTVadim Petrochenkov-1/+1
2015-10-12Remove the push_unsafe! and pop_unsafe! macros.Nick Cameron-2/+0
This is a [breaking change].
2015-10-09Some cleanup of no longer used AST thingsNick Cameron-11/+2
2015-10-09Cache ids between lowering runsNick Cameron-0/+1
So that lowering is reproducible
2015-10-09Move `for` loop desugaring to loweringNick Cameron-0/+4
2015-10-03libsyntax: Do not derive Hash for IdentVadim Petrochenkov-13/+27
2015-10-02Auto merge of #28793 - Ms2ger:AttrStyle, r=alexcrichtonbors-6/+5
2015-10-01Stop re-exporting AttrStyle's variants and rename them.Ms2ger-6/+5
2015-10-01Convert DefId to use DefIndex, which is an index into a list ofNiko Matsakis-2/+2
paths, and construct paths for all definitions. Also, stop rewriting DefIds for closures, and instead just load the closure data from the original def-id, which may be in another crate.
2015-10-01Auto merge of #28577 - jethrogb:topic/ast-stmt-debug, r=pcwaltonbors-1/+3
This enables the Debug trait to work on syntax::ast::Stmt.
2015-09-28Fill in some missing parts in the default AST visitorVadim Petrochenkov-0/+7
+ Add helper macro for walking lists (including Options)
2015-09-26Auto merge of #28642 - petrochenkov:name3, r=nrcbors-88/+51
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-88/+51
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-3/+3
2015-09-22Encode/decode Names as stringsVadim Petrochenkov-2/+13
2015-09-21Change syntax::ast_util::stmt_id to not panic on macrosJethro Beekman-1/+3
This enables the Debug trait to work on syntax::ast::Stmt
2015-09-21Use ast::AsmDialect's variants qualified, and drop the pointless prefix.Ms2ger-3/+2
2015-09-20Replace `ast::Mac_` enum with structAndrew Paseltiner-6/+6
Closes #28527.
2015-09-17Remove Visibility field from enum variantsSimonas Kazlauskas-1/+0
Followup on #28440
2015-09-04Auto merge of #28170 - nagisa:loopctl-label-spans, r=alexcrichtonbors-2/+2
r? @alexcrichton
2015-09-03Use consistent terminology for byte string literalsVadim Petrochenkov-1/+1
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
2015-09-03Use proper span for break and continue labelsSimonas Kazlauskas-2/+2
Fixes #28109
2015-08-30Make a macro a const fn and remove outdated NBTobias Bucher-2/+0
2015-08-24move def-id to rustc crateNiko Matsakis-32/+1
2015-08-20syntax: remove suffix_len methods from LitIntTypesGeorg Brandl-27/+0
The methods gave wrong results for TyIs and TyUs, whose suffix len should be 5 nowadays. But since they were only used for parsing, and unneeded for that since 606a309d, remove them rather than fixing.
2015-08-17Clean up simd_cast translation.Huon Wilson-0/+24
2015-08-14move InlinedItem into librustc, where it belongsNiko Matsakis-12/+0
2015-08-12Add two new kinds of predicates, WellFormed and ObjectSafe.Niko Matsakis-1/+1
2015-08-11syntax: fix use of "vector" for [x; n] literal and [x, y] patternsGeorg Brandl-1/+1
2015-08-10Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichtonbors-3/+18
An implementation of [RFC 1219](https://github.com/rust-lang/rfcs/pull/1219). The RFC is not merged yet, but once merged, this could be.
2015-08-08rustc: rename multiple imports in a listSean McArthur-3/+18
2015-08-04Add a macro invocation to the type ASTJared Roesch-0/+2
Reapplied the changes from https://github.com/freebroccolo/rust/commit/dc64b731d7f66c2b43d5e5e8c721be7bd3b59540 to a clean branch of master
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-19/+15
2015-07-26Remove `ast::LocalSource` with only one used variantmitaa-10/+0
`LocalSource` indicated wether a let binding originated from for-loop desugaring to enable specialized error messages, but for-loop expansion has changed and this is now achieved through `MatchSource::ForLoopDesugar`.
2015-07-22Hack for "unsafety hygiene" -- `push_unsafe!` and `pop_unsafe!`.Felix S. Klock II-0/+2
Even after expansion, the generated expressions still track depth of such pushes (i.e. how often you have "pushed" without a corresponding "pop"), and we add a rule that in a context with a positive `push_unsafe!` depth, it is effectively an `unsafe` block context. (This way, we can inject code that uses `unsafe` features, but still contains within it a sub-expression that should inherit the outer safety checking setting, outside of the injected code.) This is a total hack; it not only needs a feature-gate, but probably should be feature-gated forever (if possible). ignore-pretty in test/run-pass/pushpop-unsafe-okay.rs
2015-07-18Fix doc comment parsing in macros.Lee Jeffery-3/+15
2015-07-10Preserve escape sequences in documentation comments on macro expansionBarosl Lee-1/+1
Escape sequences in documentation comments must not be parsed as a normal string when expanding a macro, otherwise some innocent but invalid-escape-sequence-looking comments will trigger an ICE. Although this commit replaces normal string literals with raw string literals in macro expansion, this shouldn't be much a problem considering documentation comments are converted into attributes before being passed to a macro anyways. Fixes #25929. Fixes #25943.
2015-06-19Move AST Repr impls to Debug impls in libsyntax.Eduard Burtescu-9/+67
2015-05-21Make various fixes:Niko Matsakis-1/+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-1/+8
2015-05-04Fix spelling errors in documentation.Joseph Crail-1/+1