t3x/t3x9-book/t.pl3

24 lines
550 B
Plaintext
Raw Normal View History

2022-05-12 13:47:58 +00:00
--- t.t.old 2018-03-22 08:59:31.000000000 +0100
+++ t.t 2018-03-22 09:01:22.000000000 +0100
@@ -1389,15 +1389,18 @@
else
expect(%1, "statement");
-compound() do var oyp, olp, onp;
+compound() do var oyp, olp, onp, msg;
+ msg := "unexpected end of compound statement";
T := scan();
oyp := Yp;
onp := Np;
olp := Lp;
while (T = KVAR \/ T = KCONST \/ T = KSTRUCT)
declaration(0);
- while (T \= KEND)
+ while (T \= KEND) do
+ if (T = ENDFILE) aw(msg, 0);
stmt();
+ end
T := scan();
if (olp-Lp \= 0)
gen(CG_DEALLOC, olp-Lp);