about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2019-07-16Rollup merge of #62703 - ↵Mark Rousskov-3/+3
fakenine:normalize_use_of_backticks_compiler_messages_p6, r=eddyb normalize use of backticks in compiler messages for libsyntax/parse https://github.com/rust-lang/rust/issues/60532
2019-07-16Rollup merge of #62666 - estebank:preempt-ice, r=eddybMark Rousskov-8/+9
Cancel unemitted diagnostics during error recovery Follow up to https://github.com/rust-lang/rust/pull/62604. Use @eddyb's preferred style and catch other case of the same problem. r? @eddyb
2019-07-15Rollup merge of #62668 - goodmanjonathan:fix-62660, r=estebankMark Rousskov-1/+1
Fix #62660 If the explicitly given type of a `self` parameter fails to parse correctly, we need to propagate the error rather than dropping it and causing an ICE. Fixes #62660.
2019-07-16normalize use of backticks in compiler messages for libsyntax/parseSamy Kacimi-3/+3
https://github.com/rust-lang/rust/issues/60532
2019-07-15Auto merge of #62670 - estebank:extern-fn-with-body, r=petrochenkovbors-14/+61
Detect `fn` with a body in an `extern` block Fix #62109.
2019-07-14Auto merge of #62643 - estebank:parse-recovery-type-errs, r=petrochenkovbors-2/+4
Do not emit type errors after parse error in last statement of block When recovering from a parse error inside a block, do not emit type errors generating on that block's recovered return expression. Fix #57383.
2019-07-14Auto merge of #62638 - estebank:issue-62554, r=petrochenkovbors-17/+13
Use snippet instead of pprinting statement Fix #62554.
2019-07-13review commentEsteban Küber-1/+1
2019-07-13Detect `fn` with a body in an `extern` blockEsteban Küber-14/+61
2019-07-13Don't drop DiagnosticBuilder if parsing failsJonathan Goodman-1/+1
If the explicitly given type of a `self` parameter fails to parse correctly, we need to propagate the error rather than dropping it and causing an ICE. Fixes #62660.
2019-07-13Cancel unemitted diagnostics during error recoveryEsteban Küber-8/+9
2019-07-13Rollup merge of #62604 - estebank:unemitted-err-ice, r=pnkfelixMazdak Farrokhzad-4/+7
Handle errors during error recovery gracefully Fix #62546.
2019-07-12Do not emit type errors after parse error in last statement of blockEsteban Küber-2/+4
When recovering from a parse error inside a block, do not emit type errors generating on that block's recovered return expression. Fix #57383.
2019-07-12Use snippet instead of pprinting statementEsteban Küber-17/+13
2019-07-12Rollup merge of #62607 - estebank:this-mem-is-out-of-control, r=petrochenkovMazdak Farrokhzad-2/+3
Correctly break out of recovery loop Fix #61858.
2019-07-11Correctly break out of recovery loopEsteban Küber-2/+3
2019-07-11Emit dropped unemitted errors to aid in ICE debuggingEsteban Küber-6/+7
2019-07-11Handle errors during error recovery gracefullyEsteban Küber-4/+7
2019-07-10Remove needless indent argumentsMark Rousskov-1/+1
We're always indenting by INDENT_UNIT anyway
2019-07-10Move pp::Printer helpers to direct implMark Rousskov-4/+1
2019-07-10Replace src: &mut dyn Read with StringMark Rousskov-4/+1
2019-07-10Remove duplicate attr_to_stringMark Rousskov-1/+1
attribute_to_string exists.
2019-07-10Move literal_to_string to fmt::DisplayMark Rousskov-1/+29
2019-07-07syntax: Pre-intern names of all built-in macrosVadim Petrochenkov-1/+1
They always end up interned anyway
2019-07-06Rollup merge of #62329 - matklad:no-peeking, r=petrochenkovMazdak Farrokhzad-157/+94
Remove support for 1-token lookahead from the lexer `StringReader` maintained `peek_token` and `peek_span_src_raw` for look ahead. `peek_token` was used only by rustdoc syntax coloring. After moving peeking logic into highlighter, I was able to remove `peek_token` from the lexer. I tried to use `iter::Peekable`, but that wasn't as pretty as I hoped, due to buffered fatal errors. So I went with hand-rolled peeking. After that I've noticed that the only peeking behavior left was for raw tokens to test tt jointness. I've rewritten it in terms of trivia tokens, and not just spans. After that it became possible to simplify the awkward constructor of the lexer, which could return `Err` if the first peeked token contained error.
2019-07-05Rollup merge of #62292 - Centril:split-async-closures, r=cramertjMazdak Farrokhzad-15/+25
Move `async || ...` closures into `#![feature(async_closure)]` The `async || expr` syntax is moved out from `#![feature(async_await)]` into its own gate `#![feature(async_closure)]`. New tracking issue: https://github.com/rust-lang/rust/issues/62290 Closes https://github.com/rust-lang/rust/issues/62214. cc https://github.com/rust-lang/rust/issues/62149 r? @varkor
2019-07-05Auto merge of #62099 - Mark-Simulacrum:syntax-print-clean-2, r=eddybbors-15/+15
Remove io::Result from syntax::print Since we're now writing directly to the vector, there's no need to thread results through the whole printing infrastructure
2019-07-04make unwrap_or_abort non-generic againAleksey Kladov-1/+1
2019-07-04remove unused mk_sp_and_rawAleksey Kladov-10/+3
2019-07-04don't rely on spans when checking tokens for jointnessAleksey Kladov-47/+29
2019-07-04slightly comment lexer APIAleksey Kladov-11/+18
2019-07-04move constructors to topAleksey Kladov-51/+51
2019-07-04cleanup lexer constructorsAleksey Kladov-15/+7
2019-07-04remove peek_span_src_raw from StringReaderAleksey Kladov-68/+45
2019-07-04remove peek_token from StringReaderAleksey Kladov-18/+8
2019-07-04remove StringReader::peekAleksey Kladov-4/+0
The reader itself doesn't need ability to peek tokens, so it's better if clients implement this functionality. This hopefully becomes especially easy once we use iterator interface for lexer, but this is not too easy at the moment, because of buffered errors.
2019-07-04Rollup merge of #62297 - matklad:peek-delimited, r=petrochenkovMazdak Farrokhzad-67/+72
refactor check_for_substitution No behavior change, just flatter and simpler code. r? @petrochenkov
2019-07-04Rollup merge of #62258 - petrochenkov:idclean, r=CentrilMazdak Farrokhzad-137/+77
syntax: Unsupport `foo! bar { ... }` macros in the parser Their support in expansion was removed in https://github.com/rust-lang/rust/pull/61606. Also un-reserve `macro_rules` as a macro name, there's no ambiguity between `macro_rules` definitions and macro calls (it also wasn't reserved correctly). cc https://github.com/rust-lang-nursery/wg-grammar/issues/51
2019-07-03Add separate 'async_closure' feature gate.Mazdak Farrokhzad-15/+25
2019-07-02refactor check_for_substitutionAleksey Kladov-67/+72
No behavior change, just flatter and simpler code
2019-07-01Convert more usages overChris Gregory-2/+2
2019-07-01Address review commentsVadim Petrochenkov-48/+45
2019-07-01syntax: Unsupport `foo! bar { ... }` macros in the parserVadim Petrochenkov-93/+36
Unreserve `macro_rules` as a macro name
2019-06-29Always parse 'async unsafe fn' + properly ban in 2015.Mazdak Farrokhzad-8/+18
2019-06-29Remove io::Result from syntax::printMark Rousskov-15/+15
Since we're now writing directly to the vector, there's no need to thread results through the whole printing infrastructure
2019-06-27Rollup merge of #62154 - mark-i-m:old-fixme, r=CentrilMazdak Farrokhzad-1/+1
Remove old fixme fixed in https://github.com/rust-lang/rust/pull/60160 r? @Centril
2019-06-27Rollup merge of #62131 - Xanewok:clip-some-nits, r=petrochenkovMazdak Farrokhzad-9/+9
libsyntax: Fix some Clippy warnings When I was working on it before a lot of these popped up in the RLS so I figured I'll send a small patch fixing only the (hopefully) uncontroversial ones. Others that could be also fixed included also [`clippy::print_with_newline`](https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline) and [`clippy::cast_lossless`](https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless). Should I add them as well? since most of it touches libsyntax... r? @petrochenkov
2019-06-27Rollup merge of #62124 - matklad:without-with, r=petrochenkovMazdak Farrokhzad-139/+121
refactor lexer to use idiomatic borrowing
2019-06-26remove old fixmeMark Mansi-1/+1
2019-06-26Fix clippy::redundant_field_namesIgor Matuszewski-9/+9