summaryrefslogtreecommitdiff
path: root/graphics/asymptote/coder.h
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/coder.h')
-rw-r--r--graphics/asymptote/coder.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/graphics/asymptote/coder.h b/graphics/asymptote/coder.h
index 0d50e8c752..76c730551c 100644
--- a/graphics/asymptote/coder.h
+++ b/graphics/asymptote/coder.h
@@ -2,7 +2,7 @@
* coder.h
* Andy Hammerlindl 2004/11/06
*
- * Handles encoding of syntax into programs. It's methods are called by
+ * Handles encoding of syntax into programs. Its methods are called by
* abstract syntax objects during translation to construct the virtual machine
* code.
*****/
@@ -149,8 +149,13 @@ public:
assert(s != DEFAULT_STATIC && s != DEFAULT_DYNAMIC);
/* Non-default static overrules. */
- if (sord != EXPLICIT_STATIC)
+ if (s == AUTOUNRAVEL || sord == AUTOUNRAVEL) {
+ sord = AUTOUNRAVEL;
+ } else if (s == EXPLICIT_STATIC || sord == EXPLICIT_STATIC) {
+ sord = EXPLICIT_STATIC;
+ } else {
sord = s;
+ }
sord_stack.push(sord);
}
@@ -161,6 +166,7 @@ public:
switch(sord) {
case DEFAULT_STATIC:
case EXPLICIT_STATIC:
+ case AUTOUNRAVEL:
return true;
case DEFAULT_DYNAMIC:
case EXPLICIT_DYNAMIC:
@@ -171,6 +177,11 @@ public:
}
}
+ bool isAutoUnravel()
+ {
+ return sord == AUTOUNRAVEL;
+ }
+
/* Remove a modifier. */
void popModifier()
@@ -311,6 +322,10 @@ public:
return encode(recordLevel);
}
+ // Puts the frame corresponding to the parent of 'ent' on the stack. Triggers
+ // an error if 'ent' does not correspond to a record (a.k.a. asy struct) type.
+ bool encodeParent(position pos, trans::tyEntry *ent);
+
// An access that encodes the frame corresponding to "this".
access *thisLocation()
{
@@ -391,7 +406,6 @@ public:
// Turn a no-op into a jump to bypass incorrect code.
void encodePatch(label from, label to);
-public:
void encodePushFrame() {
pushframeLabels.push(program->end());
encode(inst::pushframe, (Int)0);