From 4e8ea57821d8deaccd9ffb47ff7a4a7f505880c5 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Wed, 9 Jun 2010 11:48:18 +0000 Subject: * interp/g-opt.boot (removeNeedlessThrow): Tidy. --- src/interp/g-opt.boot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/interp') diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index ad2cff91..3557f554 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -145,13 +145,17 @@ changeThrowToGo(s,g) == ++ Change any `(THROW tag (%return expr))' in x to just ++ `(%return expr) since a return-operator transfer control -++ out of the function body anyway. +++ out of the function body anyway. Similarly, transform +++ reudant `(THROW tag (THROW tag expr))' to `(THROW tag expr)'. removeNeedlessThrow x == isAtomicForm x => x x is ['THROW,.,y] and y is ['%return,:.] => removeNeedlessThrow third y x.op := y.op x.args := y.args + x is ['THROW,g,y] and y is ['THROW,=g,z] => + removeNeedlessThrow z + second(x.args) := z for x' in x repeat removeNeedlessThrow x' -- cgit v1.2.3