summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/entry.h
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-06-08 13:46:05 +0000
committerKarl Berry <karl@freefriends.org>2010-06-08 13:46:05 +0000
commita960e44eb527236f39aec81babc0474911a86078 (patch)
tree9950eca71791d90820a80a521a7cc252c0955db5 /Build/source/utils/asymptote/entry.h
parent6443467452320c296faa1f43f0606a9457bd4463 (diff)
asy 1.96
git-svn-id: svn://tug.org/texlive/trunk@18817 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/entry.h')
-rw-r--r--Build/source/utils/asymptote/entry.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/entry.h b/Build/source/utils/asymptote/entry.h
index 5d02a9c61f2..66d98628d05 100644
--- a/Build/source/utils/asymptote/entry.h
+++ b/Build/source/utils/asymptote/entry.h
@@ -230,6 +230,13 @@ class venv {
key(symbol *name, ty *t)
: name(name), t(t) {}
+ /* A fake key used for searching just based on a signature. */
+ key(symbol *name, signature *sig)
+ : name(name), t(new types::function(types::primError(), sig))
+ {
+ assert(!name->special);
+ }
+
key(symbol *name, varEntry *v)
: name(name), t(v->getType()) {}
};
@@ -342,6 +349,13 @@ public:
return lookByType(key(name, t));
}
+ // An optimization heuristic. Try to guess the signature of a variable and
+ // look it up. This is allowed to return 0 even if the appropriate variable
+ // exists.
+ varEntry *lookBySignature(symbol *name, signature *sig) {
+ return name->special ? 0 : lookByType(key(name, sig));
+ }
+
ty *getType(symbol *name);
void beginScope() {