summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apl9.h1
-rw-r--r--eval.c1
-rw-r--r--lexer.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/apl9.h b/apl9.h
index 2cf0069..d8afcb1 100644
--- a/apl9.h
+++ b/apl9.h
@@ -133,6 +133,7 @@ struct Operator
int code;
Rune *dop;
};
+ DfnFrame *scope;
Datum *left;
Datum *right;
};
diff --git a/eval.c b/eval.c
index aa74698..58a745b 100644
--- a/eval.c
+++ b/eval.c
@@ -336,6 +336,7 @@ monadop(Datum *left, Datum *right)
result->func.operator.left = left;
incdatumref(left);
result->func.left = nil;
+ result->func.scope = right->operator.scope;
return result;
}
diff --git a/lexer.c b/lexer.c
index 93fdb62..974d66e 100644
--- a/lexer.c
+++ b/lexer.c
@@ -124,6 +124,7 @@ lexline(InputStream *input, int toplevel)
stmt->toks[stmt->ntoks]->operator.type = OperatortypeDop;
stmt->toks[stmt->ntoks]->operator.dyadic = oplevel == 2;
stmt->toks[stmt->ntoks]->operator.dop = runestrdup(buf);
+ stmt->toks[stmt->ntoks]->operator.scope = getcurrentdfn();
}
}else if(peek == '('){
int unclosed = 1;