From 1b28a5f062b5658c3c51b81d34edd27983385cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Fri, 6 Jul 2012 21:50:15 +0000 Subject: [PATCH] [COMPILER] * BUG: Like can be used in a Case expression just after the Case keyword only. git-svn-id: svn://localhost/gambas/trunk@4900 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- main/gbc/gbc_trans_ctrl.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/main/gbc/gbc_trans_ctrl.c b/main/gbc/gbc_trans_ctrl.c index 4230c7877..13c86723b 100644 --- a/main/gbc/gbc_trans_ctrl.c +++ b/main/gbc/gbc_trans_ctrl.c @@ -784,7 +784,7 @@ void TRANS_case(void) control_enter(RS_CASE); - like = FALSE; + like = TRANS_is(RS_LIKE); for(i = 0; ; i++) { @@ -798,19 +798,18 @@ void TRANS_case(void) TRANS_expression(FALSE); CODE_op(C_EQ, 2);*/ - if (TRANS_is(RS_TO)) + if (like) + { + CODE_push_local(local); + TRANS_expression(FALSE); + CODE_op(C_LIKE, 0, 2, TRUE); + } + else if (TRANS_is(RS_TO)) { CODE_push_local(local); TRANS_expression(FALSE); CODE_op(C_LE, 0, 2, TRUE); } - else if (TRANS_is(RS_LIKE) || like) - { - like = TRUE; - CODE_push_local(local); - TRANS_expression(FALSE); - CODE_op(C_LIKE, 0, 2, TRUE); - } else { TRANS_expression(FALSE);