rust/src/libsyntax
Manish Goregaokar a31658de51
Rollup merge of #33041 - petrochenkov:path, r=nrc,Manishearth
Paths are mostly parsed without taking whitespaces into account, e.g. `std :: vec :: Vec :: new ()` parses successfully, however, there are some special cases involving keywords `super`, `self` and `Self`. For example, `self::` is considered a path start only if there are no spaces between `self` and `::`. These restrictions probably made sense when `self` and friends weren't keywords, but now they are unnecessary.

The first two commits remove this special treatment of whitespaces by removing `token::IdentStyle` entirely and therefore fix https://github.com/rust-lang/rust/issues/14109.
This change also affects naked `self` and `super` (which are not tightly followed by `::`, obviously) they can now be parsed as paths, however they are still not resolved correctly in imports (cc @jseyfried, see `compile-fail/use-keyword.rs`), so https://github.com/rust-lang/rust/issues/29036 is not completely fixed.

The third commit also makes `super`, `self`, `Self` and `static` keywords nominally (before this they acted as keywords for all purposes) and removes most of remaining \"special idents\".

The last commit (before tests) contains some small improvements - some qualified paths with type parameters are parsed correctly, `parse_path` is not used for parsing single identifiers, imports are sanity checked for absence of type parameters - such type parameters can be generated by syntax extensions or by macros when https://github.com/rust-lang/rust/issues/10415 is fixed (~~soon!~~already!).

This patch changes some pretty basic things in `libsyntax`, like `token::Token` and the keyword list, so it's a plugin-[breaking-change].

r? @eddyb
2016-04-25 00:47:44 +05:30
..
diagnostics syntax: Get rid of token::IdentStyle 2016-04-24 20:59:44 +03:00
errors pacify the merciless acrichto (somewhat) 2016-04-21 04:42:25 -04:00
ext Rollup merge of #33041 - petrochenkov:path, r=nrc,Manishearth 2016-04-25 00:47:44 +05:30
parse Rollup merge of #33041 - petrochenkov:path, r=nrc,Manishearth 2016-04-25 00:47:44 +05:30
print Rollup merge of #33041 - petrochenkov:path, r=nrc,Manishearth 2016-04-25 00:47:44 +05:30
util Remove unused trait imports 2016-04-12 22:58:55 +09:00
abi.rs [breaking-change] don't glob import/export syntax::abi enum variants 2016-02-11 12:34:48 +01:00
ast.rs Rollup merge of #33041 - petrochenkov:path, r=nrc,Manishearth 2016-04-25 00:47:44 +05:30
attr.rs Use more autoderef in libsyntax 2016-02-12 19:28:42 +01:00
Cargo.toml rustbuild: Fix dist for non-host targets 2016-04-01 10:18:36 -07:00
codemap.rs port compiletest to use JSON output 2016-04-21 04:42:24 -04:00
config.rs Move span into StructField 2016-04-06 11:19:10 +03:00
entry.rs [breaking-change] don't glob export ast::Item_ variants 2016-02-11 12:34:48 +01:00
feature_gate.rs syntax: Check paths in visibilities for type parameters 2016-04-24 20:59:44 +03:00
fold.rs Rollup merge of #33041 - petrochenkov:path, r=nrc,Manishearth 2016-04-25 00:47:44 +05:30
lib.rs Remove some old code from libsyntax 2016-04-24 21:04:09 +03:00
ptr.rs Remove some old code from libsyntax 2016-04-24 21:04:09 +03:00
show_span.rs use structured errors 2015-12-30 14:27:59 +13:00
std_inject.rs syntax: Merge keywords and remaining special idents in one list 2016-04-24 20:59:44 +03:00
str.rs syntax: Copy unstable str::char_at into libsyntax 2015-04-21 10:23:53 -07:00
test.rs syntax: Merge keywords and remaining special idents in one list 2016-04-24 20:59:44 +03:00
visit.rs thread tighter span for closures around 2016-04-24 18:10:57 +05:30