summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/runtime.in
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-01-10 18:49:48 +0000
committerKarl Berry <karl@freefriends.org>2019-01-10 18:49:48 +0000
commit8d656f7b22badc7a1e4e48811521048ef3df7101 (patch)
tree207c9332ac340eef8b84e90d67a0f0c6a734e547 /Build/source/utils/asymptote/runtime.in
parentc75ad7aa4d5821b7c4034c949a5ed2401e589bea (diff)
asy 2.47 sources
git-svn-id: svn://tug.org/texlive/trunk@49658 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/runtime.in')
-rw-r--r--Build/source/utils/asymptote/runtime.in26
1 files changed, 24 insertions, 2 deletions
diff --git a/Build/source/utils/asymptote/runtime.in b/Build/source/utils/asymptote/runtime.in
index da26c9f88cd..f3b6899cb45 100644
--- a/Build/source/utils/asymptote/runtime.in
+++ b/Build/source/utils/asymptote/runtime.in
@@ -197,8 +197,8 @@ void writestring(stack *s)
string S=pop<string>(s);
vm::item it=pop(s);
bool defaultfile=isdefault(it);
- camp::file *f=defaultfile ? &camp::Stdout : vm::get<camp::file*>(it);
- if(!f->isOpen()) return;
+ camp::ofile *f=defaultfile ? &camp::Stdout : vm::get<camp::ofile*>(it);
+ if(!f->isOpen() || !f->enabled()) return;
if(S != "") f->write(S);
if(f->text()) {
if(suffix) {
@@ -208,6 +208,13 @@ void writestring(stack *s)
}
}
+string toplocation() {
+ ostringstream buf;
+ position& topPos=processData().topPos;
+ buf << topPos.Line() << "." << topPos.Column();
+ return buf.str();
+}
+
string emptystring;
pair zero;
@@ -737,6 +744,21 @@ void _eval(runnable *s, bool embedded)
runCode(ast);
}
+string xasyKEY() {
+ processDataStruct *P=&processData();
+ xkey_t *xkey=&P->xkey;
+ xkey_t::iterator p=xkey->find(P->topPos.LineColumn());
+ return p != xkey->end() ? p->second+" 1" : toplocation()+" 0";
+}
+
+void xasyKEY(string *s) {
+ processData().KEY=*s;
+}
+
+string toplocation() {
+ return toplocation();
+}
+
string location() {
ostringstream buf;
buf << getPos();