about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer/comments.rs
AgeCommit message (Collapse)AuthorLines
2019-11-07move syntax::parse::lexer::comments -> syntax::util::commentsMazdak Farrokhzad-255/+0
2019-11-07syntax: simplify importsMazdak Farrokhzad-2/+3
2019-10-25move Attribute::with_desugared_doc to librustdocMazdak Farrokhzad-1/+1
2019-08-02libsyntax: Unconfigure tests during normal buildVadim Petrochenkov-51/+3
2019-07-20Introduce rustc_lexerAleksey Kladov-209/+81
The idea here is to make a reusable library out of the existing rust-lexer, by separating out pure lexing and rustc-specific concerns, like spans, error reporting an interning. So, rustc_lexer operates directly on `&str`, produces simple tokens which are a pair of type-tag and a bit of original text, and does not report errors, instead storing them as flags on the token.
2019-07-10Replace src: &mut dyn Read with StringMark Rousskov-4/+1
2019-07-04cleanup lexer constructorsAleksey Kladov-1/+1
2019-07-04remove peek_token from StringReaderAleksey Kladov-1/+1
2019-05-11Eliminate `comments::Literal`Vadim Petrochenkov-26/+3
2019-02-10rustc: doc commentsAlexander Regueiro-3/+3
2019-02-07libsyntax => 2018Taiki Endo-12/+17
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-05Fix pretty testShotaro Yamada-1/+1
2018-12-04Use iterator and pattern APIs instead of `char_at`Shotaro Yamada-21/+7
2018-08-23use String::new() instead of String::from(""), "".to_string(), "".to_owned() ↵Matthias Krüger-1/+1
or "".into()
2018-08-19mv codemap() source_map()Donato Sciarra-1/+1
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-19mv filemap source_fileDonato Sciarra-4/+4
2018-08-19mv CodeMap SourceMapDonato Sciarra-2/+2
2018-08-13A few cleanups and minor improvements for the lexerljedrz-6/+16
2018-07-10Deny bare trait objects in in src/libsyntaxljedrz-1/+1
2018-06-28Fix FileMap::line_begin_pos().Michael Woerister-2/+4
The method relied on the FileMap still being under construction in order for it to do what the name promises. It's now independent of the current state.
2018-06-09Crate-ify and delete unused code in syntax::parseMark Simulacrum-1/+1
2018-05-20lexer: Fix span override for the first token in a stringVadim Petrochenkov-1/+1
2018-05-14Remove `StringReader::col`.Nicholas Nethercote-1/+13
It only has a single use, within code handling indented block comments. We can replace that with the new `FileMap::col_pos()`, which computes the col position (BytePos instead of CharPos) based on the record of the last newline char (which we already record). This is actually an improvement, because `trim_whitespace_prefix_and_push_line()` was using `col`, which is a `CharPos`, as a slice index, which is a byte/char confusion.
2018-01-26Do not capture stderr in the compiler. Instead just panic silently for fatal ↵John Kåre Alsaker-1/+1
errors
2018-01-06wherein careful doc-decoration arithmetic proves quite the ICE-breakerZack M. Davis-1/+1
This `horizontal_trim` function strips the leading whitespace from doc-comments that have a left-asterisk-margin: /** * You know what I mean— * * comments like this! */ The index of the column of asterisks is `i`, and if trimming is deemed possible, we slice each line from `i+1` to the end of the line. But if, in particular, `i` was 0 _and_ there was an empty line (as in the example given in the reporting issue), we ended up panicking trying to slice an empty string from 0+1 (== 1). Let's tighten our check to say that we can't trim when `i` is even the same as the length of the line, not just when it's greater. (Any such cases would panic trying to slice `line` from `line.len()+1`.) Resolves #47197.
2017-12-14Use PathBuf instead of String where applicableOliver Schneider-2/+2
2017-08-30Make fields of `Span` privateVadim Petrochenkov-1/+1
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-3/+3
Like #43008 (f668999), but _much more aggressive_.
2017-05-12Fix some clippy warnings in libsyntaxAndre Bogus-1/+1
This is mostly removing stray ampersands, needless returns and lifetimes.
2017-04-26Implement a file-path remapping feature in support of debuginfo and ↵Michael Woerister-2/+2
reproducible builds.
2017-01-17Introduce `string_reader.parse_all_token_trees()`.Jeffrey Seyfried-4/+2
2017-01-17Give the `StringReader` a `sess: &ParseSess`.Jeffrey Seyfried-6/+3
2016-10-18Fix some pretty printing testsVadim Petrochenkov-16/+30
2016-10-05Rename StringReader::curr as ch.Nicholas Nethercote-15/+15
Likewise, rename StringReader::curr_is as ch_is. This is a [breaking-change] for libsyntax.
2016-10-05Rename StringReader::last_pos as pos.Nicholas Nethercote-5/+5
This is a [breaking-change] for libsyntax.
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-1/+2
2016-06-16Add an abs_path member to FileMap, use it when writing debug info.Ted Mielczarek-1/+1
When items are inlined from extern crates, the filename in the debug info is taken from the FileMap that's serialized in the rlib metadata. Currently this is just FileMap.name, which is whatever path is passed to rustc. Since libcore and libstd are built by invoking rustc with relative paths, they wind up with relative paths in the rlib, and when linked into a binary the debug info uses relative paths for the names, but since the compilation directory for the final binary, tools trying to read source filenames will wind up with bad paths. We noticed this in Firefox with source filenames from libcore/libstd having bad paths. This change stores an absolute path in FileMap.abs_path, and uses that if available for writing debug info. This is not going to magically make debuggers able to find the source, but it will at least provide sensible paths.
2016-01-16libsyntax: accept only whitespace with the PATTERN_WHITE_SPACE propertyKevin Butler-2/+2
This aligns with unicode recommendations and should be stable for all future unicode releases. See http://unicode.org/reports/tr31/#R3. This renames `libsyntax::lexer::is_whitespace` to `is_pattern_whitespace` so potentially breaks users of libsyntax.
2016-01-04address review commentTshepang Lekhonkhobe-10/+2
2016-01-03run rustfmt on syntax::parse::lexerTshepang Lekhonkhobe-51/+71
2015-12-17move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*Nick Cameron-2/+2
Also split out emitters into their own module.
2015-10-27Start pushing panics outward in lexer.Eli Friedman-1/+1
2015-10-01Stop re-exporting AttrStyle's variants and rename them.Ms2ger-2/+2
2015-09-03std: Account for CRLF in {str, BufRead}::linesAlex Crichton-1/+1
This commit is an implementation of [RFC 1212][rfc] which tweaks the behavior of the `str::lines` and `BufRead::lines` iterators. Both iterators now account for `\r\n` sequences in addition to `\n`, allowing for less surprising behavior across platforms (especially in the `BufRead` case). Splitting *only* on the `\n` character can still be achieved with `split('\n')` in both cases. The `str::lines_any` function is also now deprecated as `str::lines` is a drop-in replacement for it. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1212-line-endings.md Closes #28032
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-1/+1
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-21syntax: Copy unstable str::char_at into libsyntaxErick Tryzelaar-3/+4
2015-04-21syntax: Replace String::from_str with the stable String::fromErick Tryzelaar-1/+1