summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
AgeCommit message (Collapse)AuthorLines
2015-10-28Make quote plugin use parsing functions which explicitly panic.Eli Friedman-6/+10
Rename parse_* to parse_*_panic, and add parse_attribute_panic.
2015-10-27Don't panic for fatal errors in attribute parsing.Eli Friedman-15/+15
2015-10-27Delete unnecessary ParserAttr trait.Eli Friedman-1/+0
2015-10-27Don't use panicking helpers in Parser.Eli Friedman-1/+2
2015-10-27Add tests for newly introduced syntaxSimonas Kazlauskas-3/+5
Also add some (regression) tests for discovered parser oddities
2015-10-27Fix restrictions when parsing rhs of equalitiesSimonas Kazlauskas-8/+29
2015-10-27Fix prefix range expressions being not parsedSimonas Kazlauskas-74/+68
2015-10-27Generalise associative operator parsingSimonas Kazlauskas-131/+132
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-26Auto merge of #29274 - thepowersgang:issues-29107-const-unsafe-fn-order, ↵bors-10/+14
r=nikomatsakis This PR switches the implemented ordering from `unsafe const fn` (as was in the original RFC) to `const unsafe fn` (which is what the lang team decided on)
2015-10-26Auto merge of #29287 - Ryman:fn_nopat, r=alexcrichtonbors-15/+13
Previously, if you copied a signature from a trait definition such as: ```rust fn foo<'a>(&'a Bar) -> bool {} ``` and moved it into an `impl`, there would be an error message: "unexpected token `'a`" Adding to the error message that a pattern is expected should help users to find the actual problem with using a lifetime here.
2015-10-26Auto merge of #29303 - petrochenkov:unistrimp, r=eddybbors-8/+6
And use `VariantData` instead of `P<VariantData>` in `Item_` and `Variant_` Improvements suggested by @eddyb in https://github.com/rust-lang/rust/pull/28816#discussion_r42483587 and https://github.com/rust-lang/rust/pull/28816#discussion_r42483648 plugin-[breaking-change] r? @eddyb
2015-10-25std: Stabilize library APIs for 1.5Alex Crichton-1/+1
This commit stabilizes and deprecates library APIs whose FCP has closed in the last cycle, specifically: Stabilized APIs: * `fs::canonicalize` * `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists, is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait. * `Formatter::fill` * `Formatter::width` * `Formatter::precision` * `Formatter::sign_plus` * `Formatter::sign_minus` * `Formatter::alternate` * `Formatter::sign_aware_zero_pad` * `string::ParseError` * `Utf8Error::valid_up_to` * `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}` * `<[T]>::split_{first,last}{,_mut}` * `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated but will be once 1.5 is released. * `str::{R,}MatchIndices` * `str::{r,}match_indices` * `char::from_u32_unchecked` * `VecDeque::insert` * `VecDeque::shrink_to_fit` * `VecDeque::as_slices` * `VecDeque::as_mut_slices` * `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`) * `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`) * `Vec::resize` * `str::slice_mut_unchecked` * `FileTypeExt` * `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}` * `BinaryHeap::from` - `from_vec` deprecated in favor of this * `BinaryHeap::into_vec` - plus a `Into` impl * `BinaryHeap::into_sorted_vec` Deprecated APIs * `slice::ref_slice` * `slice::mut_ref_slice` * `iter::{range_inclusive, RangeInclusive}` * `std::dynamic_lib` Closes #27706 Closes #27725 cc #27726 (align not stabilized yet) Closes #27734 Closes #27737 Closes #27742 Closes #27743 Closes #27772 Closes #27774 Closes #27777 Closes #27781 cc #27788 (a few remaining methods though) Closes #27790 Closes #27793 Closes #27796 Closes #27810 cc #28147 (not all parts stabilized)
2015-10-25syntax/rustc_front: Simplify VariantData::fieldsVadim Petrochenkov-8/+6
And use VariantData instead of P<VariantData> in Item_ and Variant_
2015-10-25Switch to 'const unsafe fn' ordering (rust-lang/rust#29107)John Hodge-10/+14
2015-10-25libsyntax: Consolidate branch to benefit from exhaustive checking instead of ↵Kevin Butler-6/+6
unwrapping
2015-10-25libsyntax: remove panics from Parser::parse_pat_nopanicKevin Butler-9/+3
2015-10-25libsyntax: better error for lifetimes in patternsKevin Butler-0/+4
Previously, if you copied a signature from a trait definition such as: ``` fn foo<'a>(&'a Bar) -> bool {} ``` and moved it into an `impl`, there would be an error message: "unexpected token `'a`" Adding to the error message that a pattern is expected should help users to find the actual problem with using a lifetime here.
2015-10-23parser: fix erroneous commentAleksey Kladov-2/+15
Qualified paths allow full path after the `>::`. For example ```rust <T as Foo>::U::generic_method::<f64>() ``` The example is taken from `test/run-pass/associated-item-long-paths.rs`.
2015-10-18Fix span for pattern literalsMarcus Klaas-2/+2
2015-10-14Auto merge of #28827 - thepowersgang:unsafe-const-fn-2, r=Aatchbors-3/+8
This is the original test implementation, which works according to the tests I wrote, but might need a review.
2015-10-13Merge VariantData and VariantData_Vadim Petrochenkov-22/+14
2015-10-13Merge struct fields and struct kindVadim Petrochenkov-22/+15
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-11/+11
2015-10-13Test and gate empty structures and variants betterVadim Petrochenkov-8/+1
2015-10-13Remove now redundant NodeId from VariantVadim Petrochenkov-1/+0
2015-10-13Decouple structure kinds from NodeIdsVadim Petrochenkov-12/+17
2015-10-13Unify structures and enum variants in ASTVadim Petrochenkov-19/+16
2015-10-09Some cleanup of no longer used AST thingsNick Cameron-2/+2
2015-10-03Implement original version of RFC#1245John Hodge-3/+8
2015-09-26Auto merge of #28642 - petrochenkov:name3, r=nrcbors-4/+4
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-4/+4
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-68/+11
2015-09-21Auto merge of #28552 - apasel422:issue-28527, r=Manishearthbors-10/+9
Closes #28527. r? @Manishearth
2015-09-20Auto merge of #28534 - marcusklaas:fix-mod-inner-span, r=alexcrichtonbors-1/+1
Fixes https://github.com/rust-lang/rust/issues/28520. r? @alexcrichton or @nrc?
2015-09-20Replace `ast::Mac_` enum with structAndrew Paseltiner-10/+9
Closes #28527.
2015-09-20Fix the overly long inner spans of inline modsMarcus Klaas-1/+1
2015-09-20Auto merge of #28503 - marcusklaas:pub-extern, r=alexcrichtonbors-7/+4
Fixes https://github.com/rust-lang/rust/issues/28472.
2015-09-19Auto merge of #28486 - nrc:pub-extern-crate, r=alexcrichtonbors-5/+12
Temporary 'fix' for #26775 r? @brson
2015-09-19Include visibility modifier in span of foreign itemMarcus Klaas-7/+4
2015-09-18Auto merge of #28442 - nagisa:remove-enum-vis-field, r=alexcrichtonbors-5/+1
Followup on #28440 Do not merge before the referenced PR is merged. I will fix the PR once that is merged (or close if it is not)
2015-09-18Implement empty struct with braces (RFC 218)Vadim Petrochenkov-18/+3
2015-09-18Warn on `pub extern crate`.Nick Cameron-5/+12
Temporary 'fix' for #26775
2015-09-17Remove Visibility field from enum variantsSimonas Kazlauskas-1/+0
Followup on #28440
2015-09-17libsyntax: forbid visibility modifiers for enum variantsAleksey Kladov-5/+2
fixes #28433
2015-09-17Fix the span for ! returnsNick Cameron-1/+1
2015-09-14Auto merge of #28247 - christopherdumas:fix_28243, r=eddybbors-1/+1
as per #28243.
2015-09-14Fix tuple float bug.christopherdumas-1/+1
2015-09-13Auto merge of #28286 - matklad:remove-dead-code, r=eddybbors-38/+31
There is a dead code in libsyntax/parser/parse.rs, when parsing structs. Two functions are involved: * [parse_item_struct](https://github.com/rust-lang/rust/blob/cd9c9f048f6aa0be091cd9835771ba0712bead4e/src/libsyntax/parse/parser.rs#L4691) * [parse_tuple_struct_body](https://github.com/rust-lang/rust/blob/cd9c9f048f6aa0be091cd9835771ba0712bead4e/src/libsyntax/parse/parser.rs#L4769) The problem is that both functions handle the case with unit structs. But because `parse_tuple_struct_body` is called from `parse_item_struct`, it never faces this case. This PR removes unit struct case from `parse_tuple_struct_body` function. I tested with `make -j8 check-statge1`.
2015-09-11Remove some remains of virtual structs from the parserVadim Petrochenkov-10/+0
2015-09-10libsyntax: minor clean upAleksey Kladov-4/+4
Escape `{` in format strings as `{{`, instead of using a substitution