about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
AgeCommit message (Collapse)AuthorLines
2014-04-10Renamed ast::Purity to ast::FnStyle and ast::ImpureFn to ast::NormalFn and ↵Kasey Carrothers-23/+23
updated associated variable and function names.
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-4/+5
port all code over to use it.
2014-04-08Register new snapshotsAlex Crichton-32/+17
2014-04-06syntax: Tweak parsing lifetime bounds on closuresAlex Crichton-111/+112
In summary these are some example transitions this change makes: 'a || => ||: 'a proc:Send() => proc():Send The intended syntax for closures is to put the lifetime bound not at the front but rather in the list of bounds. Currently there is no official support in the AST for bounds that are not 'static, so this case is currently specially handled in the parser to desugar to what the AST is expecting. Additionally, this moves the bounds on procedures to the correct position, which is after the argument list. The current grammar for closures and procedures is: procedure := 'proc' [ '<' lifetime-list '>' ] '(' arg-list ')' [ ':' bound-list ] [ '->' type ] closure := [ 'unsafe' ] ['<' lifetime-list '>' ] '|' arg-list '|' [ ':' bound-list ] [ '->' type ] lifetime-list := lifetime | lifetime ',' lifetime-list arg-list := ident ':' type | ident ':' type ',' arg-list bound-list := bound | bound '+' bound-list bound := path | lifetime This does not currently handle the << ambiguity in `Option<<'a>||>`, I am deferring that to a later patch. Additionally, this removes the support for the obsolete syntaxes of ~fn and &fn. Closes #10553 Closes #10767 Closes #11209 Closes #11210 Closes #11211
2014-04-04syntax: remove obsolete mutability from ExprVec and ExprRepeat.Eduard Burtescu-5/+4
2014-04-03syntax: Remove AbiSet, use one AbiAlex Crichton-51/+34
This change removes the AbiSet from the AST, converting all usage to have just one Abi value. The current scheme selects a relevant ABI given a list of ABIs based on the target architecture and how relevant each ABI is to that architecture. Instead of this mildly complicated scheme, only one ABI will be allowed in abi strings, and pseudo-abis will be created for special cases as necessary. For example the "system" abi exists for stdcall on win32 and C on win64. Closes #10049
2014-04-02Fix fallout of requiring uint indicesAlex Crichton-2/+2
2014-03-31syntax: allow stmt/expr macro invocations to be delimited by [].Gábor Lehel-23/+15
this is useful for macros like vec! which construct containers
2014-03-31syntax: Switch field privacy as necessaryAlex Crichton-23/+19
2014-03-31vec: convert `append` and `append_one` to methodsDaniel Micay-26/+13
These were only free functions on `~[T]` because taking self by-value used to be broken.
2014-03-28auto merge of #13170 : eddyb/rust/syntax-cleanup, r=alexcrichtonbors-4/+5
Removes all Cell's/RefCell's from lexer::Reader implementations and a couple @.
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-1/+4
Closes #2569
2014-03-28De-@ IdentInterner.Eduard Burtescu-1/+1
2014-03-28De-@ TokenTree.Eduard Burtescu-2/+3
2014-03-28Used inherited mutability in lexer::Reader.Eduard Burtescu-1/+1
2014-03-28Rename Pod into CopyFlavio Percoco-2/+2
Summary: So far, we've used the term POD "Plain Old Data" to refer to types that can be safely copied. However, this term is not consistent with the other built-in bounds that use verbs instead. This patch renames the Pod kind into Copy. RFC: 0003-opt-in-builtin-traits Test Plan: make check Reviewers: cmr Differential Revision: http://phabricator.octayn.net/D3
2014-03-26auto merge of #13079 : alexcrichton/rust/colons, r=cmrbors-55/+18
The previous syntax was `Foo:Bound<trait-parameters>`, but this is a little ambiguous because it was being parsed as `Foo: (Bound<trait-parameters)` rather than `Foo: (Bound) <trait-parameters>` This commit changes the syntax to `Foo<trait-parameters>: Bound` in order to be clear where the trait parameters are going. Closes #9265
2014-03-26syntax: Tweak parsing bounds on generics pathsAlex Crichton-55/+18
The previous syntax was `Foo:Bound<trait-parameters>`, but this is a little ambiguous because it was being parsed as `Foo: (Bound<trait-parameters)` rather than `Foo: (Bound) <trait-parameters>` This commit changes the syntax to `Foo<trait-parameters>: Bound` in order to be clear where the trait parameters are going. Closes #9265
2014-03-26syntax: Permit visibility on tuple fieldsAlex Crichton-1/+1
This change is in preparation for #8122. Nothing is currently done with these visibility qualifiers, they are just parsed and accepted by the compiler. RFC: 0004-private-fields
2014-03-23Get rid of @CellEdward Wang-9/+8
2014-03-22syntax: Fix fallout of removing get()Alex Crichton-25/+14
2014-03-22Migrate all users of opt_vec to owned_slice, delete opt_vec.Huon Wilson-17/+16
syntax::opt_vec is now entirely unused, and so can go.
2014-03-21syntax: make OptVec immutable.Huon Wilson-5/+5
This is the first step to replacing OptVec with a new representation: remove all mutability. Any mutations have to go via `Vec` and then make to `OptVec`. Many of the uses of OptVec are unnecessary now that Vec has no-alloc emptiness (and have been converted to Vec): the only ones that really need it are the AST and sty's (and so on) where there are a *lot* of instances of them, and they're (mostly) immutable.
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-1/+0
It's now in the prelude.
2014-03-20auto merge of #13028 : thestinger/rust/vec_ng, r=huonwbors-13/+13
Closes #12771
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-13/+13
Closes #12771
2014-03-20Fix spans for enum-struct match armsNick Cameron-10/+8
Correct spans for fields in enum struct arms where the field and variable are unified
2014-03-17rustc: disallow trailing parentheses for nullary enum variantsLaurent Bonnans-2/+19
Fixes #12560
2014-03-17De-@ codemap and diagnostic.Eduard Burtescu-1/+1
2014-03-17De-@ ParseSess uses.Eduard Burtescu-5/+5
2014-03-15rustc: Remove compiler support for __log_level()Alex Crichton-7/+1
This commit removes all internal support for the previously used __log_level() expression. The logging subsystem was previously modified to not rely on this magical expression. This also removes the only other function to use the module_data map in trans, decl_gc_metadata. It appears that this is an ancient function from a GC only used long ago. This does not remove the crate map entirely, as libgreen still uses it to hook in to the event loop provided by libgreen.
2014-03-14extra: Put the nail in the coffin, delete libextraAlex Crichton-1/+1
This commit shreds all remnants of libextra from the compiler and standard distribution. Two modules, c_vec/tempfile, were moved into libstd after some cleanup, and the other modules were moved to separate crates as seen fit. Closes #8784 Closes #12413 Closes #12576
2014-03-14Added support for type placeholders (explicit requested typeMarvin Löbel-0/+3
inference in a type with `_` ). This enables partial type inference.
2014-03-13auto merge of #12849 : nick29581/rust/doubles, r=alexcrichtonbors-0/+1
2014-03-12rustc: Remove matching on ~str from the languageMichael Darakananda-18/+1
The `~str` type is not long for this world as it will be superseded by the soon-to-come DST changes for the language. The new type will be `~Str`, and matching over the allocation will no longer be supported. Matching on `&str` will continue to work, in both a pre and post DST world.
2014-03-12Update last_span in replace_tokenNick Cameron-0/+1
2014-03-12Changed lists of lifetimes in ast and ty to use Vec instead of OptVec.Felix S. Klock II-13/+13
There is a broader revision (that does this across the board) pending in #12675, but that is awaiting the arrival of more data (to decide whether to keep OptVec alive by using a non-Vec internally). For this code, the representation of lifetime lists needs to be the same in both ScopeChain and in the ast and ty structures. So it seemed cleanest to just use `vec_ng::Vec`, now that it has a cheaper empty representation than the current `vec` code.
2014-03-12alpha-rename .ident to .name in Lifetime, including in rustdoc.Felix S. Klock II-1/+1
2014-03-11syntax: Add support for trait bounds on procsAlex Crichton-1/+2
This is needed to make progress on #10296 as the default bounds will no longer include Send. I believe that this was the originally intended syntax for procs, and it just hasn't been necessary up until now.
2014-03-07rename ast::ViewItemExternMod to ast::ViewItemExternCrate, and ↵Liigo Zhuang-4/+4
clean::ExternMod to clean::ExternCrate
2014-03-03syntax: make match arms store the expr directly.Huon Wilson-10/+1
Previously `ast::Arm` was always storing a single `ast::Expr` wrapped in an `ast::Block` (for historical reasons, AIUI), so we might as just store that expr directly. Closes #3085.
2014-03-02Make visible types public in rustcSteven Fackler-1/+1
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-23/+41
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-124/+123
2014-02-26Replace callee_id with information stored in method_map.Eduard Burtescu-5/+5
2014-02-24syntax: allow stmt/expr macro invocations to be delimited by {}.Huon Wilson-3/+23
This makes using control-flow-y macros like `spawn! { ... }` more fluent and natural. cc #11892.
2014-02-23auto merge of #12328 : nick29581/rust/abi, r=alexcrichtonbors-4/+5
2014-02-24All uses of `extern fn` should mean `extern "C" fn`. Closes #9309.Nick Cameron-4/+5
2014-02-23Make break and continue hygienicEdward Wang-3/+3
Makes labelled loops hygiene by performing renaming of the labels defined in e.g. `'x: loop { ... }` and then used in break and continue statements within loop body so that they act hygienically when used with macros. Closes #12262.
2014-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-1/+1
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.