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
Jeffrey Seyfried
49de80d7ea
Refactor away the prelude injection pass
2016-06-07 00:31:42 +00:00
Vadim Petrochenkov
b32d7b5923
syntax: Merge keywords and remaining special idents in one list
...
Simplify the macro used for generation of keywords
Make `Keyword::ident` private
2016-04-24 20:59:44 +03:00
Vadim Petrochenkov
e2c821d35e
syntax: Make static/super/self/Self keywords + special ident cleanup
2016-04-24 20:59:44 +03:00
Oliver 'ker' Schneider
d844bfb196
[breaking-change] don't glob export ast::Visibility variants
2016-02-11 12:34:48 +01:00
Oliver 'ker' Schneider
14e09ad468
[breaking-change] don't glob export ast::MetaItem_
2016-02-11 12:34:48 +01:00
Oliver 'ker' Schneider
019614f03d
[breaking-change] don't glob export ast::Item_ variants
2016-02-11 12:34:48 +01:00
Ms2ger
b093060c2a
Stop re-exporting AttrStyle's variants and rename them.
2015-10-01 18:03:34 +02:00
Manish Goregaokar
25cbb4385e
Move ExpnInfo to Name
2015-08-28 03:37:13 +05:30
Manish Goregaokar
4ec7b713dd
Enumify CompilerExpansion in ExpnInfo
2015-08-27 05:16:05 +05:30
Alex Crichton
5cccf3cd25
syntax: Implement #![no_core]
...
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of
the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The
`#![no_std]` attribute now injects `extern crate core` at the top of the crate
as well as the libcore prelude into all modules (in the same manner as the
standard library's prelude). The `#![no_core]` attribute disables both std and
core injection.
[rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-08-03 17:23:01 -07:00
Oliver Schneider
00a5e66f81
remove get_ident
and get_name
, make as_str
sound
2015-07-28 18:07:20 +02:00