about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer/mod.rs
AgeCommit message (Collapse)AuthorLines
2019-01-20[WIP] Improve error behaviorYuki Okushi-6/+8
2019-01-18Continue chekingYuki Okushi-1/+1
2019-01-16Cancel processYuki Okushi-1/+1
2019-01-14rustdoc: check code block syntax in early passAndy Russell-13/+0
2019-01-11Continue evaluating after parsing incorrect binary literalEsteban Küber-1/+1
2018-12-31Do not use unicode character in diagnostic helpEsteban Küber-1/+1
2018-12-31Use structured suggestion for braceless unicode escape squenceEsteban Küber-6/+30
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-06Auto merge of #54517 - mcr431:53956-panic-on-include_bytes-of-own-file, ↵bors-1/+1
r=michaelwoerister 53956 panic on include bytes of own file fix #53956 When using `include_bytes!` on a source file in the project, compiler would panic on subsequent compilations because `expand_include_bytes` would overwrite files in the source_map with no source. This PR changes `expand_include_bytes` to check source_map and use the already existing src, if any.
2018-12-04adds DocTest filename variant, refactors doctest_offset out of source_map, ↵Matthew Russo-1/+1
fixes remaining test failures
2018-12-04Use iterator and pattern APIs instead of `char_at`Shotaro Yamada-17/+19
2018-11-26Update outdated code comments in StringReaderJason Langenauer-3/+2
2018-11-14Clean up some non-mod-rs stuff.Eric Huss-1/+0
2018-11-04Auto merge of #54861 - rep-nop:find_main_in_doctest, r=estebankbors-1/+22
rustdoc: Replaces fn main search and extern crate search with proper parsing during doctests. Fixes #21299. Fixes #33731. Let me know if there's any additional changes you'd like made!
2018-11-01buffer errors from initial tokenization when parsingQuietMisdreavus-1/+22
2018-10-29Rename other occs of (Code/File)Map to Source(Map/File) #51574David Lavati-54/+54
2018-09-29Add a sentence before rustc errorsGuillaume Gomez-1/+3
2018-09-29Improve error display for codeblocks in rustdocGuillaume Gomez-0/+11
2018-09-09Don't compute padding of braces unless they are unmatchedEsteban Küber-3/+3
2018-09-05Provide more context for unenclosed delimitersEsteban Küber-0/+5
* 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-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-3/+3
2018-08-19fix tidy errorsDonato Sciarra-6/+6
2018-08-19mv codemap source_mapDonato Sciarra-2/+2
2018-08-19mv codemap() source_map()Donato Sciarra-2/+2
2018-08-19mv (mod) codemap source_mapDonato Sciarra-2/+2
2018-08-19mv filemap source_fileDonato Sciarra-19/+19
2018-08-19mv FileMap SourceFileDonato Sciarra-5/+5
2018-08-19mv CodeMap SourceMapDonato Sciarra-18/+18
2018-08-17Rollup merge of #53373 - estebank:unclosed, r=petrochenkovkennytm-0/+2
Tweak unclosed delimiter parser error
2018-08-15Do not emit "incorrect close delimiter" twice in the same placeEsteban Küber-0/+2
2018-08-13A few cleanups and minor improvements for the lexerljedrz-67/+112
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-3/+1
2018-07-23Allow by default, fix testsmark-0/+1
2018-07-20proc_macro: move some implementation details to a rustc module.Eduard-Mihai Burtescu-6/+0
2018-07-14Remove some tests using AST comparisons, fix other testsVadim Petrochenkov-2/+4
2018-07-14Remove most of `PartialEq` impls from AST and HIR structuresVadim Petrochenkov-1/+1
2018-06-27Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable.Michael Woerister-19/+1
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-2/+2
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-06-15Auto merge of #50296 - cmdd:master, r=nikomatsakisbors-0/+14
Add error message for using >= 65535 hashes for raw string literal escapes Fixes #50111.
2018-06-09Crate-ify and delete unused code in syntax::parseMark Simulacrum-21/+19
2018-06-08provide error message when using more than 65535 hash symbols for raw stringsDavid Cao-0/+14
2018-05-31Rollup merge of #51240 - nnethercote:parse-2, r=nikomatsakisGuillaume Gomez-5/+3
Two minor parsing tweaks
2018-05-31Avoid an unnecessary `match` when lexing "<-".Nicholas Nethercote-5/+1
2018-05-31Tweak identifer lexing.Nicholas Nethercote-0/+2
By calling `bump()` after getting the first char, to avoid a redundant `ident_continue()` test on it.
2018-05-28Auto merge of #50724 - zackmdavis:applicability_rush, r=Manishearthbors-6/+7
add suggestion applicabilities to librustc and libsyntax A down payment on #50723. Interested in feedback on whether my `MaybeIncorrect` vs. `MachineApplicable` judgement calls are well-calibrated (and that we have a consensus on what this means). r? @Manishearth cc @killercup @estebank
2018-05-26Fix testEsteban Küber-2/+4
2018-05-25in which we check for confusable Unicodepoints in float literal exponentZack M. Davis-3/+10
The `FatalError.raise()` might seem unmotivated (in most places in the compiler, `err.emit()` suffices), but it's actually used to maintain behavior (viz., stop lexing, don't emit potentially spurious errors looking for the next token after the bad Unicodepoint in the exponent): the previous revision's `self.err_span_` ultimately calls `Handler::emit`, which aborts if the `Handler`'s continue_after_error flag is set, which seems to typically be true during lexing (see `phase_1_parse_input` and and how `CompileController::basic` has `continue_parse_after_error: false` in librustc_driver). Also, let's avoid apostrophes in error messages (the present author would argue that users expect a reassuringly detached, formal, above-it-all tone from a Serious tool like a compiler), and use an RLS-friendly structured suggestion. Resolves #49746.
2018-05-22Auto merge of #50838 - alexcrichton:token-impls, r=eddybbors-6/+28
rustc: Fix joint-ness of stringified token-streams This commit fixes `StringReader`'s parsing of tokens which have been stringified through procedural macros. Whether or not a token tree is joint is defined by span information, but when working with procedural macros these spans are often dummy and/or overridden which means that they end up considering all operators joint if they can! The fix here is to track the raw source span as opposed to the overridden span. With this information we can more accurately classify `Punct` structs as either joint or not. Closes #50700
2018-05-20suggestion applicabilities for libsyntax and librustc, run-rustfix testsZack M. Davis-6/+7
Consider this a down payment on #50723. To recap, an `Applicability` enum was recently (#50204) added, to convey to Rustfix and other tools whether we think it's OK for them to blindly apply the suggestion, or whether to prompt a human for guidance (because the suggestion might contain placeholders that we can't infer, or because we think it has a sufficiently high probability of being wrong even though it's— presumably—right often enough to be worth emitting in the first place). When a suggestion is marked as `MaybeIncorrect`, we try to use comments to indicate precisely why (although there are a few places where we just say `// speculative` because the present author's subjective judgement balked at the idea that the suggestion has no false positives). The `run-rustfix` directive is opporunistically set on some relevant UI tests (and a couple tests that were in the `test/ui/suggestions` directory, even if the suggestions didn't originate in librustc or libsyntax). This is less trivial than it sounds, because a surprising number of test files aren't equipped to be tested as fixed even when they contain successfully fixable errors, because, e.g., there are more, not-directly-related errors after fixing. Some test files need an attribute or underscore to avoid unused warnings tripping up the "fixed code is still producing diagnostics" check despite the fixes being correct; this is an interesting contrast-to/inconsistency-with the behavior of UI tests (which secretly pass `-A unused`), a behavior which we probably ought to resolve one way or the other (filed issue #50926). A few suggestion labels are reworded (e.g., to avoid phrasing it as a question, which which is discouraged by the style guidelines listed in `.span_suggestion`'s doc-comment).