summary refs log tree commit diff
path: root/parse.c
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 /parse.c
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.
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c8
1 files changed, 4 insertions, 4 deletions
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)