Make super a keyword

This commit is contained in:
Youngsoo Son 2013-01-24 16:01:03 +09:00
parent 07d0af151a
commit 4b2aa286d8
4 changed files with 10 additions and 7 deletions

View file

@ -222,7 +222,7 @@ let log loop
match mod move mut
priv pub pure
ref return
self static struct
self static struct super
true trait type
unsafe use
while

View file

@ -1659,13 +1659,13 @@ fn subst(cx: ctxt,
}
}
// Performs substitutions on a set of substitutions (result = super(sub)) to
// Performs substitutions on a set of substitutions (result = sup(sub)) to
// yield a new set of substitutions. This is used in trait inheritance.
fn subst_substs(cx: ctxt, super: &substs, sub: &substs) -> substs {
fn subst_substs(cx: ctxt, sup: &substs, sub: &substs) -> substs {
{
self_r: super.self_r,
self_ty: super.self_ty.map(|typ| subst(cx, sub, *typ)),
tps: super.tps.map(|typ| subst(cx, sub, *typ))
self_r: sup.self_r,
self_ty: sup.self_ty.map(|typ| subst(cx, sub, *typ)),
tps: sup.tps.map(|typ| subst(cx, sub, *typ))
}
}

View file

@ -493,7 +493,7 @@ fn strict_keyword_table() -> HashMap<~str, ()> {
~"once",
~"priv", ~"pub", ~"pure",
~"ref", ~"return",
~"struct",
~"struct", ~"super",
~"true", ~"trait", ~"type",
~"unsafe", ~"use",
~"while"

View file

@ -0,0 +1,3 @@
fn main() {
let super: int; //~ ERROR found `super` in ident position
}