implement semantics of scope keywords