summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2023-06-07 10:11:58 +0200
committerQuentin Carbonneaux <quentin@c9x.me>2023-06-07 10:11:58 +0200
commitbaf11b7175c468d3d9408d332b1c0d529a4957ee (patch)
tree536e8c87fe0e3219786520597d6918fb9bf6af3d
parent0d929287d77ccc3fb52ca8bd072678b5ae2c81c8 (diff)
downloadroux-baf11b7175c468d3d9408d332b1c0d529a4957ee.tar.gz
parseline() tweaks
-rw-r--r--parse.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/parse.c b/parse.c
index 5b9f60e..44c9e19 100644
--- a/parse.c
+++ b/parse.c
@@ -589,6 +589,12 @@ parseline(PState ps)
 	if (ps == PLbl && t != Tlbl && t != Trbrace)
 		err("label or } expected");
 	switch (t) {
+	case Ttmp:
+		r = tmpref(tokval.str);
+		expect(Teq);
+		k = parsecls(&ty);
+		op = next();
+		break;
 	default:
 		if (isstore(t)) {
 		case Tblit:
@@ -598,13 +604,11 @@ parseline(PState ps)
 			r = R;
 			k = Kw;
 			op = t;
-			goto DoOp;
+			break;
 		}
 		err("label, instruction or jump expected");
 	case Trbrace:
 		return PEnd;
-	case Ttmp:
-		break;
 	case Tlbl:
 		b = findblk(tokval.str);
 		if (curb && curb->jmp.type == Jxxx) {
@@ -658,21 +662,15 @@ parseline(PState ps)
 		closeblk();
 		return PLbl;
 	case Oloc:
-		expect(Tint);
 		op = Oloc;
 		k = Kw;
 		r = R;
+		expect(Tint);
 		arg[0] = INT(tokval.num);
 		if (arg[0].val != tokval.num)
 			err("line number too big");
-		arg[1] = R;
 		goto Ins;
 	}
-	r = tmpref(tokval.str);
-	expect(Teq);
-	k = parsecls(&ty);
-	op = next();
-DoOp:
 	if (op == Tcall) {
 		arg[0] = parseref();
 		parserefl(1);
@@ -681,8 +679,7 @@ DoOp:
 		if (k == Kc) {
 			k = Kl;
 			arg[1] = TYPE(ty);
-		} else
-			arg[1] = R;
+		}
 		if (k >= Ksb)
 			k = Kw;
 		goto Ins;