From 8d656f7b22badc7a1e4e48811521048ef3df7101 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 10 Jan 2019 18:49:48 +0000 Subject: asy 2.47 sources git-svn-id: svn://tug.org/texlive/trunk@49658 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/utils/asymptote/runtime.in | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'Build/source/utils/asymptote/runtime.in') 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(s); vm::item it=pop(s); bool defaultfile=isdefault(it); - camp::file *f=defaultfile ? &camp::Stdout : vm::get(it); - if(!f->isOpen()) return; + camp::ofile *f=defaultfile ? &camp::Stdout : vm::get(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(); -- cgit v1.2.3