To: vim_dev@googlegroups.com Subject: Patch 8.2.0045 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0045 (after 8.2.0044) Problem: Script test fails. Solution: For numbers "is" and "isnot" work like "==" and "!=". Files: src/eval.c *** ../vim-8.2.0044/src/eval.c 2019-12-25 18:14:10.481839651 +0100 --- src/eval.c 2019-12-25 19:32:38.508741445 +0100 *************** *** 6261,6267 **** else if (typ1->v_type == VAR_FUNC || typ2->v_type == VAR_FUNC || typ1->v_type == VAR_PARTIAL || typ2->v_type == VAR_PARTIAL) { ! if (type != ETYPE_EQUAL && type != ETYPE_NEQUAL) { emsg(_("E694: Invalid operation for Funcrefs")); clear_tv(typ1); --- 6261,6268 ---- else if (typ1->v_type == VAR_FUNC || typ2->v_type == VAR_FUNC || typ1->v_type == VAR_PARTIAL || typ2->v_type == VAR_PARTIAL) { ! if (type != ETYPE_EQUAL && type != ETYPE_NEQUAL ! && type != ETYPE_IS && type != ETYPE_ISNOT) { emsg(_("E694: Invalid operation for Funcrefs")); clear_tv(typ1); *************** *** 6306,6320 **** n1 = FALSE; switch (type) { case ETYPE_EQUAL: n1 = (f1 == f2); break; case ETYPE_NEQUAL: n1 = (f1 != f2); break; case ETYPE_GREATER: n1 = (f1 > f2); break; case ETYPE_GEQUAL: n1 = (f1 >= f2); break; case ETYPE_SMALLER: n1 = (f1 < f2); break; case ETYPE_SEQUAL: n1 = (f1 <= f2); break; case ETYPE_UNKNOWN: - case ETYPE_IS: - case ETYPE_ISNOT: case ETYPE_MATCH: case ETYPE_NOMATCH: break; // avoid gcc warning } --- 6307,6321 ---- n1 = FALSE; switch (type) { + case ETYPE_IS: case ETYPE_EQUAL: n1 = (f1 == f2); break; + case ETYPE_ISNOT: case ETYPE_NEQUAL: n1 = (f1 != f2); break; case ETYPE_GREATER: n1 = (f1 > f2); break; case ETYPE_GEQUAL: n1 = (f1 >= f2); break; case ETYPE_SMALLER: n1 = (f1 < f2); break; case ETYPE_SEQUAL: n1 = (f1 <= f2); break; case ETYPE_UNKNOWN: case ETYPE_MATCH: case ETYPE_NOMATCH: break; // avoid gcc warning } *************** *** 6322,6330 **** #endif /* ! * If one of the two variables is a number, compare as a number. ! * When using "=~" or "!~", always compare as string. ! */ else if ((typ1->v_type == VAR_NUMBER || typ2->v_type == VAR_NUMBER) && type != ETYPE_MATCH && type != ETYPE_NOMATCH) { --- 6323,6331 ---- #endif /* ! * If one of the two variables is a number, compare as a number. ! * When using "=~" or "!~", always compare as string. ! */ else if ((typ1->v_type == VAR_NUMBER || typ2->v_type == VAR_NUMBER) && type != ETYPE_MATCH && type != ETYPE_NOMATCH) { *************** *** 6332,6346 **** n2 = tv_get_number(typ2); switch (type) { case ETYPE_EQUAL: n1 = (n1 == n2); break; case ETYPE_NEQUAL: n1 = (n1 != n2); break; case ETYPE_GREATER: n1 = (n1 > n2); break; case ETYPE_GEQUAL: n1 = (n1 >= n2); break; case ETYPE_SMALLER: n1 = (n1 < n2); break; case ETYPE_SEQUAL: n1 = (n1 <= n2); break; case ETYPE_UNKNOWN: - case ETYPE_IS: - case ETYPE_ISNOT: case ETYPE_MATCH: case ETYPE_NOMATCH: break; // avoid gcc warning } --- 6333,6347 ---- n2 = tv_get_number(typ2); switch (type) { + case ETYPE_IS: case ETYPE_EQUAL: n1 = (n1 == n2); break; + case ETYPE_ISNOT: case ETYPE_NEQUAL: n1 = (n1 != n2); break; case ETYPE_GREATER: n1 = (n1 > n2); break; case ETYPE_GEQUAL: n1 = (n1 >= n2); break; case ETYPE_SMALLER: n1 = (n1 < n2); break; case ETYPE_SEQUAL: n1 = (n1 <= n2); break; case ETYPE_UNKNOWN: case ETYPE_MATCH: case ETYPE_NOMATCH: break; // avoid gcc warning } *************** *** 6356,6362 **** --- 6357,6365 ---- n1 = FALSE; switch (type) { + case ETYPE_IS: case ETYPE_EQUAL: n1 = (i == 0); break; + case ETYPE_ISNOT: case ETYPE_NEQUAL: n1 = (i != 0); break; case ETYPE_GREATER: n1 = (i > 0); break; case ETYPE_GEQUAL: n1 = (i >= 0); break; *************** *** 6370,6377 **** n1 = !n1; break; - case ETYPE_IS: - case ETYPE_ISNOT: case ETYPE_UNKNOWN: break; // avoid gcc warning } } --- 6373,6378 ---- *** ../vim-8.2.0044/src/version.c 2019-12-25 18:14:10.481839651 +0100 --- src/version.c 2019-12-25 19:30:49.517142276 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 45, /**/ -- DEAD PERSON: I'm getting better! CUSTOMER: No, you're not -- you'll be stone dead in a moment. MORTICIAN: Oh, I can't take him like that -- it's against regulations. The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///