Commit Graph

14 Commits

Author SHA1 Message Date
Igor Aleksanov
993b920032 librustc_lexer: Enhance documentation
Apply review suggestions

Apply review suggestions
2019-10-27 20:08:08 +03:00
Aleksey Kladov
060fe88610 fill metadata in rustc_lexer's Cargo.toml
We publish this to crates.io, so having non-empty meta is useful
2019-09-05 23:03:50 +03:00
Aleksey Kladov
206fe8e1c3 flatten rustc_lexer::character_properties module
On the call site, `rustc_lexer::is_whitespace` reads much better than
`character_properties::is_whitespace`.
2019-09-04 15:13:29 +03:00
Aleksey Kladov
a0c186c34f remove XID and Pattern_White_Space unicode tables from libcore
They are only used by rustc_lexer, and are not needed elsewhere.

So we move the relevant definitions into rustc_lexer (while the actual
unicode data comes from the unicode-xid crate) and make the rest of
the compiler use it.
2019-09-04 13:11:11 +03:00
Aleksey Kladov
8b932dfda7 remove composite tokens support from the lexer 2019-08-19 21:59:09 +03:00
Aleksey Kladov
911398b96c remove special handling of \r\n from the lexer 2019-08-14 16:38:40 +03:00
Vadim Petrochenkov
36d8f86924 librustc_lexer: Unconfigure tests during normal build 2019-08-02 01:59:01 +03:00
topecongiro
98f29f5e38
Add comment 2019-07-27 22:10:09 +09:00
topecongiro
13b41000ea
Add lib section to rustc_lexer's Cargo.toml 2019-07-27 17:21:42 +09:00
Mark Rousskov
f11ffd3a6a
Rollup merge of #62869 - matklad:feature-gate, r=Mark-Simulacrum
add rustc_private as a proper language feature gate

At the moment, `rustc_private` as a (library) feature exists by
accident: `char::is_xid_start`, `char::is_xid_continue` methods in
libcore define it.

cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F

I don't know if this is at all reasonable, but at least tests seem to pass locally. That probably means that we can remove/rename to something more resonable the feature in libcore in the next release?
2019-07-23 12:51:18 -04:00
Aleksey Kladov
7e612c19be
Update src/librustc_lexer/src/lib.rs
Co-Authored-By: Ralf Jung <post@ralfj.de>
2019-07-23 10:38:18 +03:00
Aleksey Kladov
27b703dd40 add rustc_private as a proper language feature gate
At the moment, `rustc_private` as a (library) feature exists by
accident: `char::is_xid_start`, `char::is_xid_continue` methods in
libcore define it.
2019-07-22 16:32:13 +03:00
Aleksey Kladov
e63fe150bf move unescape module to rustc_lexer 2019-07-21 16:46:11 +03:00
Aleksey Kladov
395ee0b79f Introduce rustc_lexer
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-20 21:12:34 +03:00