Commit Graph

203 Commits

Author SHA1 Message Date
Taylor Cramer
07f51fb868 Implement non-mod.rs mod statements 2017-12-19 14:58:51 -08:00
Esteban Küber
c60aab29f1 When attempting to write str with single quote suggest double quotes 2017-12-14 22:51:42 -08:00
Oliver Schneider
d732da813b
Use PathBuf instead of String where applicable 2017-12-14 11:22:08 +01:00
Agustin Chiappe Berrini
ce1fed7f52 address comments 2017-12-07 03:52:25 -05:00
Agustin Chiappe Berrini
65ccf24ce8 and refactor to just move the checking 2017-12-06 04:28:01 -05:00
Jeffrey Seyfried
dfa6c25afd Fix hygiene bug. 2017-11-28 18:59:12 -08:00
Wonwoo Choi
272c2faa1d Display spans correctly when there are non-half-width characters 2017-11-03 03:15:39 +09:00
Guillaume Gomez
83bca40350 Add short message-format 2017-10-20 16:04:32 +02:00
Alex Burka
e64efc91f4 Add support for ..= syntax
Add ..= to the parser

Add ..= to libproc_macro

Add ..= to ICH

Highlight ..= in rustdoc

Update impl Debug for RangeInclusive to ..=

Replace `...` to `..=` in range docs

Make the dotdoteq warning point to the ...

Add warning for ... in expressions

Updated more tests to the ..= syntax

Updated even more tests to the ..= syntax

Updated the inclusive_range entry in unstable book
2017-09-22 22:05:18 +02:00
bors
11f64d8f88 Auto merge of #43716 - MaloJaffre:_-in-literals, r=petrochenkov
Accept underscores in unicode escapes

Fixes #43692.

I don't know if this need an RFC, but at least the impl is here!
2017-09-12 01:25:23 +00:00
Vadim Petrochenkov
3da868dcb6 Make fields of Span private 2017-08-30 01:38:54 +03:00
Malo Jaffré
d4e0e52281 Accept underscores in unicode escapes
Fixes #43692.
2017-08-17 20:03:32 +02:00
Zack M. Davis
1b6c9605e4 use field init shorthand EVERYWHERE
Like #43008 (f668999), but _much more aggressive_.
2017-08-15 15:29:17 -07:00
Alex Crichton
fd95db25b3 Merge remote-tracking branch 'origin/master' into proc_macro_api 2017-07-05 08:42:13 -07:00
petrochenkov
b33fd6d759 Change some terminology around keywords and reserved identifiers 2017-06-29 15:19:53 +03:00
Jeffrey Seyfried
71d4a860a1 Address review comments. 2017-06-26 02:06:34 +00:00
Jeffrey Seyfried
d4488b7df9 Simplify hygiene::Mark application, and
remove variant `Token::SubstNt` in favor of `quoted::TokenTree::MetaVar`.
2017-06-26 02:05:45 +00:00
bors
e862695158 Auto merge of #41990 - qnighy:disallow-underscore-suffix-for-string-like-literals, r=nikomatsakis
Disallow underscore suffix for string-like literals.

This patch turns string/bytestring/char/byte literals followed by an underscore, like `"Foo"_`, to an error.

`scan_optional_raw_name` will parse `_` as a valid raw name, but it will be rejected by the parser. I also considered just stopping parsing when the suffix is `_`, but in that case `"Foo"_` will be lexed as two valid tokens.

Fixes the latter half of #41723.
2017-06-06 02:56:17 +00:00
Masaki Hara
0b8c3de678
Add warning cycle #42326. 2017-05-31 16:43:47 +09:00
Mark Simulacrum
4066c8ec71 Rollup merge of #41957 - llogiq:clippy-libsyntax, r=petrochenkov
Fix some clippy warnings in libsyntax

This is mostly removing stray ampersands, needless returns and lifetimes. Basically a lot of small changes.
2017-05-16 17:31:50 -06:00
Masaki Hara
ed6c6c9a11
Disallow underscore suffix for string-like literals. 2017-05-14 21:37:50 +09:00
Andre Bogus
a9c163ebe9 Fix some clippy warnings in libsyntax
This is mostly removing stray ampersands, needless returns and lifetimes.
2017-05-12 20:05:39 +02:00
Masaki Hara
7b535e1096
Disallow ._ in float literal. 2017-05-12 22:00:06 +09:00
Masaki Hara
0e8e45c740
Allow bare CR in ////-style comment. 2017-05-08 22:29:24 +09:00
Tommy Ip
05329e5780 Remove use of Self: Sized from libsyntax
The bound is not required for compiling but it prevents using `next_token()` from a trait object.

