about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2018-09-05Change wording of unclosed delimiter labelEsteban Küber-1/+4
2018-09-05Provide more context for unenclosed delimitersEsteban Küber-2/+43
* When encountering EOF, point at the last opening brace that does not have the same indentation level as its close delimiter. * When encountering the wrong type of close delimiter, point at the likely correct open delimiter to give a better idea of what went wrong.
2018-09-05Reword un-closed delimiter labelEsteban Küber-2/+2
2018-09-04Move #[test_case] to a syntax extensionJohn Renner-1/+0
2018-09-02Replace check() + bump() with eat()Seiichi Uchida-20/+10
2018-09-01Auto merge of #53815 - F001:if-let-guard, r=petrochenkovbors-2/+2
refactor match guard This is the first step to implement RFC 2294: if-let-guard. Tracking issue: https://github.com/rust-lang/rust/issues/51114 The second step should be introducing another variant `IfLet` in the Guard enum. I separated them into 2 PRs for the convenience of reviewers. r? @petrochenkov
2018-08-30Rollup merge of #53655 - jcpst:with_applicability, r=estebankPietro Albini-2/+12
set applicability Update a few more calls as described in #50723 r? @estebank
2018-08-30introduce Guard enumF001-2/+2
2018-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-7/+7
2018-08-25call span_suggestion with applicabilityJoseph Post-2/+12
2018-08-24fix compile errorMark Mansi-1/+1
2018-08-24Remove anon trait params from 2018 and beyondMark Mansi-1/+7
2018-08-24Rollup merge of #53563 - matthiaskrgr:String, r=varkorkennytm-8/+8
use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into()
2018-08-23Auto merge of #52602 - scottmcm:tryblock-expr, r=nikomatsakisbors-11/+31
Implement try block expressions I noticed that `try` wasn't a keyword yet in Rust 2018, so... ~~Fix​es https://github.com/rust-lang/rust/issues/52604~~ That was fixed by PR https://github.com/rust-lang/rust/pull/53135 cc https://github.com/rust-lang/rust/issues/31436 https://github.com/rust-lang/rust/issues/50412
2018-08-23use String::new() instead of String::from(""), "".to_string(), "".to_owned() ↵Matthias Krüger-8/+8
or "".into()
2018-08-22Rollup merge of #53585 - dtolnay:comment, r=Mark-SimulacrumGuillaume Gomez-2/+0
Remove super old comment on function that parses items This comment was added more than 5 years ago in ab03c1e4221. As far as anyone reading this comment today needs to know, the function has never parsed items from inside an extern crate.
2018-08-22Rollup merge of #53544 - estebank:issue-53534, r=varkorGuillaume Gomez-7/+8
Point at the trait argument when using unboxed closure Fix #53534. r? @varkor
2018-08-22Rollup merge of #53504 - ekse:suggestions-applicability-2, r=estebankGuillaume Gomez-2/+6
Set applicability for more suggestions. Converts a couple more calls to `span_suggestion_with_applicability` (#50723). To be on the safe side, I marked suggestions that depend on the intent of the user or that are potentially lossy conversions as MaybeIncorrect. r? @estebank
2018-08-21Remove super old comment on function that parses itemsDavid Tolnay-2/+0
This comment was added more than 5 years ago in ab03c1e4221. As far as anyone reading this comment today needs to know, the function has never parsed items from inside an extern crate.
2018-08-21Rollup merge of #53521 - alexcrichton:optimize-lit-token, r=michaelwoeristerkennytm-6/+4
syntax: Optimize some literal parsing Currently in the `wasm-bindgen` project we have a very very large crate that's procedurally generated, `web-sys`. To generate this crate we parse all of a browser's WebIDL and we then generate bindings for all of the APIs contained within. The resulting Rust file is 18MB large (wow!) and currently takes a very long time to compile in debug mode. On the nightly compiler a *debug* build takes 90s for the crate to finish. I was curious what was taking so long and upon investigating a *massive* portion of the time was spent in the `lit_token` method of the compiler, primarily formatting strings via `format!`. Upon some more investigation it looks like the `byte_str_lit` was allocating an error message once per byte, causing a very large number of allocations to happen for large literals, of which wasm-bindgen generates quite a few (some are MB large). This commit fixes the issue by lazily allocating the error message, only doing so if the error message is actually needed (which should be never). As a result, the debug mode compilation time for our `web-sys` crate decreased from 90s to 20s, a very nice improvement! (although we've still got some work to do).
2018-08-21Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkorkennytm-5/+5
Fix typos found by codespell.
2018-08-20Point at the trait argument when using unboxed closureEsteban Küber-7/+8
2018-08-20syntax: Optimize some literal parsingAlex Crichton-6/+4
Currently in the `wasm-bindgen` project we have a very very large crate that's procedurally generated, `web-sys`. To generate this crate we parse all of a browser's WebIDL and we then generate bindings for all of the APIs contained within. The resulting Rust file is 18MB large (wow!) and currently takes a very long time to compile in debug mode. On the nightly compiler a *debug* build takes 90s for the crate to finish. I was curious what was taking so long and upon investigating a *massive* portion of the time was spent in the `lit_token` method of the compiler, primarily formatting strings via `format!`. Upon some more investigation it looks like the `byte_str_lit` was allocating an error message once per byte, causing a very large number of allocations to happen for large literals, of which wasm-bindgen generates quite a few (some are MB large). This commit fixes the issue by lazily allocating the error message, only doing so if the error message is actually needed (which should be never). As a result, the debug mode compilation time for our `web-sys` crate decreased from 90s to 20s, a very nice improvement! (although we've still got some work to do).
2018-08-20Set applicability for more suggestions.Sébastien Duquette-2/+6
2018-08-19Switch out another use of `do catch`Scott McMurray-1/+9
2018-08-19Suggest `try` if someone uses `do catch`Scott McMurray-0/+12
2018-08-19Parse try blocks with the try keyword instead of do catch placeholderScott McMurray-11/+11
2018-08-19Rename `Catch` variants to `TryBlock`Scott McMurray-2/+2
(Not `Try` since `QuestionMark` is using that.)
2018-08-19fix tidy errorsDonato Sciarra-8/+9
2018-08-19mv codemap source_mapDonato Sciarra-7/+7
2018-08-19mv codemap() source_map()Donato Sciarra-27/+27
2018-08-19mv (mod) codemap source_mapDonato Sciarra-15/+15
2018-08-19mv filemap source_fileDonato Sciarra-37/+37
2018-08-19mv FileMap SourceFileDonato Sciarra-9/+9
2018-08-19mv CodeMap SourceMapDonato Sciarra-27/+27
2018-08-19Fix typos found by codespell.Matthias Krüger-5/+5
2018-08-17Rollup merge of #53373 - estebank:unclosed, r=petrochenkovkennytm-11/+21
Tweak unclosed delimiter parser error
2018-08-17Rollup merge of #53360 - PramodBisht:issue/51602, r=estebankkennytm-1/+7
Addressed #51602 Fixed #51602 r? @estebank here I have addressed the case where `in` was not expected right after `if` block. Speaking of `type ascription` I am not sure if this the best approach which I have implemented. Plus I think one more test case can be added to test `type-ascription` case, though I don't have any at this point of time. I will ping you again if all existing testcases pass.
2018-08-16Auto merge of #53293 - petrochenkov:gramattr2, r=alexcrichtonbors-6/+30
syntax: Enforce attribute grammar in the parser Also fix feature-gating for `unrestricted_attribute_tokens` that was introduced in https://github.com/rust-lang/rust/pull/53270, but was actually broken. cc https://github.com/rust-lang/rust/pull/50911
2018-08-16Auto merge of #53289 - ljedrz:improve_lexer, r=michaelwoeristerbors-74/+134
A few cleanups and minor improvements for the lexer - improve readability by adjusting the formatting of some function signatures and adding some newlines - reorder some functions for easier reading - remove redundant `'static` in `const`s - remove some explicit `return`s - read directly to a `String` in `gather_comments_and_literals` - change `unwrap_or!` (macro) to `unwrap_or` (function) - move an `assert!`ion from `try_next_token` (called in a loop) to `try_real_token` after all calls to `try_next_token` - `#[inline]` some one-liner functions - assign directly from an `if-else` expression - refactor a `match` to `map_or` - add a `token::is_irrelevant` function to detect tokens that are not "`real`"
2018-08-15Do not emit "incorrect close delimiter" twice in the same placeEsteban Küber-11/+19
2018-08-15Tweak unclosed delimiter parser errorEsteban Küber-2/+4
2018-08-15syntax: Enforce attribute grammar in the parserVadim Petrochenkov-6/+30
2018-08-14Adddressed #51602Pramod Bisht-1/+7
2018-08-13Move SmallVec and ThinVec out of libsyntaxljedrz-1/+1
2018-08-13A few cleanups and minor improvements for the lexerljedrz-74/+134
2018-08-11Clean up and add extra testsvarkor-12/+3
2018-08-11Add E0642 to parser errorvarkor-3/+6
2018-08-11Emit an error during parsingvarkor-42/+62
2018-08-11Improve diagnosticsvarkor-1/+1