about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2016-04-14Parse `pub(restricted)`Jeffrey Seyfried-16/+25
2016-04-12Bare raw pointers have been disallowed foreverDavid Tolnay-3/+2
This change was in 0.12.0, a year and a half ago. Let's move on!
2016-04-12Remove unused trait importsSeo Sanghyeon-2/+0
2016-04-11Auto merge of #32711 - marcusklaas:try-shorthand-span-fix, r=nagisabors-1/+1
Fix the span for try shorthand expressions My five character contribution to the rust parser! Fixes https://github.com/rust-lang/rust/issues/32709.
2016-04-11Fix the span for try shorthand expressionsMarcus Klaas-1/+1
2016-04-06Rollup merge of #32727 - matklad:fix-comment, r=alexcrichtonSteve Klabnik-6/+6
minor: update old comments No more lifetimes in function types after https://github.com/rust-lang/rust/commit/f945190e6352a1bc965a117569532643319b400f
2016-04-06Rollup merge of #32570 - eddyb:tis-but-a-front, r=nikomatsakisManish Goregaokar-8/+12
r? @nikomatsakis Conflicts: src/librustc_save_analysis/lib.rs src/libsyntax/ast_util.rs
2016-04-06Move span into `StructField`Vadim Petrochenkov-7/+10
2016-04-06Get rid of ast::StructFieldKindVadim Petrochenkov-4/+4
2016-04-06syntax: dismantle ast_util.Eduard Burtescu-8/+12
2016-04-05Auto merge of #32688 - jseyfried:ast_groundwork_for_1422, r=pnkfelixbors-10/+10
[breaking-batch] Add support for `pub(restricted)` syntax in the AST This PR allows the AST to represent the `pub(restricted)` syntax from RFC 1422 (cc #32409). More specifically, it makes `ast::Visibility` non-`Copy` and adds two new variants, `Visibility::Crate` for `pub(crate)` and `Visitibility::Restricted { path: P<Path>, id: NodeId }` for `pub(path)`. plugin-[breaking-change] cc #31645 r? @pnkfelix
2016-04-05Fixes bug which accepting using `super` in use statemet.vlastachu-6/+6
Issue: #32225
2016-04-04minor: update old commentsAleksey Kladov-6/+6
No more lifetimes in function types after https://github.com/rust-lang/rust/commit/f945190e6352a1bc965a117569532643319b400f
2016-04-02Add `Crate` and `Restricted` variants to `ast::Visibility`Jeffrey Seyfried-4/+4
2016-04-02Make `ast::Visibility` non-copyableJeffrey Seyfried-6/+6
2016-03-31syntax: Extra diagnostics for `_` used in an identifier positionVadim Petrochenkov-12/+6
2016-03-28Auto merge of #32479 - eddyb:eof-not-even-twice, r=nikomatsakisbors-9/+28
Prevent bumping the parser past the EOF. Makes `Parser::bump` after EOF into an ICE, forcing callers to avoid repeated EOF bumps. This ICE is intended to break infinite loops where EOF wasn't stopping the loop. For example, the handling of EOF in `parse_trait_items`' recovery loop fixes #32446. But even without this specific fix, the ICE is triggered, which helps diagnosis and UX. This is a `[breaking-change]` for plugins authors who eagerly eat multiple EOFs. See https://github.com/docopt/docopt.rs/pull/171 for such an example and the necessary fix.
2016-03-28Auto merge of #32267 - durka:inclusive-range-error, r=nrcbors-29/+39
melt the ICE when lowering an impossible range Emit a fatal error instead of panicking when HIR lowering encounters a range with no `end` point. This involved adding a method to wire up `LoweringContext::span_fatal`. Fixes #32245 (cc @nodakai). r? @nrc
2016-03-26syntax: Stop the bump loop for trait items at } and EOF.Eduard Burtescu-9/+17
2016-03-26syntax: Prevent bumping the parser EOF to stop infinite loops.Eduard Burtescu-0/+11
2016-03-26Rollup merge of #32435 - nrc:fix-err-recover, r=nikomatsakisManish Goregaokar-24/+71
Some fixes for error recovery in the compiler
2016-03-24address nitsAlex Burka-3/+4
2016-03-24error during parsing for malformed inclusive rangeAlex Burka-29/+38
Now it is impossible for `...` or `a...` to reach HIR lowering without a rogue syntax extension in play.
2016-03-24TestsNick Cameron-1/+6
2016-03-22fix alignmentJorge Aparicio-20/+21
2016-03-22try! -> ?Jorge Aparicio-498/+498
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-23Error recovery in the tokeniserNick Cameron-25/+58
Closes #31994
2016-03-23Don't loop forever on error recovery with EOFNick Cameron-1/+10
closes #31804
2016-03-14Assorted fixed after rebasingAaron Turon-6/+6
2016-03-14Add `default` as contextual keyword, and parse it for impl items.Aaron Turon-50/+80
2016-03-09Auto merge of #31631 - jonas-schievink:agoraphobia, r=nrcbors-72/+62
[breaking-batch] Move more uses of `panictry!` out of libsyntax
2016-03-09Auto merge of #32071 - jseyfried:parse_pub, r=nikomatsakisbors-34/+10
Make errors for unnecessary visibility qualifiers consistent This PR refactors away `syntax::parse::parser::ParsePub` so that unnecessary visibility qualifiers on variant fields are reported not by the parser but by `privacy::SanePrivacyVisitor` (thanks to @petrochenkov's drive-by improvements in #31919). r? @nikomatsakis
2016-03-08Auto merge of #31954 - japaric:rfc243, r=nikomatsakisbors-1/+6
implement the `?` operator 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 --- cc @aturon @eddyb
2016-03-07Auto merge of #29734 - Ryman:whitespace_consistency, r=Aatchbors-12/+12
libsyntax: be more accepting of whitespace in lexer Fixes #29590. Perhaps this may need more thorough testing? r? @Aatch
2016-03-07implement the `?` operatorJorge Aparicio-1/+6
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-03-06Auto merge of #30884 - durka:inclusive-ranges, r=aturonbors-37/+50
This PR implements [RFC 1192](https://github.com/rust-lang/rfcs/blob/master/text/1192-inclusive-ranges.md), which is triple-dot syntax for inclusive range expressions. The new stuff is behind two feature gates (one for the syntax and one for the std::ops types). This replaces the deprecated functionality in std::iter. Along the way I simplified the desugaring for all ranges. This is my first contribution to rust which changes more than one character outside of a test or comment, so please review carefully! Some of the individual commit messages have more of my notes. Also thanks for putting up with my dumb questions in #rust-internals. - For implementing `std::ops::RangeInclusive`, I took @Stebalien's suggestion from https://github.com/rust-lang/rfcs/pull/1192#issuecomment-137864421. It seemed to me to make the implementation easier and increase type safety. If that stands, the RFC should be amended to avoid confusion. - I also kind of like @glaebhoerl's [idea](https://github.com/rust-lang/rfcs/pull/1254#issuecomment-147815299), which is unified inclusive/exclusive range syntax something like `x>..=y`. We can experiment with this while everything is behind a feature gate. - There are a couple of FIXMEs left (see the last commit). I didn't know what to do about `RangeArgument` and I haven't added `Index` impls yet. Those should be discussed/finished before merging. cc @Gankro since you [complained](https://www.reddit.com/r/rust/comments/3xkfro/what_happened_to_inclusive_ranges/cy5j0yq) cc #27777 #30877 rust-lang/rust#1192 rust-lang/rfcs#1254 relevant to #28237 (tracking issue)
2016-03-06Refactor away `ParsePub` and make errors for unnecessary visibility ↵Jeffrey Seyfried-34/+10
qualifiers consistent
2016-03-02Add `filename` to ParserJeffrey Seyfried-1/+6
2016-03-02Use numeric field `Name`s ("0", "1" etc) for positional fieldsVadim Petrochenkov-1/+1
2016-02-27fix fallout from libsyntax enumpocalypseAlex Burka-1/+1
2016-02-27libsyntax: parse inclusive rangesAlex Burka-38/+51
2016-02-25Rollup merge of #31362 - jseyfried:fix_extern_crate_visibility, r=nikomatsakisManish Goregaokar-7/+0
This PR changes the visibility of extern crate declarations to match that of items (fixes #26775). To avoid breakage, the PR makes it a `public_in_private` lint to reexport a private extern crate, and it adds the lint `inaccessible_extern_crate` for uses of an inaccessible extern crate. The lints can be avoided by making the appropriate `extern crate` declaration public.
2016-02-24Fix the visibility of extern crate declarations and stop warning on pub ↵Jeffrey Seyfried-7/+0
extern crate
2016-02-22Use associated functions for libsyntax SepSeq constructors.Corey Farwell-34/+36
2016-02-19Do less panicking in generalJonas Schievink-0/+4
2016-02-16Auto merge of #31534 - jseyfried:restrict_noninline_mod, r=nikomatsakisbors-7/+17
This PR disallows non-inline modules without path annotations that are either in a block or in an inline module whose containing file is not a directory owner (fixes #29765). This is a [breaking-change]. r? @nikomatsakis
2016-02-16Move more uses of `panictry!` out of libsyntaxJonas Schievink-72/+58
[breaking-change] for syntax extensions
2016-02-15RebasingNick Cameron-2/+2
2016-02-15Some error recovery in the parserNick Cameron-32/+150
2016-02-15Add some simple error recovery to the parser and fix testsNick Cameron-28/+63
Some tests just add the extra errors, others I fix by doing some simple error recovery. I've tried to avoid doing too much in the hope of doing something more principled later. In general error messages are getting worse at this stage, but I think in the long run they will get better.