1
Fork 0

syntax: Make static/super/self/Self keywords + special ident cleanup

This commit is contained in:
Vadim Petrochenkov 2016-04-16 18:05:06 +03:00
parent 546c052d22
commit e2c821d35e
28 changed files with 138 additions and 188 deletions

View file

@ -13,7 +13,7 @@ use ast::{self, Ident, Generics, Expr, BlockCheckMode, UnOp, PatKind};
use attr;
use codemap::{Span, respan, Spanned, DUMMY_SP, Pos};
use ext::base::ExtCtxt;
use parse::token::special_idents;
use parse::token::{keywords, special_idents};
use parse::token::InternedString;
use parse::token;
use ptr::P;
@ -602,7 +602,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
self.expr_path(self.path_ident(span, id))
}
fn expr_self(&self, span: Span) -> P<ast::Expr> {
self.expr_ident(span, special_idents::self_)
self.expr_ident(span, keywords::SelfValue.ident)
}
fn expr_binary(&self, sp: Span, op: ast::BinOpKind,
@ -1132,7 +1132,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
vis: ast::Visibility, vp: P<ast::ViewPath>) -> P<ast::Item> {
P(ast::Item {
id: ast::DUMMY_NODE_ID,
ident: special_idents::invalid,
ident: special_idents::Invalid,
attrs: vec![],
node: ast::ItemKind::Use(vp),
vis: vis,