From c2175edc7aa44ca0b526f008d473d6f8a8ac4933 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 14 Jun 2010 23:14:16 +0000 Subject: asy 1.98 git-svn-id: svn://tug.org/texlive/trunk@18982 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/utils/asymptote/env.h | 39 ++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'Build/source/utils/asymptote/env.h') diff --git a/Build/source/utils/asymptote/env.h b/Build/source/utils/asymptote/env.h index 1d9b2be1166..40569dd5390 100644 --- a/Build/source/utils/asymptote/env.h +++ b/Build/source/utils/asymptote/env.h @@ -37,7 +37,7 @@ public: tenv te; venv ve; - access *baseLookupCast(ty *target, ty *source, symbol *name); + access *baseLookupCast(ty *target, ty *source, symbol name); public: // Start an environment for a file-level module. @@ -61,24 +61,24 @@ public: te.collapseScope(); ve.collapseScope(); } - tyEntry *lookupTyEntry(symbol *s) + tyEntry *lookupTyEntry(symbol s) { return te.look(s); } - ty *lookupType(symbol *s) + ty *lookupType(symbol s) { tyEntry *ent=lookupTyEntry(s); return ent ? ent->t : 0; } - varEntry *lookupVarByType(symbol *name, ty *t) + varEntry *lookupVarByType(symbol name, ty *t) { // Search in local vars. return ve.lookByType(name, t); } - varEntry *lookupVarBySignature(symbol *name, types::signature *sig) + varEntry *lookupVarBySignature(symbol name, types::signature *sig) { return ve.lookBySignature(name, sig); } @@ -94,27 +94,34 @@ public: } // Find the function that handles casting between the types. - // The name is "operator cast" for implicitCasting and "operator ecast" for + // The name is "operator cast" for implicit casting and "operator ecast" for // explicit. - access *lookupCast(ty *target, ty *source, symbol *name); - bool castable(ty *target, ty *source, symbol *name); + access *lookupCast(ty *target, ty *source, symbol name); + bool castable(ty *target, ty *source, symbol name); + + +#ifdef FASTCAST + // A cast lookup designed to work quickly with the application matching + // code. The target type must not be overloaded. + bool fastCastable(ty *target, ty *source); +#endif // Given overloaded types, this resolves which types should be the target and // the source of the cast. - ty *castTarget(ty *target, ty *source, symbol *name); - ty *castSource(ty *target, ty *source, symbol *name); + ty *castTarget(ty *target, ty *source, symbol name); + ty *castSource(ty *target, ty *source, symbol name); - ty *varGetType(symbol *name) + ty *varGetType(symbol name) { return ve.getType(name); } - void addType(symbol *name, tyEntry *desc) + void addType(symbol name, tyEntry *desc) { te.enter(name, desc); } - void addVar(symbol *name, varEntry *desc) + void addVar(symbol name, varEntry *desc) { // Don't check for multiple variables, as this makes adding casts // and initializers harder. @@ -130,7 +137,7 @@ public: // Add variables and types of name src from another environment under the // name dest in this environment. - bool add(symbol *src, symbol *dest, + bool add(symbol src, symbol dest, protoenv &source, varEntry *qualifier, coder &c) { return te.add(src, dest, source.te, qualifier, c) | @@ -149,7 +156,7 @@ public: // Adds to a list the keywords in the environment that start with the given // prefix. Used for automatic completion at the interactive prompt. - typedef mem::list symbol_list; + typedef mem::list symbol_list; void completions(symbol_list &l, string start) { te.completions(l, start); @@ -172,7 +179,7 @@ public: ~env(); - record *getModule(symbol *id, string filename); + record *getModule(symbol id, string filename); }; } // namespace trans -- cgit v1.2.3