summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/stm.cc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-01-02 16:31:31 +0000
committerKarl Berry <karl@freefriends.org>2021-01-02 16:31:31 +0000
commit6457cd3f6e21e23e21db6dafff021d17f5457567 (patch)
tree08f169333e47c5fc1c50e828cf3a0f50bdf9b508 /Build/source/utils/asymptote/stm.cc
parentdc2504a4c02af0ec2fff00e6b833c6143a06b4cd (diff)
asy 2.68 sources
git-svn-id: svn://tug.org/texlive/trunk@57291 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/stm.cc')
-rw-r--r--Build/source/utils/asymptote/stm.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/Build/source/utils/asymptote/stm.cc b/Build/source/utils/asymptote/stm.cc
index b45e6f98e4e..8cd74a0c346 100644
--- a/Build/source/utils/asymptote/stm.cc
+++ b/Build/source/utils/asymptote/stm.cc
@@ -80,7 +80,7 @@ void tryToWriteTypeOfExp(types::ty *t, exp *body)
cout << ">" << endl;
}
}
-
+
// From dec.cc:
varEntry *makeVarEntry(position pos, coenv &e, record *r, types::ty *t);
@@ -103,7 +103,7 @@ void storeAndWriteExp(coenv &e, types::ty *t, exp *expr) {
position pos=expr->getPos();
baseExpTrans(e, new callExp(pos, new nameExp(pos, "write"),
- new nameExp(pos, "operator answer")));
+ new nameExp(pos, "operator answer")));
}
void tryToWriteExp(coenv &e, exp *expr)
@@ -112,7 +112,7 @@ void tryToWriteExp(coenv &e, exp *expr)
types::ty *t=expr->cgetType(e);
if(!t) return;
-
+
// If the original expression is bad, just print the errors.
// If it is a function which returns void, just call the function.
if (t->kind == ty_error || t->kind == ty_void) {
@@ -130,7 +130,7 @@ void tryToWriteExp(coenv &e, exp *expr)
expr->trans(e);
em.sync();
assert(em.errors());
-
+
// Then, write out all of the types.
tryToWriteTypeOfExp(t, expr);
}
@@ -163,7 +163,7 @@ void tryToWriteExp(coenv &e, exp *expr)
void expStm::interactiveTrans(coenv &e)
{
// First check if it is the kind of expression that should be written.
- if (body->writtenToPrompt() &&
+ if (body->writtenToPrompt() &&
settings::getSetting<bool>("interactiveWrite"))
tryToWriteExp(e, body);
else
@@ -189,7 +189,7 @@ void ifStm::trans(coenv &e)
test->transConditionalJump(e, false, elseLabel);
onTrue->markTrans(e);
-
+
if (onFalse) {
// Encode the jump around the 'else' clause at the end of the 'if' clause
e.c.useLabel(inst::jmp,end);
@@ -208,7 +208,7 @@ void ifStm::trans(coenv &e)
void transLoopBody(coenv &e, stm *body) {
// The semantics of the language are defined so that any variable declared
// inside a loop are new variables for each iteration of the loop. For
- // instance, the code
+ // instance, the code
//
// int f();
// for (int i = 0; i < 10; ++i) {
@@ -287,11 +287,11 @@ void doStm::trans(coenv &e)
label testLabel = e.c.fwdLabel();
label end = e.c.fwdLabel();
e.c.pushLoop(testLabel, end);
-
+
label start = e.c.defNewLabel();
- transLoopBody(e,body);
-
+ transLoopBody(e,body);
+
e.c.defLabel(testLabel);
test->transConditionalJump(e, true, start);
@@ -331,7 +331,7 @@ void forStm::trans(coenv &e)
transLoopBody(e,body);
e.c.defLabel(ctarget);
-
+
if (update)
update->markTrans(e);
e.c.useLabel(inst::jmp,start);
@@ -377,7 +377,7 @@ void extendedForStm::trans(coenv &e) {
if (at->kind != ty_array) {
em.error(set->getPos());
em << "expression is not an array of inferable type";
-
+
// On failure, don't bother trying to translate the loop.
return;
}
@@ -397,7 +397,7 @@ void extendedForStm::trans(coenv &e) {
// { start var=a[i]; body }
block b(pos);
decid dec2(pos,
- new decidstart(pos, var),
+ new decidstart(pos, var),
new subscriptExp(pos, new nameExp(pos, a),
new nameExp(pos, i)));
b.add(new vardec(pos, start, &dec2));
@@ -407,9 +407,9 @@ void extendedForStm::trans(coenv &e) {
// <block>
forStm(pos,
new vardec(pos, new tyEntryTy(pos, primInt()),
- new decid(pos,
- new decidstart(pos, i),
- new intExp(pos, 0))),
+ new decid(pos,
+ new decidstart(pos, i),
+ new intExp(pos, 0))),
new binaryExp(pos,
new nameExp(pos, i),
SYM_LT,
@@ -420,7 +420,7 @@ void extendedForStm::trans(coenv &e) {
new expStm(pos, new prefixExp(pos, new nameExp(pos, i), SYM_PLUS)),
new blockStm(pos, &b)).trans(e);
}
-
+
void breakStm::prettyprint(ostream &out, Int indent)
{
@@ -444,7 +444,7 @@ void continueStm::prettyprint(ostream &out, Int indent)
void continueStm::trans(coenv &e)
{
if (!e.c.encodeContinue()) {
- em.error(getPos());
+ em.error(getPos());
em << "continue statement outside of a loop";
}
}