Vadim Petrochenkov
c389a39c97
Eliminate unnecessary Ident::with_empty_ctxt
s
2019-05-22 19:48:56 +03:00
Vadim Petrochenkov
59a382122f
Simplify use of keyword symbols
2019-05-22 19:48:56 +03:00
John Kåre Alsaker
a1f2dceaeb
Move edition
outside the hygiene lock and avoid accessing it
2019-05-21 18:17:05 +02:00
Nicholas Nethercote
88d29992bd
Remove Symbol::gensym()
.
2019-05-20 14:46:55 +10:00
Nicholas Nethercote
e57c0dbeb7
Eliminate Symbol::gensymed
.
2019-05-20 14:46:30 +10:00
Nicholas Nethercote
86cc326d06
Avoid unnecessary interning in Ident::from_str()
calls.
...
A lot of these static symbols are pre-interned.
2019-05-17 20:10:50 +10:00
Nicholas Nethercote
999c1fc281
Remove the equality operation between Symbol
and strings.
...
And also the equality between `Path` and strings, because `Path` is made
up of `Symbol`s.
2019-05-13 09:31:30 +10:00
Nicholas Nethercote
fb084a48e2
Pass a Symbol
to check_name
, emit_feature_err
, and related functions.
2019-05-13 09:29:22 +10:00
Oliver Scherer
b681433b9d
Use Rc<[Symbol]>
instead of Vec<Symbol>
to reduce # of allocs
2019-02-11 15:08:17 +01:00
Oliver Scherer
d3c212c552
Require a list of features to allow in allow_internal_unstable
2019-02-11 15:08:16 +01:00
Taiki Endo
7bb082d27f
libsyntax => 2018
2019-02-07 02:33:01 +09:00
Mark Rousskov
2a663555dd
Remove licenses
2018-12-25 21:08:33 -07:00
Vadim Petrochenkov
08f8faedd0
syntax: Rename some keywords
...
`CrateRoot` -> `PathRoot`, `::` doesn't necessarily mean crate root now
`SelfValue` -> `SelfLower`, `SelfType` -> `SelfUpper`, both `self` and `Self` can be used in type and value namespaces now
2018-12-04 00:30:27 +03:00
Donato Sciarra
062bfbf39b
mv codemap source_map
2018-08-19 23:01:01 +02:00
Donato Sciarra
82607d2cf3
mv (mod) codemap source_map
2018-08-19 23:01:00 +02:00
Eduard-Mihai Burtescu
cd47831bf0
syntax: gensym the injected std/core extern crates in the Rust 2018 edition.
2018-08-14 07:06:46 +03:00
Vadim Petrochenkov
d347270e0c
Implement #[macro_export(local_inner_macros)]
2018-06-27 13:10:16 +03:00
Vadim Petrochenkov
20ce91076a
hygiene: Merge NameAndSpan
into ExpnInfo
2018-06-23 21:53:24 +03:00
Vadim Petrochenkov
640884bad0
Add edition to expansion info
2018-05-17 23:13:08 +03:00
Russell Cohen
084d2bc479
Reorder injection of std to get better compilation error
2018-04-16 12:28:30 -07:00
Oliver Schneider
679657b863
Inject the compiler_builtins
crate whenever the core
crate is injected
2018-04-07 09:24:35 +02:00
Vadim Petrochenkov
3a30bad6de
Use Ident
instead of Name
in MetaItem
2018-04-06 11:52:16 +03:00
Vadim Petrochenkov
b3b5ef186c
Remove more duplicated spans
2018-04-06 11:50:49 +03:00
Vadim Petrochenkov
f88162654d
Rename Span::empty
to Span::shrink_to_lo
, add Span::shrink_to_hi
2018-03-17 22:12:21 +03:00
Vadim Petrochenkov
e5fb13897d
AST: Keep distinction between path
and ::path
in imports and visibilities
...
Add the root segment for name resolution purposes only
2018-03-17 22:12:21 +03:00
Vadim Petrochenkov
c6c6cf9515
AST/HIR: Clarify what the optional name in extern crate items mean
2018-03-17 22:12:21 +03:00
Seiichi Uchida
b5099a708d
Replace dummy spans with empty spans
2018-02-18 00:10:40 +09:00
Seiichi Uchida
d6bdf296a4
Change ast::Visibility to Spanned type
2018-02-18 00:10:40 +09:00
Jeffrey Seyfried
85d19b3335
Improve pretty printing $crate::
paths.
2017-12-12 22:32:19 -08:00
Pietro Albini
91ba8b42fc
Implement RFC 2128 (use_nested_groups)
...
This commit adds support for nested groups inside `use` declarations,
such as `use foo::{bar, sub::{baz::Foo, *}};`.
2017-11-30 13:10:26 +01:00
Vadim Petrochenkov
3da868dcb6
Make fields of Span
private
2017-08-30 01:38:54 +03: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
Eduard-Mihai Burtescu
8a4facc3c3
syntax: #[allow_internal_unsafe] bypasses the unsafe_code lint in macros.
2017-08-12 09:14:50 +03:00
Alex Crichton
9b2f7624ec
syntax: Add tokens: Option<TokenStream>
to Item
...
This commit adds a new field to the `Item` AST node in libsyntax to optionally
contain the original token stream that the item itself was parsed from. This is
currently `None` everywhere but is intended for use later with procedural
macros.
2017-07-28 07:58:20 -07:00
Jeffrey Seyfried
1f175fa35d
Hygienize librustc_resolve
.
2017-05-25 05:51:50 +00: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
Jeffrey Seyfried
ec7c0aece1
Merge ExpnId
and SyntaxContext
.
2017-03-29 00:41:10 +00:00
bors
9c15de4fd5
Auto merge of #40346 - jseyfried:path_and_tokenstream_attr, r=nrc
...
`TokenStream`-based attributes, paths in attribute and derive macro invocations
This PR
- refactors `Attribute` to use `Path` and `TokenStream` instead of `MetaItem`.
- supports macro invocation paths for attribute procedural macros.
- e.g. `#[::foo::attr_macro] struct S;`, `#[cfg_attr(all(), foo::attr_macro)] struct S;`
- supports macro invocation paths for derive procedural macros.
- e.g. `#[derive(foo::Bar, super::Baz)] struct S;`
- supports arbitrary tokens as arguments to attribute procedural macros.
- e.g. `#[foo::attr_macro arbitrary + tokens] struct S;`
- supports using arbitrary tokens in "inert attributes" with derive procedural macros.
- e.g. `#[derive(Foo)] struct S(#[inert arbitrary + tokens] i32);`
where `#[proc_macro_derive(Foo, attributes(inert))]`
r? @nrc
2017-03-19 10:56:08 +00:00
Jeffrey Seyfried
68c1cc68b4
Refactor Attribute
to use Path
and TokenStream
instead of MetaItem
.
2017-03-14 04:03:43 +00:00
Vadim Petrochenkov
32575a0487
Give spans to individual path segments in AST
2017-03-10 08:21:45 -08:00
Guillaume Gomez
62fb7fc54a
Switch logic to Span instead of HashMap
2017-02-03 11:08:20 +01:00
Jeffrey Seyfried
f10f50b426
Refactor how global paths are represented (for both ast and hir).
2016-12-22 06:14:35 +00:00
Jeffrey Seyfried
8e61ff25d8
Optimize ast::PathSegment
.
2016-12-19 20:57:00 +00:00
Jeffrey Seyfried
d2f8fb0a0a
Move syntax::util::interner
-> syntax::symbol
, cleanup.
2016-11-20 23:40:20 +00:00
Jeffrey Seyfried
f177a00ac9
Refactor P<ast::MetaItem>
-> ast::MetaItem
.
2016-11-20 12:36:41 +00:00
Jeffrey Seyfried
e97686d048
Move MetaItemKind
's Name
to a field of MetaItem
.
2016-11-20 12:36:30 +00:00
Jeffrey Seyfried
a2626410d7
Refactor MetaItemKind
to use Name
s instead of InternedString
s.
2016-11-20 11:46:06 +00:00
Jeffrey Seyfried
3ea2bc4e93
Refactor away ast::Attribute_
.
2016-11-20 11:46:00 +00:00
Jeffrey Seyfried
2df25adbed
Combine std_inject::{no_core, no_std}
into std_inject::injected_crate_name
.
2016-10-07 21:54:01 +00:00
Jonathan Turner
6ae3502134
Move errors from libsyntax to its own crate
2016-06-23 08:07:35 -04:00