Fixes #33506.
2017-05-04 13:19:36 +01:00
Michael Woerister
39ffea31df Implement a file-path remapping feature in support of debuginfo and reproducible builds. 2017-04-26 15:44:02 +02:00
Jeffrey Seyfried
f08d5ad4c5 Refactor how spans are combined in the parser. 2017-03-29 11:17:59 +00:00
topecongiro
8eaac0843e Parse 0e+10 as a valid floating-point literal
Fixes issue #40408.
2017-03-18 21:16:16 +09:00
Jeffrey Seyfried
61a9a14d29 Add warning cycle. 2017-02-28 22:15:12 +00:00
Eduard Burtescu
f702b20dfd rustc_save_analysis: don't pollute the codemap with fake files. 2017-02-28 08:30:07 +02:00
Jeffrey Seyfried
0b9e26f390 Fix fallout in rustdoc. 2017-01-17 21:06:45 +00:00
Jeffrey Seyfried
debcbf0b8e Refactor the parser to consume token trees. 2017-01-17 08:17:26 +00:00
Jeffrey Seyfried
de46b24758 Introduce string_reader.parse_all_token_trees(). 2017-01-17 08:16:49 +00:00
Jeffrey Seyfried
6466f55ebc Give the StringReader a sess: &ParseSess. 2017-01-17 08:16:47 +00:00
Corey Farwell
274777a158 Rename 'librustc_unicode' crate to 'libstd_unicode'.
Fixes #26554.
2016-11-30 01:24:01 -05:00
Jeffrey Seyfried
a8e86f0f81 Fix fallout in rustdoc and tests. 2016-11-21 12:16:46 +00:00
Jeffrey Seyfried
d2f8fb0a0a Move syntax::util::interner -> syntax::symbol, cleanup. 2016-11-20 23:40:20 +00:00
Jeffrey Seyfried
b7eed53b55 Remove field TtReader::next_tok. 2016-11-04 02:39:20 +00:00
Jeffrey Seyfried
7ae083383d Move doc comment desugaring into the parser. 2016-11-03 23:48:24 +00:00
Jeffrey Seyfried
e2b3fec778 Avoid recontructing the Parser in macro_parser.rs. 2016-11-03 23:48:24 +00:00
Vadim Petrochenkov
65ff4ca294 Refactor parser lookahead buffer and increase its size 2016-10-20 20:28:10 +03:00
Eduard-Mihai Burtescu
094eaf0250 Rollup merge of #37208 - jseyfried:fix_partially_consumed_tokens_in_macros, r=nrc
macros: fix partially consumed tokens in macro matchers

Fixes #37175.

This PR also avoids re-transcribing the tokens consumed by a matcher (and cloning the `TtReader` once per matcher), which improves expansion performance of the test case from #34630 by ~8%.

r? @nrc
2016-10-19 08:00:01 +03:00
Jeffrey Seyfried
9578e1a251 Fix partially consumed tokens in macro matchers. 2016-10-17 23:00:52 +00:00
Nicholas Nethercote
94b36594c6 Clarify StringReader::bump.
This commit renames the variables to make it clearer which char each one
refers to. It also slightly reorders and rearranges some statements.
2016-10-05 08:57:37 +11:00
Nicholas Nethercote
e2631208b1 Rename StringReader::curr as ch.
Likewise, rename StringReader::curr_is as ch_is.

This is a [breaking-change] for libsyntax.
2016-10-05 08:57:35 +11:00
Nicholas Nethercote
cb92f5c6d6 Rename StringReader::last_pos as pos.
This is a [breaking-change] for libsyntax.
2016-10-05 08:56:57 +11:00
Nicholas Nethercote
94565a4409 Rename StringReader::pos as next_pos.
This is a [breaking-change] for libsyntax.
2016-10-05 08:55:25 +11:00
Nicholas Nethercote
9e3dcb4549 Simplify start_bpos calculation in scan_comment().
The two branches of this `if` compute the same value. This commit gets
rid of the first branch, which makes this calculation identical to the
one in scan_block_comment().
2016-10-03 19:02:33 +11:00
Nicholas Nethercote
49960ad250 Streamline StringReader::bump.
First, assert! is redundant w.r.t. the unwrap() immediately afterwards.

Second, `byte_offset_diff` is effectively computed as
`current_byte_offset + ch.len_utf8() - current_byte_offset` (with `next`
as an intermediate) which is silly and can be simplified.
2016-10-03 18:57:18 +11:00
Nick Cameron
3863834d9c reviewer comments and rebasing 2016-09-23 07:19:31 +12:00