From d591334e9d616830fbd24909db2e21ac4b959742 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 22 Jun 2004 13:09:55 +0000 Subject: 20076, 20084: { ... } always { ... } syntax. --- Src/text.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'Src/text.c') diff --git a/Src/text.c b/Src/text.c index 794a04df9..f7d80ae73 100644 --- a/Src/text.c +++ b/Src/text.c @@ -350,6 +350,8 @@ gettext2(Estate state) taddnl(); n = tpush(code, 1); n->u._subsh.end = state->pc + WC_SUBSH_SKIP(code); + /* skip word only use for try/always */ + state->pc++; } else { state->pc = s->u._subsh.end; tindent--; @@ -365,6 +367,8 @@ gettext2(Estate state) taddnl(); n = tpush(code, 1); n->u._subsh.end = state->pc + WC_CURSH_SKIP(code); + /* skip word only use for try/always */ + state->pc++; } else { state->pc = s->u._subsh.end; tindent--; @@ -721,6 +725,30 @@ gettext2(Estate state) taddstr("))"); stack = 1; break; + case WC_TRY: + if (!s) { + taddstr("{"); + tindent++; + taddnl(); + n = tpush(code, 0); + state->pc++; + /* this is the end of the try block alone */ + n->u._subsh.end = state->pc + WC_CURSH_SKIP(state->pc[-1]); + } else if (!s->pop) { + state->pc = s->u._subsh.end; + tindent--; + taddnl(); + taddstr("} always {"); + tindent++; + taddnl(); + s->pop = 1; + } else { + tindent--; + taddnl(); + taddstr("}"); + stack = 1; + } + break; case WC_END: stack = 1; break; -- cgit 1.4.1