commit 138b09af877707bde9188c292ff98d3d81fe288b
parent b9c8724ea50e92ee7215fca6edadcb5755b2a578
Author: Quentin Carbonneaux <quentin@c9x.me>
Date: Sun, 16 Apr 2017 14:43:16 -0400
minor changes for env parameter
Since the environment can only be of type `l`, do
not require to write it down.
I also tightened the type information of the `pare`
and `arge` instructions.
Diffstat:
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/ops.h b/ops.h
@@ -133,10 +133,10 @@ O(afcmp, T(e,e,s,d, e,e,s,d), 0) X(0, 0, 0)
/* Arguments, Parameters, and Calls */
O(par, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 0)
O(parc, T(e,x,e,e, e,x,e,e), 0) X(0, 0, 0)
-O(pare, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 0)
+O(pare, T(e,x,e,e, e,x,e,e), 0) X(0, 0, 0)
O(arg, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 0)
O(argc, T(e,x,e,e, e,l,e,e), 0) X(0, 0, 0)
-O(arge, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 0)
+O(arge, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0)
O(call, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0)
O(vacall, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0)
diff --git a/parse.c b/parse.c
@@ -450,16 +450,16 @@ parserefl(int arg)
if (curi - insb >= NIns)
err("too many instructions (1)");
env = peek() == Tenv;
- if (env)
+ if (env) {
next();
- k = parsecls(&ty);
+ k = Kl;
+ } else
+ k = parsecls(&ty);
r = parseref();
if (req(r, R))
err("invalid argument");
if (hasenv && env)
err("only one environment allowed");
- if (env && k != Kl)
- err("environment must be of type l");
if (!arg && rtype(r) != RTmp)
err("invalid function parameter");
if (k == 4)