summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2017-04-16 14:43:16 -0400
committerQuentin Carbonneaux <quentin@c9x.me>2017-04-16 14:50:13 -0400
commit138b09af877707bde9188c292ff98d3d81fe288b (patch)
tree294e6aeb4a79f30853a32532561b8e09d8c0742d
parentb9c8724ea50e92ee7215fca6edadcb5755b2a578 (diff)
downloadroux-138b09af877707bde9188c292ff98d3d81fe288b.tar.gz
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.
-rw-r--r--ops.h4
-rw-r--r--parse.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/ops.h b/ops.h
index 848671a..114310c 100644
--- 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
index 5631bc2..b7bab5b 100644
--- 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)