summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/process.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/process.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/process.cc')
-rw-r--r--Build/source/utils/asymptote/process.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/Build/source/utils/asymptote/process.cc b/Build/source/utils/asymptote/process.cc
index 20557858c5d..acfd2f5e7f1 100644
--- a/Build/source/utils/asymptote/process.cc
+++ b/Build/source/utils/asymptote/process.cc
@@ -1,6 +1,6 @@
/*****
* process.cc
- * Andy Hammerlindl 2006/08/19
+ * Andy Hammerlindl 2006/08/19
*
* Handles processing blocks of code (including files, strings, and the
* interactive prompt, for listing and parse-only modes as well as actually
@@ -41,7 +41,7 @@ void purge(Int divisor=0);
}
namespace vm {
-bool indebugger;
+bool indebugger;
}
using namespace settings;
@@ -139,7 +139,7 @@ public:
absyntax::prettyname(out, "interactiveRunnable", indent);
base->prettyprint(out, indent+1);
}
-
+
void trans(coenv &e) {
base->interactiveTrans(e);
}
@@ -150,7 +150,7 @@ public:
base->transAsField(e, r);
}
};
-
+
enum transMode {
TRANS_INTERACTIVE,
TRANS_NORMAL
@@ -177,7 +177,7 @@ bool runRunnable(runnable *r, coenv &e, istack &s, transMode tm=TRANS_NORMAL) {
// Should an interactive error hurt the status?
em.statusError();
- return false;
+ return false;
}
return true;
}
@@ -218,7 +218,7 @@ public:
try {
if(purge) run::purge();
-
+
penv pe;
env base_env(pe.ge());
coder base_coder(nullPos, "icore::doRun");
@@ -244,9 +244,9 @@ public:
} catch(handled_error) {
em.statusError();
}
-
+
run::cleanup();
-
+
em.clear();
}
@@ -366,7 +366,7 @@ public:
: itree(filename),
filename(filename),
outname(stripDir(stripExt(string(filename == "-" ? settings::outname() : filename), suffix))) {}
-
+
block *buildTree() {
return !filename.empty() ? parser::parseFile(filename,"Loading") : 0;
}
@@ -394,7 +394,7 @@ public:
if (verbose >= 1)
cout << "Processing " << outname << endl;
-
+
try {
icore::process(purge);
}
@@ -593,13 +593,13 @@ class iprompt : public icore {
void postRun(coenv &, istack &) {
}
-
+
// Commands are chopped into the starting word and the rest of the line.
struct commandLine {
string line;
string word;
string rest;
-
+
commandLine(string line) : line(line) {
string::iterator c=line.begin();
@@ -783,10 +783,10 @@ class iprompt : public icore {
// Continue taking input until a termination command is received from xasy.
block *parseXasyLine(string line) {
-
-#ifdef __MSDOS__
+
+#ifdef __MSDOS__
const string EOT="\x04\r\n";
-#else
+#else
const string EOT="\x04\n";
#endif
string s;
@@ -799,12 +799,12 @@ class iprompt : public icore {
try {
if(getSetting<bool>("multiline")) {
block *code=parseExtendableLine(line);
-
+
icode i(code);
i.run(e,s,TRANS_INTERACTIVE);
} else if(getSetting<bool>("xasy")) {
block *code=parseXasyLine(line);
-
+
icode i(code);
i.run(e,s,TRANS_INTERACTIVE);
} else {
@@ -888,7 +888,7 @@ public:
restart=false;
}
} while(restart);
-
+
interact::cleanup_interactive();
}
};
@@ -969,7 +969,7 @@ public:
assert(!em.errors()); // TODO: Decide how to handle prior errors.
try {
- { withProcessData token(pe.pd());
+ { withProcessData token(pe.pd());
::runRunnable(r, e, s, TRANS_INTERACTIVE);
}
} catch(std::bad_alloc&) {