Showing with 38 additions and 34 deletions.
  1. +1 −1 src/clone.d
  2. +2 −2 src/dinterpret.d
  3. +1 −1 src/dsymbol.d
  4. +4 −4 src/dtemplate.d
  5. +16 −16 src/expression.d
  6. +1 −1 src/init.d
  7. +4 −4 src/mtype.d
  8. +2 −1 src/parse.d
  9. +1 −1 src/s2ir.c
  10. +1 −1 src/sideeffect.d
  11. +2 −2 src/statement.d
  12. +3 −0 src/tokens.d
2 changes: 1 addition & 1 deletion src/clone.d
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ extern (C++) FuncDeclaration buildXopCmp(StructDeclaration sd, Scope* sc)
case TOKoverloadset:
s = (cast(OverExp)e).vars;
break;
case TOKimport:
case TOKscope:
s = (cast(ScopeExp)e).sds;
break;
case TOKvar:
Expand Down
4 changes: 2 additions & 2 deletions src/dinterpret.d
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ public:
printf("%s WithStatement::ctfeCompile\n", s.loc.toChars());
}
// If it is with(Enum) {...}, just execute the body.
if (s.exp.op == TOKimport || s.exp.op == TOKtype)
if (s.exp.op == TOKscope || s.exp.op == TOKtype)
{
}
else
Expand Down Expand Up @@ -1861,7 +1861,7 @@ public:
return;
}
// If it is with(Enum) {...}, just execute the body.
if (s.exp.op == TOKimport || s.exp.op == TOKtype)
if (s.exp.op == TOKscope || s.exp.op == TOKtype)
{
result = interpret(s._body, istate);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/dsymbol.d
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ public:
Expression eold = null;
for (Expression e = withstate.exp; e != eold; e = resolveAliasThis(_scope, e))
{
if (e.op == TOKimport)
if (e.op == TOKscope)
{
s = (cast(ScopeExp)e).sds;
}
Expand Down
8 changes: 4 additions & 4 deletions src/dtemplate.d
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,7 @@ public:
VarDeclaration v = null;
if (ea && ea.op == TOKtype)
ta = ea.type;
else if (ea && ea.op == TOKimport)
else if (ea && ea.op == TOKscope)
sa = (cast(ScopeExp)ea).sds;
else if (ea && (ea.op == TOKthis || ea.op == TOKsuper))
sa = (cast(ThisExp)ea).var;
Expand Down Expand Up @@ -5175,7 +5175,7 @@ public:
Expression ea = isExpression(oarg);
if (ea && (ea.op == TOKthis || ea.op == TOKsuper))
sa = (cast(ThisExp)ea).var;
else if (ea && ea.op == TOKimport)
else if (ea && ea.op == TOKscope)
sa = (cast(ScopeExp)ea).sds;
if (sa)
{
Expand Down Expand Up @@ -6823,7 +6823,7 @@ public:
ta = ea.type;
goto Ltype;
}
if (ea.op == TOKimport)
if (ea.op == TOKscope)
{
sa = (cast(ScopeExp)ea).sds;
goto Ldsym;
Expand Down Expand Up @@ -7716,7 +7716,7 @@ extern (C++) void unSpeculative(Scope* sc, RootObject o)
extern (C++) bool definitelyValueParameter(Expression e)
{
// None of these can be value parameters
if (e.op == TOKtuple || e.op == TOKimport ||
if (e.op == TOKtuple || e.op == TOKscope ||
e.op == TOKtype || e.op == TOKdottype ||
e.op == TOKtemplate || e.op == TOKdottd ||
e.op == TOKfunction || e.op == TOKerror ||
Expand Down
32 changes: 16 additions & 16 deletions src/expression.d
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ extern (C++) Expression resolvePropertiesX(Scope* sc, Expression e1, Expression
tthis = dte.e1.type;
goto Lfd;
}
else if (e1.op == TOKimport)
else if (e1.op == TOKscope)
{
s = (cast(ScopeExp)e1).sds;
if (s.isTemplateDeclaration())
Expand Down Expand Up @@ -590,7 +590,7 @@ extern (C++) Expression resolvePropertiesOnly(Scope* sc, Expression e1)
td = (cast(DotTemplateExp)e1).td;
goto Ltd;
}
else if (e1.op == TOKimport)
else if (e1.op == TOKscope)
{
Dsymbol s = (cast(ScopeExp)e1).sds;
td = s.isTemplateDeclaration();
Expand Down Expand Up @@ -5236,7 +5236,7 @@ public:

extern (D) this(Loc loc, ScopeDsymbol sds)
{
super(loc, TOKimport, __traits(classInstanceSize, ScopeExp));
super(loc, TOKscope, __traits(classInstanceSize, ScopeExp));
//printf("ScopeExp::ScopeExp(sds = '%s')\n", sds.toChars());
//static int count; if (++count == 38) *(char*)0=0;
this.sds = sds;
Expand Down Expand Up @@ -7658,7 +7658,7 @@ extern (C++) final class FileExp : UnaExp
public:
extern (D) this(Loc loc, Expression e)
{
super(loc, TOKmixin, __traits(classInstanceSize, FileExp), e);
super(loc, TOKimport, __traits(classInstanceSize, FileExp), e);
}

override Expression semantic(Scope* sc)
Expand Down Expand Up @@ -7871,7 +7871,7 @@ public:
Dsymbol ds;
switch (e1.op)
{
case TOKimport:
case TOKscope:
ds = (cast(ScopeExp)e1).sds;
goto L1;
case TOKvar:
Expand Down Expand Up @@ -8003,7 +8003,7 @@ public:
eright = e1;
}
Type t1b = e1.type.toBasetype();
if (eright.op == TOKimport) // also used for template alias's
if (eright.op == TOKscope) // also used for template alias's
{
ScopeExp ie = cast(ScopeExp)eright;
/* Disable access to another module's private imports.
Expand Down Expand Up @@ -8458,7 +8458,7 @@ public:
case TOKdottd:
s = (cast(DotTemplateExp)e).td;
break;
case TOKimport:
case TOKscope:
s = (cast(ScopeExp)e).sds;
break;
case TOKdotvar:
Expand Down Expand Up @@ -8611,7 +8611,7 @@ public:
e = e.semantic(sc);
return e;
}
else if (e.op == TOKimport)
else if (e.op == TOKscope)
{
ScopeExp se = cast(ScopeExp)e;
TemplateDeclaration td = se.sds.isTemplateDeclaration();
Expand Down Expand Up @@ -8655,7 +8655,7 @@ public:
e = e.semantic(sc);
return e;
}
if (de.e2.op == TOKimport)
if (de.e2.op == TOKscope)
{
// This should *really* be moved to ScopeExp::semantic()
ScopeExp se = cast(ScopeExp)de.e2;
Expand Down Expand Up @@ -8895,7 +8895,7 @@ public:
/* This recognizes:
* foo!(tiargs)(funcargs)
*/
if (e1.op == TOKimport)
if (e1.op == TOKscope)
{
ScopeExp se = cast(ScopeExp)e1;
TemplateInstance ti = se.sds.isTemplateInstance();
Expand Down Expand Up @@ -9032,7 +9032,7 @@ public:
if (v && ve.checkPurity(sc, v))
return new ErrorExp();
}
if (e1.op == TOKimport)
if (e1.op == TOKscope)
{
// Perhaps this should be moved to ScopeExp::semantic()
ScopeExp se = cast(ScopeExp)e1;
Expand All @@ -9053,7 +9053,7 @@ public:
tthis = de.e1.type;
e1 = de.e2;
}
if (de.e2.op == TOKimport)
if (de.e2.op == TOKscope)
{
// This should *really* be moved to ScopeExp::semantic()
ScopeExp se = cast(ScopeExp)de.e2;
Expand Down Expand Up @@ -9735,7 +9735,7 @@ public:
}
}
}
else if (e1.op == TOKimport)
else if (e1.op == TOKscope)
{
TemplateInstance ti = (cast(ScopeExp)e1).sds.isTemplateInstance();
if (ti)
Expand Down Expand Up @@ -10963,7 +10963,7 @@ public:
}
e1 = e1.semantic(sc);
e2 = e2.semantic(sc);
if (e2.op == TOKimport)
if (e2.op == TOKscope)
{
ScopeExp se = cast(ScopeExp)e2;
TemplateDeclaration td = se.sds.isTemplateDeclaration();
Expand Down Expand Up @@ -13961,7 +13961,7 @@ public:
e2 = e2.toBoolean(sc);
type = Type.tbool;
}
if (e2.op == TOKtype || e2.op == TOKimport)
if (e2.op == TOKtype || e2.op == TOKscope)
{
error("%s is not an expression", e2.toChars());
return new ErrorExp();
Expand Down Expand Up @@ -14029,7 +14029,7 @@ public:
e2 = e2.toBoolean(sc);
type = Type.tbool;
}
if (e2.op == TOKtype || e2.op == TOKimport)
if (e2.op == TOKtype || e2.op == TOKscope)
{
error("%s is not an expression", e2.toChars());
return new ErrorExp();
Expand Down
2 changes: 1 addition & 1 deletion src/init.d
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ public:
//printf("ExpInitializer::inferType() %s\n", toChars());
exp = exp.semantic(sc);
exp = resolveProperties(sc, exp);
if (exp.op == TOKimport)
if (exp.op == TOKscope)
{
ScopeExp se = cast(ScopeExp)exp;
TemplateInstance ti = se.sds.isTemplateInstance();
Expand Down
8 changes: 4 additions & 4 deletions src/mtype.d
Original file line number Diff line number Diff line change
Expand Up @@ -2724,7 +2724,7 @@ public:
s = (cast(TemplateExp)e).td;
break;

case TOKimport:
case TOKscope:
s = (cast(ScopeExp)e).sds;
// TemplateDeclaration, TemplateInstance, Import, Package, Module
break;
Expand Down Expand Up @@ -7531,7 +7531,7 @@ public:
error(loc, "argument %s to typeof is not an expression", exp.toChars());
goto Lerr;
}
if (exp.op == TOKimport)
if (exp.op == TOKscope)
{
ScopeDsymbol sds = (cast(ScopeExp)exp).sds;
if (sds.isPackage())
Expand Down Expand Up @@ -7833,7 +7833,7 @@ public:
if (e.op == TOKdotexp)
{
DotExp de = cast(DotExp)e;
if (de.e1.op == TOKimport)
if (de.e1.op == TOKscope)
{
assert(0); // cannot find a case where this happens; leave
// assert in until we do
Expand Down Expand Up @@ -8543,7 +8543,7 @@ public:
if (e.op == TOKdotexp)
{
DotExp de = cast(DotExp)e;
if (de.e1.op == TOKimport)
if (de.e1.op == TOKscope)
{
ScopeExp se = cast(ScopeExp)de.e1;
s = se.sds.search(e.loc, ident);
Expand Down
3 changes: 2 additions & 1 deletion src/parse.d
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ __gshared PREC[TOKMAX] precedence =
TOKerror : PREC_expr,
TOKtypeof : PREC_primary,
TOKmixin : PREC_primary,
TOKdotvar : PREC_primary,
TOKimport : PREC_primary,
TOKdotvar : PREC_primary,
TOKscope : PREC_primary,
TOKidentifier : PREC_primary,
TOKthis : PREC_primary,
TOKsuper : PREC_primary,
Expand Down
2 changes: 1 addition & 1 deletion src/s2ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ class S2irVisitor : public Visitor
Blockx *blx = irs->blx;

//printf("WithStatement::toIR()\n");
if (s->exp->op == TOKimport || s->exp->op == TOKtype)
if (s->exp->op == TOKscope || s->exp->op == TOKtype)
{
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/sideeffect.d
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ extern (C++) void discardValue(Expression e)
}
}
return;
case TOKimport:
case TOKscope:
e.error("%s has no effect", e.toChars());
return;
case TOKandand:
Expand Down
4 changes: 2 additions & 2 deletions src/statement.d
Original file line number Diff line number Diff line change
Expand Up @@ -2193,7 +2193,7 @@ public:
ds = (cast(VarExp)e).var;
else if (e.op == TOKtemplate)
ds = (cast(TemplateExp)e).td;
else if (e.op == TOKimport)
else if (e.op == TOKscope)
ds = (cast(ScopeExp)e).sds;
else if (e.op == TOKfunction)
{
Expand Down Expand Up @@ -4840,7 +4840,7 @@ public:
exp = checkGC(sc, exp);
if (exp.op == TOKerror)
return new ErrorStatement();
if (exp.op == TOKimport)
if (exp.op == TOKscope)
{
sym = new WithScopeSymbol(this);
sym.parent = sc.scopesym;
Expand Down
3 changes: 3 additions & 0 deletions src/tokens.d
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ enum TOK : int
TOKargTypes,
TOKref,
TOKmacro,

TOKparameters,
TOKtraits,
TOKoverloadset,
Expand All @@ -292,9 +293,11 @@ enum TOK : int
TOKgoesto,
TOKvector,
TOKpound,

TOKinterval,
TOKvoidexp,
TOKcantexp,

TOKMAX,
}

Expand Down