Skip to content

Commit

Permalink
replace prm with param in statement.d
Browse files Browse the repository at this point in the history
It is overly short and inconsistent with the rest of the file.
  • Loading branch information
thewilsonator committed Jan 7, 2025
1 parent 89546c1 commit f444bb4
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 71 deletions.
12 changes: 6 additions & 6 deletions compiler/src/dmd/astbase.d
Original file line number Diff line number Diff line change
Expand Up @@ -2004,18 +2004,18 @@ struct ASTBase
extern (C++) final class ForeachRangeStatement : Statement
{
TOK op; // TOK.foreach_ or TOK.foreach_reverse_
Parameter prm; // loop index variable
Parameter param; // loop index variable
Expression lwr;
Expression upr;
Statement _body;
Loc endloc; // location of closing curly bracket


extern (D) this(const ref Loc loc, TOK op, Parameter prm, Expression lwr, Expression upr, Statement _body, Loc endloc)
extern (D) this(const ref Loc loc, TOK op, Parameter param, Expression lwr, Expression upr, Statement _body, Loc endloc)

Check warning on line 2014 in compiler/src/dmd/astbase.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/astbase.d#L2014

Added line #L2014 was not covered by tests
{
super(loc, STMT.ForeachRange);
this.op = op;
this.prm = prm;
this.param = param;

Check warning on line 2018 in compiler/src/dmd/astbase.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/astbase.d#L2018

Added line #L2018 was not covered by tests
this.lwr = lwr;
this.upr = upr;
this._body = _body;
Expand Down Expand Up @@ -2054,17 +2054,17 @@ struct ASTBase

extern (C++) final class IfStatement : Statement
{
Parameter prm;
Parameter param;
Expression condition;
Statement ifbody;
Statement elsebody;
VarDeclaration match; // for MatchExpression results
Loc endloc; // location of closing curly bracket

extern (D) this(const ref Loc loc, Parameter prm, Expression condition, Statement ifbody, Statement elsebody, Loc endloc)
extern (D) this(const ref Loc loc, Parameter param, Expression condition, Statement ifbody, Statement elsebody, Loc endloc)

Check warning on line 2064 in compiler/src/dmd/astbase.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/astbase.d#L2064

Added line #L2064 was not covered by tests
{
super(loc, STMT.If);
this.prm = prm;
this.param = param;

Check warning on line 2067 in compiler/src/dmd/astbase.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/astbase.d#L2067

Added line #L2067 was not covered by tests
this.condition = condition;
this.ifbody = ifbody;
this.elsebody = elsebody;
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/cond.d
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ extern (C++) final class StaticForeach : RootObject
{
foreach (params; pparams)
{
auto p = aggrfe ? (*aggrfe.parameters)[i] : rangefe.prm;
auto p = aggrfe ? (*aggrfe.parameters)[i] : rangefe.param;
params.push(new Parameter(aloc, p.storageClass, p.type, p.ident, null, null));
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dmd/frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -4917,7 +4917,7 @@ class ForeachRangeStatement final : public Statement
{
public:
TOK op;
Parameter* prm;
Parameter* param;
Expression* lwr;
Expression* upr;
Statement* _body;
Expand Down Expand Up @@ -5007,7 +5007,7 @@ class GotoStatement final : public Statement
class IfStatement final : public Statement
{
public:
Parameter* prm;
Parameter* param;
Expression* condition;
Statement* ifbody;
Statement* elsebody;
Expand Down
16 changes: 8 additions & 8 deletions compiler/src/dmd/hdrgen.d
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,10 @@ private void statementToBuffer(Statement s, ref OutBuffer buf, ref HdrGenState h
{
buf.writestring(Token.toString(s.op));
buf.writestring(" (");
if (s.prm.type)
typeToBuffer(s.prm.type, s.prm.ident, buf, hgs);
if (s.param.type)
typeToBuffer(s.param.type, s.param.ident, buf, hgs);

Check warning on line 422 in compiler/src/dmd/hdrgen.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/hdrgen.d#L421-L422

Added lines #L421 - L422 were not covered by tests
else
buf.writestring(s.prm.ident.toString());
buf.writestring(s.param.ident.toString());

Check warning on line 424 in compiler/src/dmd/hdrgen.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/hdrgen.d#L424

Added line #L424 was not covered by tests
buf.writestring("; ");
s.lwr.expressionToBuffer(buf, hgs);
buf.writestring(" .. ");
Expand Down Expand Up @@ -465,7 +465,7 @@ private void statementToBuffer(Statement s, ref OutBuffer buf, ref HdrGenState h
void visitIf(IfStatement s)
{
buf.writestring("if (");
printConditionAssignment(s.prm, s.condition);
printConditionAssignment(s.param, s.condition);
buf.writeByte(')');
buf.writenl();
if (s.ifbody.isScopeStatement())
Expand Down Expand Up @@ -1168,14 +1168,14 @@ void toCBuffer(Dsymbol s, ref OutBuffer buf, ref HdrGenState hgs)

void foreachRangeWithoutBody(ForeachRangeStatement s)
{
/* s.op ( prm ; lwr .. upr )
/* s.op ( param ; lwr .. upr )
*/
buf.writestring(Token.toString(s.op));
buf.writestring(" (");
if (s.prm.type)
typeToBuffer(s.prm.type, s.prm.ident, buf, hgs);
if (s.param.type)
typeToBuffer(s.param.type, s.param.ident, buf, hgs);

Check warning on line 1176 in compiler/src/dmd/hdrgen.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/hdrgen.d#L1175-L1176

Added lines #L1175 - L1176 were not covered by tests
else
buf.writestring(s.prm.ident.toString());
buf.writestring(s.param.ident.toString());

Check warning on line 1178 in compiler/src/dmd/hdrgen.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/hdrgen.d#L1178

Added line #L1178 was not covered by tests
buf.writestring("; ");
s.lwr.expressionToBuffer(buf, hgs);
buf.writestring(" .. ");
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dmd/inline.d
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public:

override void visit(IfStatement s)
{
assert(!s.prm);
assert(!s.param);
auto econd = doInlineAs!Expression(s.condition, ids);
assert(econd);

Expand All @@ -325,7 +325,7 @@ public:

static if (asStatements)
{
result = new IfStatement(s.loc, s.prm, econd, ifbody, elsebody, s.endloc);
result = new IfStatement(s.loc, s.param, econd, ifbody, elsebody, s.endloc);
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dmd/inlinecost.d
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public:
s3.endsWithReturnStatement()
)
{
if (ifs.prm) // if variables are declared
if (ifs.param) // if variables are declared
{
cost = COST_MAX;
return;
Expand Down Expand Up @@ -258,7 +258,7 @@ public:
/* Can't declare variables inside ?: expressions, so
* we cannot inline if a variable is declared.
*/
if (s.prm)
if (s.param)
{
cost = COST_MAX;
return;
Expand Down
16 changes: 8 additions & 8 deletions compiler/src/dmd/statement.d
Original file line number Diff line number Diff line change
Expand Up @@ -890,19 +890,19 @@ extern (C++) final class ForeachStatement : Statement
extern (C++) final class ForeachRangeStatement : Statement
{
TOK op; // TOK.foreach_ or TOK.foreach_reverse_
Parameter prm; // loop index variable
Parameter param; // loop index variable
Expression lwr;
Expression upr;
Statement _body;
Loc endloc; // location of closing curly bracket

VarDeclaration key;

extern (D) this(const ref Loc loc, TOK op, Parameter prm, Expression lwr, Expression upr, Statement _body, Loc endloc) @safe
extern (D) this(const ref Loc loc, TOK op, Parameter param, Expression lwr, Expression upr, Statement _body, Loc endloc) @safe
{
super(loc, STMT.ForeachRange);
this.op = op;
this.prm = prm;
this.param = param;
this.lwr = lwr;
this.upr = upr;
this._body = _body;
Expand All @@ -911,7 +911,7 @@ extern (C++) final class ForeachRangeStatement : Statement

override ForeachRangeStatement syntaxCopy()
{
return new ForeachRangeStatement(loc, op, prm.syntaxCopy(), lwr.syntaxCopy(), upr.syntaxCopy(), _body ? _body.syntaxCopy() : null, endloc);
return new ForeachRangeStatement(loc, op, param.syntaxCopy(), lwr.syntaxCopy(), upr.syntaxCopy(), _body ? _body.syntaxCopy() : null, endloc);
}

override bool hasBreak() const pure nothrow
Expand All @@ -935,17 +935,17 @@ extern (C++) final class ForeachRangeStatement : Statement
*/
extern (C++) final class IfStatement : Statement
{
Parameter prm;
Parameter param;
Expression condition;
Statement ifbody;
Statement elsebody;
VarDeclaration match; // for MatchExpression results
Loc endloc; // location of closing curly bracket

extern (D) this(const ref Loc loc, Parameter prm, Expression condition, Statement ifbody, Statement elsebody, Loc endloc) @safe
extern (D) this(const ref Loc loc, Parameter param, Expression condition, Statement ifbody, Statement elsebody, Loc endloc) @safe
{
super(loc, STMT.If);
this.prm = prm;
this.param = param;
this.condition = condition;
this.ifbody = ifbody;
this.elsebody = elsebody;
Expand All @@ -955,7 +955,7 @@ extern (C++) final class IfStatement : Statement
override IfStatement syntaxCopy()
{
return new IfStatement(loc,
prm ? prm.syntaxCopy() : null,
param ? param.syntaxCopy() : null,
condition.syntaxCopy(),
ifbody ? ifbody.syntaxCopy() : null,
elsebody ? elsebody.syntaxCopy() : null,
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dmd/statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class ForeachRangeStatement final : public Statement
{
public:
TOK op; // TOKforeach or TOKforeach_reverse
Parameter *prm; // loop index variable
Parameter *param; // loop index variable
Expression *lwr;
Expression *upr;
Statement *_body;
Expand All @@ -364,7 +364,7 @@ class ForeachRangeStatement final : public Statement
class IfStatement final : public Statement
{
public:
Parameter *prm;
Parameter *param;
Expression *condition;
Statement *ifbody;
Statement *elsebody;
Expand Down
Loading

0 comments on commit f444bb4

Please sign in to comment.